Tip 1: Creating a data frame from a series of data vectors.
# make some data
d1 = rnorm(100,300,50)
d2 = rnorm(100,325,50)
d3 = rnorm(100,350,50)
# combine the data into a matrix
all.data = cbind(d1,d2,d3)
# turn the data into a data frame
all.data = data.frame(all.data)
# you can now access the data by column labels
all.data$d1
#you can add a new column
d4 = 0
all.data = cbind(all.data,d4)
# and even do math within the data frame
all.data$d4 = all.data$d3 - all.data$d2
# make some data
d1 = rnorm(100,300,50)
d2 = rnorm(100,325,50)
d3 = rnorm(100,350,50)
# combine the data into a matrix
all.data = cbind(d1,d2,d3)
# turn the data into a data frame
all.data = data.frame(all.data)
# you can now access the data by column labels
all.data$d1
#you can add a new column
d4 = 0
all.data = cbind(all.data,d4)
# and even do math within the data frame
all.data$d4 = all.data$d3 - all.data$d2