Data management

dplyr

Merge and append

Merge

both <- merge( myleft, myright, by=c("id","workshop") )

with different names:

both <- merge( myleft,myright,
               by.x=c("id", "workshop"),
               by.y=c("subject","shortCourse")
)

Append

both <- rbind(data1, data2)

Unmatched cols

Reshape

library(tidyr)

xxx

Data import

Import Stata

library(foreign)

mydata <- read.dta("filename")

Export via Excel

Import Excel

library(readxl)

data <- read_excel("", sheet = "sheetname", col_names = TRUE, skip = 0)

Export

library(xlsx)
write.xlsx(mydata100, file = "test", sheetName = "sheet")  

Import Textfile

Delimeted

library(readr)

CSV

library(readr)


bjornerstedt/assist documentation built on Sept. 8, 2017, 2:02 p.m.