R中的WriteWebGL

R中的WriteWebGL,r,rgl,R,Rgl,我正在尝试使用WrtieWebGL函数从rgl软件包中导出使用plot3d函数制作的三维打印,用于web查看。我不太理解WriteWebGL文档中的示例,因为它保存到临时目录中。有人能提供一个如何使用此功能的示例和/或指出我在使用过程中的错误吗?谢谢你的时间和帮助 attach(dataset1) plot3d(Days_Prep_Time,ACT_Score,Coffee,size=5,col="blue", type="s") writeWebGL(dir =

我正在尝试使用WrtieWebGL函数从rgl软件包中导出使用plot3d函数制作的三维打印,用于web查看。我不太理解WriteWebGL文档中的示例,因为它保存到临时目录中。有人能提供一个如何使用此功能的示例和/或指出我在使用过程中的错误吗?谢谢你的时间和帮助

   attach(dataset1)       
   plot3d(Days_Prep_Time,ACT_Score,Coffee,size=5,col="blue", type="s")
   writeWebGL(dir = "webGL", filename = file.path(dir, "index.html"), 
   template = system.file(file.path("WebGL", "template.html"), package = "rgl",
   snapshot = TRUE, font = "Arial")
我得到以下错误:

   Error in writeWebGL(dir = "webGL", filename = file.path(dir, "index.html"),  : 
   template ‘’ does not contain %WebGL%
   In addition: Warning message:
   In file(con, "r") :
   file("") only supports open = "w+" and open = "w+b": using the former

您正在将
快照
字体
参数添加到
系统文件
函数,而不是
writeWebGL
函数:

writeWebGL(dir = "webGL", filename = file.path(dir, "index.html"), 
template = system.file(file.path("WebGL", "template.html"), package = "rgl"),
snapshot = TRUE, font = "Arial")
特别要注意的是

system.file(file.path("WebGL", "template.html"), package = "rgl")
从控制台返回正确的路径,而

system.file(file.path("WebGL", "template.html"), package = "rgl", snapshot = TRUE, font = "Arial")
返回