search for: druglist

Displaying 1 result from an estimated 1 matches for "druglist".

2012 Nov 09
1
R function data variable name argument
...a function that will plot different lines for subsets of a dataset. For example, I am trying to look at different drug groups (drug2), let's say 1,2,3,4, and 5. The data has 2 different rates, college students and high school students (var names cs and hs). Here is my code: stuff<-function(druglist, rate, yaxislabel) { drugs<-read.csv("drugs.csv", header=T) druglist.data<-drugs[which(drugs$drug2 %in% druglist),] par(xpd=NA,oma=c(3,0,3,16),usr=c(1,40,0,0.5)) #print(rate) plot(druglist.data$counter, druglist.data$rate, type="n", xlab="Quarter", ylab="yax...