Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

interactive graphics in ESS with manipulate package

Tags:

r

rstudio

ess

Anyone know if its possible to use these rs_ functions without RStudio? I pulled this example from the coursera class Statistical Inference,

library(UsingR); data(galton)
library(manipulate)
myHist <- function(mu){
  hist(galton$child,col="blue",breaks=100)
  lines(c(mu, mu), c(0, 150),col="red",lwd=5)
  mse <- mean((galton$child - mu)^2)
  text(63, 150, paste("mu = ", mu))
  text(63, 140, paste("Imbalance = ", round(mse, 2)))
}
> manipulate(myHist(mu), mu = slider(62, 74, step = 0.5))
Error in FUN("rs_createUUID"[[1L]], ...) : no such symbol rs_createUUID

I didn't realize there were libraries that required RStudio. I'm wondering if there is an interface for between RStudio and ESS, or some way to make the above work.

like image 776
Rorschach Avatar asked Nov 11 '22 08:11

Rorschach


1 Answers

You'll need to have a go at cloning and making the packages under https://github.com/rstudio/rstudio/tree/master/src/cpp work in a standalone (i.e. not wiht RStudio running) fashion. Those will require (at a minimum) the Rcpp package to be installed and may need inline, too (not 100% sure).

Check the license for those files since you may only be able to use those outside RStudio under certain limitations/constraints.

like image 173
hrbrmstr Avatar answered Nov 15 '22 07:11

hrbrmstr