You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Recently I try to use hPlot fuction for pie plot. When I run in the R platform, it plots successfully. But when I write my script in an R scirpt "pie.R" and run by Rscript pie.R, the following error appears:
Error in rChart$copy() : could not find function "new"
Calls: hPlot ->
Execution halted
The following is the pie.data used to plot:
type value label
1 O 133 O:20.7%
2 A 78 A:12.1%
3 B 69 B:10.7%
4 C 7 C:1.1%
5 D 73 D:11.3%
6 Other 284 Other:44.1%
Here is my script from "pie.R" :
pie1<-hPlot(x = "label", y = "value", data = pie.data, type = "pie",title=opt$title)
pie1$colors(rep(col,length=nrow(pie.data)))
pie1$legend(align = 'right', verticalAlign = 'top', layout = 'vertical',showInLegend='true')
out=paste(opt$outfile,".html",sep = "")
pie1$save(out,standalone=TRUE)
How can I deal with this problem? Can the rCharts be used in Rscript?
Thanks a lot for any suggestion!
The text was updated successfully, but these errors were encountered:
Well, I read somewhere that --default-packages=methods,utils needs to be passed to Rscript to work around this: stan-dev/rstan#190
Also, it seems, Rscript being missing the load of the methods package. This can also be fixed by calling library('methods') at the beginning of your script: dhimmel/elevcan#1.
Hi,
Recently I try to use hPlot fuction for pie plot. When I run in the R platform, it plots successfully. But when I write my script in an R scirpt "pie.R" and run by Rscript pie.R, the following error appears:
Error in rChart$copy() : could not find function "new"
Calls: hPlot ->
Execution halted
The following is the pie.data used to plot:
type value label
1 O 133 O:20.7%
2 A 78 A:12.1%
3 B 69 B:10.7%
4 C 7 C:1.1%
5 D 73 D:11.3%
6 Other 284 Other:44.1%
Here is my script from "pie.R" :
pie1<-hPlot(x = "label", y = "value", data = pie.data, type = "pie",title=opt$title)
pie1$colors(rep(col,length=nrow(pie.data)))
pie1$legend(align = 'right', verticalAlign = 'top', layout = 'vertical',showInLegend='true')
out=paste(opt$outfile,".html",sep = "")
pie1$save(out,standalone=TRUE)
How can I deal with this problem? Can the rCharts be used in Rscript?
Thanks a lot for any suggestion!
The text was updated successfully, but these errors were encountered: