I'm trying to make use of the following
hd <- read.csv("mydata.csv") #read data into hd
x <- c("test_column1","test_column2") #Our vector with string names
test <- test = (head(x,2)) #this returns "test_column2"
barplot(100*prop.table(table(hd$test)))
I'm getting error "(converted from warning) no non-missing arguments to min; returning Inf" I assume that is because it thinks that the variable is an integer. Can someone explain to me?
This would work if it were (table(hd$test_column1)). But I want to put in a variable after the $ so I can make a for loop to make multiple barplots