GGPLOT2

85 views
Skip to first unread message

SRINI

unread,
May 7, 2016, 8:19:09 AM5/7/16
to ggplot2
 
I am importing SAS dataset  to R and using as source data to draw a graph in ggplot2. It produces only values with list not graph. Error is given below. can you please help me troubleshooting?. Thanks.

library(ggplot2)
library(haven)
data = read_sas('C:\\Users\\kk\\Documents\\adpc1.sas7bdat')
adpcc = ggplot(data, aes(x=visit, y=pcstresn)) + geom_point()
adpcc
Error in eval(expr, envir, enclos) : object 'visit' not found

Ista Zahn

unread,
May 7, 2016, 8:44:33 AM5/7/16
to SRINI, ggplot2

The error seems clear to me. There is no column named 'visit' in data. Use

names(data)

and

str(data)

to see what's in there, and remember that R (unlike SAS) is case sensitive.

Best,
Ista

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Rauser

unread,
May 9, 2016, 1:27:45 PM5/9/16
to Ista Zahn, SRINI, ggplot2
"The error seems clear to me."

I too suffer from R Stockholm Syndrome, "in which hostages express empathy and sympathy and have positive feelings toward their captors, sometimes to the point of defending and identifying with the captors. These feelings are generally considered irrational in light of the danger or risk endured by the victims, who essentially mistake a lack of abuse from their captors for an act of kindness."  (https://en.wikipedia.org/wiki/Stockholm_syndrome)

Your advice is spot on, and I'm sure appreciated by the OP, but we too easily forget how cryptic R's error messages are for new users.  

I mean no disrespect or offense... your opening sentence just made me chuckle, and then made me think.

Best,

-J






Ista Zahn

unread,
May 9, 2016, 2:10:35 PM5/9/16
to John Rauser, SRINI, ggplot2
Hi John,

Yes, I was thinking much the same thing when I wrote my original
reply. That is why I carefully said "seems clear to me" rather than
"seems clear." or the (clearly wrong) "is clear."!

Best,
Ista

KAMALAKKANNAN SRINIVASAN

unread,
Jan 24, 2018, 10:47:42 PM1/24/18
to ggp...@googlegroups.com
Hi All,

> .libPaths()

[1] "C:/Users/kks/AppData/Local/Temp/RtmpKWQd5u/downloaded_packages"
[2] "C:/Program Files/R/R-3.4.2/library"

Installed ggplot2 package in library 1. above after upgrading to latest R version. . But when i load, it throws following error.

Error in library(ggplot2) : there is no package called ‘ggplot2’

Any help will be appreciated.

Thanks,
Kamal.


On Sat, May 7, 2016 at 8:44 AM, Ista Zahn <ista...@gmail.com> wrote:

The error seems clear to me. There is no column named 'visit' in data. Use

names(data)

and

str(data)

to see what's in there, and remember that R (unlike SAS) is case sensitive.

Best,
Ista

On May 7, 2016 8:19 AM, "SRINI" <somka...@gmail.com> wrote:
 
I am importing SAS dataset  to R and using as source data to draw a graph in ggplot2. It produces only values with list not graph. Error is given below. can you please help me troubleshooting?. Thanks.

library(ggplot2)
library(haven)
data = read_sas('C:\\Users\\kk\\Documents\\adpc1.sas7bdat')
adpcc = ggplot(data, aes(x=visit, y=pcstresn)) + geom_point()
adpcc
Error in eval(expr, envir, enclos) : object 'visit' not found

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com

More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages