I recently tried to make R highlight certain features in a scatterplot matrix pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5)) this worked fine but when I wanted to add another condition i.e where another variable SlowSleep = 7.7, this is what I got > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5 & SlowSleep=7.7)) Error: syntax error > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5 & SlowSleep= 7.7)) Error: syntax error > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5 & SlowSleep = 7.7)) Error: syntax error I then tried two separate col statements as below > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5) * col1=2+as.integer(SlowSleep = 7.7)) Error: syntax error > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5) * col=2+as.integer(SlowSleep = 7.7)) Error: syntax error But still no joy, can you recommend anything brett.
Dear Bret, You appear to have used = (for assignment or argument specification) when you meant == (equals). I hope this helps, John -------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox --------------------------------> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Brett > Stansfield > Sent: Thursday, March 17, 2005 9:09 PM > To: R help (E-mail) > Subject: [R] (no subject) > > I recently tried to make R highlight certain features in a > scatterplot matrix > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5)) > > this worked fine but when I wanted to add another > condition i.e where another variable SlowSleep = 7.7, this is > what I got > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", > "loglife", "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep=7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", > "loglife", "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep= 7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", > "loglife", "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep = 7.7)) > Error: syntax error > I then tried two separate col statements as below > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", > "loglife", "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5) > * col1=2+as.integer(SlowSleep = 7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", > "loglife", "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5) > * col=2+as.integer(SlowSleep = 7.7)) > Error: syntax error > But still no joy, can you recommend anything brett. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html
Please use a meanful subject line! You want SlowSleep == 7.7, not SlowSleep = 7.7. Have you read the posting guide as others (including myself) have suggested? Have you also read "An Introduction To R," which comes with all R distributions? --sundar Brett Stansfield wrote on 3/17/2005 8:09 PM:> I recently tried to make R highlight certain features in a scatterplot > matrix > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", > "logbw")], > * col=1+as.integer(ParaSleep > 5.5)) > > this worked fine but when I wanted to add another condition i.e > where another variable SlowSleep = 7.7, this is what I got > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep=7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep= 7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep = 7.7)) > Error: syntax error > I then tried two separate col statements as below > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5) > * col1=2+as.integer(SlowSleep = 7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5) > * col=2+as.integer(SlowSleep = 7.7)) > Error: syntax error > But still no joy, can you recommend anything > brett. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Please use a meaningful subject line! You want SlowSleep == 7.7, not SlowSleep = 7.7. Have you read the posting guide as others (including myself) have suggested? Have you also read "An Introduction To R," which comes with all R distributions? --sundar Brett Stansfield wrote on 3/17/2005 8:09 PM:> I recently tried to make R highlight certain features in a scatterplot > matrix > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", > "logbw")], > * col=1+as.integer(ParaSleep > 5.5)) > > this worked fine but when I wanted to add another condition i.e > where another variable SlowSleep = 7.7, this is what I got > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep=7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep= 7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5 & SlowSleep = 7.7)) > Error: syntax error > I then tried two separate col statements as below > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5) > * col1=2+as.integer(SlowSleep = 7.7)) > Error: syntax error > > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", > "loggest", "logbw")], > * col=1+as.integer(ParaSleep > 5.5) > * col=2+as.integer(SlowSleep = 7.7)) > Error: syntax error > But still no joy, can you recommend anything > brett. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html