I am trying to subset a data frame by using the cbind()
function and $
selecting the colum names:
stormData <- read.csv("/Users/b.w.h/Documents/R/Coursera/Reproducible Research /Project 2/repdata-data-StormData.csv");
stormDataSubset <- as.data.frame(c(stormData$STATE, stormData$EVTYPE, stormData$FATALITIES, stormData$INJURIES));
head(stormDataSubset);
But it only returns the index column and the state column:
Why isn't this subsetting method working? And what should I do to properly subset it? Thanks!