This document provides an introduction to R programming. It outlines key aspects of R including that it is an interpreted, free and open-source language widely used for statistical analysis. The document discusses how R works by storing variables, data, functions and results as objects in memory. It also covers R's interactive console interface, data types like vectors and factors, control structures like for loops and if/else statements, writing user-defined functions, and handling strings and regular expressions. References for additional help and learning resources are provided at the end.
In this section, we will see advanced concepts related to Python. We will introduce you to different types of data structures, like: lists, tuples, and dictionaries.
We will also define an important concept in programming which is control flow statements. We will show how to use conditional and repetitive statements.
Finally, we will talk about different concepts of object oriented programming (beside other concepts), and how to implement them in python.
[Notebook link] (https://drive.google.com/file/d/11AjOGxmhz-YOHVVqDVQVlpjVJMrSrDn2/view?usp=drivesdk)
This talk will cover various aspects of Logic Programming. We examine Logic Programming in the contexts of Programming Languages, Mathematical Logic and Machine Learning.
We will we start with an introduction to Prolog and metaprogramming in Prolog. We will also discuss how miniKanren and Core.Logic differ from Prolog while maintaining the paradigms of logic programming.
We will then cover the Unification Algorithm in depth and examine the mathematical motivations which are rooted in Skolem Normal Form. We will describe the process of converting a statement in first order logic to clausal form logic. We will also discuss the applications of the Unification Algorithm to automated theorem proving and type inferencing.
Finally we will look at the role of Prolog in the context of Machine Learning. This is known as Inductive Logic Programming. In that context we will briefly review Decision Tree Learning and it's relationship to ILP. We will then examine Sequential Covering Algorithms for learning clauses in Propositional Calculus and then the more general FOIL algorithm for learning sets of Horn clauses in First Order Predicate Calculus. Examples will be given in both Common Lisp and Clojure for these algorithms.
Pierre de Lacaze has over 20 years’ experience with Lisp and AI based technologies. He holds a Bachelor of Science in Applied Mathematics and Computer Science and a Master’s Degree in Computer Science. He is the president of LispNYC.org
In this section, we will see advanced concepts related to Python. We will introduce you to different types of data structures, like: lists, tuples, and dictionaries.
We will also define an important concept in programming which is control flow statements. We will show how to use conditional and repetitive statements.
Finally, we will talk about different concepts of object oriented programming (beside other concepts), and how to implement them in python.
[Notebook link] (https://drive.google.com/file/d/11AjOGxmhz-YOHVVqDVQVlpjVJMrSrDn2/view?usp=drivesdk)
This talk will cover various aspects of Logic Programming. We examine Logic Programming in the contexts of Programming Languages, Mathematical Logic and Machine Learning.
We will we start with an introduction to Prolog and metaprogramming in Prolog. We will also discuss how miniKanren and Core.Logic differ from Prolog while maintaining the paradigms of logic programming.
We will then cover the Unification Algorithm in depth and examine the mathematical motivations which are rooted in Skolem Normal Form. We will describe the process of converting a statement in first order logic to clausal form logic. We will also discuss the applications of the Unification Algorithm to automated theorem proving and type inferencing.
Finally we will look at the role of Prolog in the context of Machine Learning. This is known as Inductive Logic Programming. In that context we will briefly review Decision Tree Learning and it's relationship to ILP. We will then examine Sequential Covering Algorithms for learning clauses in Propositional Calculus and then the more general FOIL algorithm for learning sets of Horn clauses in First Order Predicate Calculus. Examples will be given in both Common Lisp and Clojure for these algorithms.
Pierre de Lacaze has over 20 years’ experience with Lisp and AI based technologies. He holds a Bachelor of Science in Applied Mathematics and Computer Science and a Master’s Degree in Computer Science. He is the president of LispNYC.org
Its the first phase of the compiler,useful in generating lexemes ,tokens and matching of the pattern.Its helpful in solving GATE/ UGCNET problems.For more insight refer http://tutorialfocus.net/
In this lesson, we will start by defining the basic concept related to Pyhton: operations, variables, and basic types.
Then we will define the concept of a function, and how to use it.
[Notebook link]( https://drive.google.com/file/d/1T4T32lyCkT4J992tfnKUADQU88Qvlrvc/view?usp=drivesdk)
Finally, we will explain the concept of modules and libraries. And, we will show how to install these libraries in Google Colab.
Library Functions, User defined functions, Recursion, Function declaration, Local and global variables, Use of array in function, Passing by Value, Passing by Address
https://github.com/ashim888/csit-c
In this slide you will explore more about how to make derivations ,design parse tree ,what is ambiguity and how to remove ambiguity ,left recursion ,left factoring .
New channel distributions unlock retail indiaeTailing India
New retail channels are neutralizing the traditional advantage that distribution offered and are providing opportunities for innovative brands to emerge.
Its the first phase of the compiler,useful in generating lexemes ,tokens and matching of the pattern.Its helpful in solving GATE/ UGCNET problems.For more insight refer http://tutorialfocus.net/
In this lesson, we will start by defining the basic concept related to Pyhton: operations, variables, and basic types.
Then we will define the concept of a function, and how to use it.
[Notebook link]( https://drive.google.com/file/d/1T4T32lyCkT4J992tfnKUADQU88Qvlrvc/view?usp=drivesdk)
Finally, we will explain the concept of modules and libraries. And, we will show how to install these libraries in Google Colab.
Library Functions, User defined functions, Recursion, Function declaration, Local and global variables, Use of array in function, Passing by Value, Passing by Address
https://github.com/ashim888/csit-c
In this slide you will explore more about how to make derivations ,design parse tree ,what is ambiguity and how to remove ambiguity ,left recursion ,left factoring .
New channel distributions unlock retail indiaeTailing India
New retail channels are neutralizing the traditional advantage that distribution offered and are providing opportunities for innovative brands to emerge.
Varsha Pawar resides in a village in Maharashtra was like any other housewife until she started selling solar cook stoves and lamps in her neighbourhood a little over a year ago. Today, she is the Sarpanch (village council chief) of Tirth Khurd (her village name) advocating the use of clean energy not only in her village but also in the entire Tuljapur administrative block.
Former tcs chief's resignation from government posts sparks buzzeTailing India
Former TCS chief S Ramadorai, a key official driving the government's ambitious skill development agenda, has resigned from the posts of chairman of National Skill Development Agency (NSDA) and National Skill Development Corporation (NSDC).
Yesterday, there was a news that Alibaba is in talks to acquire Snapdeal which was later dismissed by Kunal Bahl, Co-founder of Snapdeal. The greater idea emerging out of the recent potential developments directs into one thought; everybody wants to grab a slice of the world’s fastest growing eCommerce economy.
Rallying Support for a Common Cause: Drive Action and Inspire Change. A look at how strategic donor communications and nonprofit marketing can inspire audiences to take meaningful action and generate ROI.
Key lecture for the EURO-BASIN Training Workshop on Introduction to Statistical Modelling for Habitat Model Development, 26-28 Oct, AZTI-Tecnalia, Pasaia, Spain (www.euro-basin.eu)
Functional Python Webinar from October 22nd, 2014Reuven Lerner
Slides from my free functional Python webinar, given on October 22nd, 2014. Discussion included functional programming as a perspective, passing functions as data, and writing programs that take functions as parameters. Includes (at the end) a coupon for my new ebook, Practice Makes Python.
The presentation is a brief case study of R Programming Language. In this, we discussed the scope of R, Uses of R, Advantages and Disadvantages of the R programming Language.
2. Outline
• R as a new language
• R as a calculator
• Variables and Operators
• Data Structure
• Control Structure
• Functions
• String handle and regex
Paurush Praveen 2
3. R-Introduction
A programming/scripting language widely
used in statistical works
An interpreted language, not a compiled
one
Free | Easy | Support | Compatibility
Object oriented
Paurush Praveen 3
4. How does it work
• variables, data, functions, results, etc, are
stored in the active memory of the computer
in the form of objects which have a name.
• The user can do actions on these objects
with operators (arithmetic, logical,
comparison, ...) and functions (which are
themselves objects).
• The use of operators is relatively intuitive
Paurush Praveen 4
5. How does it look
• command prompt symbol “>”
Editor
Console
Paurush Praveen 5
6. Input / Output
• Interactive session
• Input at the console itself
• input a script
• source(“codefile”)
• Usually R gives output on the command line.
• To save as file use
sink("file.txt") <Not for graphical output>
##return to the normal mode
sink()
Paurush Praveen 6
7. Running R-programs
• Save your commands in a file
(viz. commands.R)
• Call R on the command line:
R commands.R
• Call the script from within R:
> commands.R
Paurush Praveen 7
8. R as a calculator
• + - * / work as usual
• pi etc. exist as Functions with brackets:
sqrt(pi)
• a call without paretheses gives the
sourcecode
• # denote comments
• assignment by <-
• library()
• data()
Paurush Praveen 8
9. Operators
Binary operators work on vectors,
Source: http://www.statmethods.net/management/operators.html
matrices and scalars
Paurush Praveen 9
10. Data Types
• A vector contains an indexed set of values
that are all of the same type:
• logical
• numeric
• complex
• Character
– The numeric type can be further broken down into
integer, single, and double types (but this is only
important when making calls to foreign functions, eg. C
or Fortran.)
Paurush Praveen 10
11. Data Structures
• Data Structures
– vector - arrays of the same type
– factor - categorical
– list - can contain objects of different types
– matrix - table of numbers
– data.frame - table of numbers and/or characters
– environment
– hashtable
– function
Paurush Praveen 11
12. Control Structures
for and while Loops
The syntax for writing for loops in R is
for(i in 1:N){
Loop Code*
}
The syntax for while loops in R is
while(logical argument){
Loop Code*
}
Repeat {expression}
*where Loop Code should be substituted with the code you want to run in the loop.
Paurush Praveen 12
14. Writing Functions
• Writing R functions provides a means of
adding new functionality to the language
• Functions that a user writes have the same
status as those which are provided with R.
• Reading the functions provided with the R
system is a good way to learn how to write
functions.
Paurush Praveen 14
15. Writing Functions
• You can declare your own function in R using
the function() command. The syntax is
myfunction() <- function(input1,input2,..)
{
Function code
}
• Functions can be called with the arguments
myfunction(argument1, argument2,...)
Paurush Praveen 15
16. String Handle
• Character strings are one of the basic types in R
• A character vector is a vector of character strings,
not characters
• "" is an empty string
• Special characters -> a backslash followed by a
symbol for the special character
– toupper(x) & tolower(x) : To convert case
– chartr(old,new,x) Replaces any occurrence in x
– sub and gsub for substitution
Paurush Praveen 16
17. Regular Expression
• Regular Expression (Regex)
• Properties
– Can be combined
– Can be used with metacharacters to define the
pattern
• Using regular expressions
– grep (pattern,x)
– grep (pattern, x, value=TRUE)
Paurush Praveen 17
18. Further References
• Use ?<command> in console to seek help or
help(<command>)
• http://cran.r-project.org/doc/manuals/R-intro.html
• http://www.cyclismo.org/tutorial/R/
• Books
• Web helps can be more useful
• Google to search for specific problems
• http://www.rseek.org/ is a search
engine for R specific topics
Another Book "R in a Nutshell", Adler J, Oreilly
Paurush Praveen 18