I am lost as to how to convert a specific column from a .csv file into a matrix. I was able to do it without using the matrix function, but how can I do it using the matrix function?
setwd("C:/Users/Owner/Folder/data/data")
getwd()
options(max.print=999999)
df=read.csv("C:/Users/Owner/Folder/data/data/file.csv",
stringsAsFactors=FALSE,
header=TRUE)
a = df[889:1248, 4]
dim(a) <- c(30, 12)
rowNames = c(1961:1990)
colNames = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
dimnames(a) = list(rowNames, colNames)
print(a)