## VARIOUS LOOPING TECHNIQUES in R with EXAMPLES

Looping in R Ankan Basu / Learning from Example codes from coursera! Wednesday, August 13, 2014 VARIOUS LOOPING TECHNIQUES in R with EXAMPLES In this text, we are going to over some of the most extraordinary functions to help us loop in R. Mastering…

## Dates and Times in R

Dates and Times in R Ankan Basu / Learning from Example codes from coursera! Tuesday, August 12, 2014 Dealing with dates Dates are represented by the Date class Times are represented by the POSIXct or the POSIXlt class Dates and times…

## Conditionals in R – For, While, Repeat Loops

Control Structures in R Ankan Basu / Learning from Example codes from coursera! Tuesday, August 12, 2014 Some example codes from R course. Enhanced with comments and presented in a Knit HTML format. IF ELSE in R x=3 #initialize x as…

## Data Tables In R and Example Subsetting

Data Table 1. You can apply all function that you can apply to data frames 2. data.table is written in C (I am learning that language too!) 3. Much faster. load from library In this exercise, first lets create a…

## reading from JSON data in R

#reading from JSON data in R library(jsonlite) #JSON to my user account json_data=fromJSON(“https://api.github.com/users/hydrogeologist/repos”) names(json_data) names(json_data\$owner) json_data\$owner\$login #Writing data frames into JSON My_JSON=toJSON(iris, pretty=T) cat(My_JSON) iris2=fromJSON(My_JSON) head(iris2)

## Creating directory using R command

# Creating directory using R command if(!file.exists(“testfolder”)){ dir.create(“testfolder”) }

## Modifying Vectors in R – Example Code

In this example, we have created a vector X and later changed all values of vector x>10 = 4.   > x <- c(17, 14, 4, 5, 13, 12, 10) > x[x>10] [1] 17 14 13 12 > x [1]…

## Example of input field with Shiny in R

Just Follow the code. The program is based on Developing Data products course on Coursera. I have added more comments and examples to enhance understanding. ui.R # A shiny code requires two files: ui.R and server.R # This code will…