HOWTO: Basic data processing in R

Reading CSV data without header

MyData = read.csv(“D:/temp/iris.txt”,header=FALSE)

colnames(MyData) <- c(“col1″,”col2″,”col3″,”col4”)

 

Reading Tab-delimited data without header

MyData = read.table(“D:/temp/iris.txt”,sep=”\t”,header=FALSE)

colnames(MyData) <- c(“col1″,”col2″,”col3″,”col4”)

 

Viewing table

View(MyData)

 

Removing column from table

MyData$col4<-NULL

 

List memory content

ls()

 

Remove data

rm(MyData)