how do i runt this command hist(dataset$V3)
by using a variable? I have tried doing something like this but no joy paste("dataset$",q,sep="")
. Can anyone advise?
> dataset
Rec.Open.Date V3 V4 V5
1 2014-12-03 1 11 111
2 2014-12-04 2 12 112
3 2014-12-05 3 13 113
4 2014-12-06 4 14 114
5 2014-12-07 5 15 115
>
> hist(dataset$V3)
>
> q<-"V3"
> q
[1] "V3"
>
> paste("dataset$",q,sep="")
[1] "dataset$V3"
>
> hist(paste("dataset$",q,sep=""))
Error in hist.default(paste("dataset$", q, sep = "")) :
'x' must be numeric