You would also have to load the library you're going to use i.e., put this,

library("ggplot2")

Of course, ggplot2 isn't installed on sage cell server, as Andrey
mentioned.  It is installed on cocalc though:

https://cocalc.com/share/public_paths/47a78e5c181266337438c057b4f07e758413c2b5

On Tue, May 31, 2022 at 9:35 AM Robert Beezer

<[email protected]> wrote:
>
> Hellping a colleague with R in a Sage Cell, so I've chosen R as the language 
> and used the main site for the Sage Cell.  i don't know R very well and she 
> doesn't know Sage very well.  ;-)
>
> Code:
>
> age <- c(25, 30, 56)
> gender <- c("male", "female", "male")
> weight <- c(160, 110, 220)
> mydata <- data.frame(age,gender,weight)
> ggplot(mydata, aes(age,weight))+ geom_point()
>
> yields a traceback that ends in
>
> RRuntimeError: Error in ggplot(mydata, aes(age, weight)) : could not find 
> function "ggplot"
>
> I understood that the "ggplot2" library was pre-installed.
>
> https://github.com/sagemath/sagecell/blob/master/contrib/vm/container_manager.py#L260
>
> Can anybody see what I've got wrong?
>
> Thanks,
> Rob
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-cell" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-cell/49e02a9a-9920-494f-8030-e2f34ae8fc4fn%40googlegroups.com.



--
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-cell/CACLE5GCHDwgXfntcD0uASwuVqxugg0moTW_EpAY3s%2BRRLmcW9w%40mail.gmail.com.

Reply via email to