Trying to make movie of 3D PCA plot (rgl) using movie3d

冷暖自知 提交于 2021-02-08 05:39:39

问题


I have made a rgl 3D PCA plot in R using the pca3d package, and I am trying to make a gif file containing a movie of the rotating plot using movie3d. There is a function in the pca3d package (makeMoviePCA), that passes its arguments to movie3d. Here is the command I am using:

pca3d(pc, components = 1:3, title=TRUE, col=col_conditions, radius=2)

makeMoviePCA(dir="/Users/workdir", clean=TRUE, type = "gif", movie = "movie", convert=TRUE)

This plays the movie like I want to, but does not save it into a gif file, and displays the following error:

Writing 'movie100.png'
...
Writing 'movie120.png'

Error in system("convert --version", intern = TRUE) : 
  error in running command
sh: convert: command not found

EDIT: I fixed this by telling R where "convert" is by using

Sys.setenv(PATH=paste("/opt/local/bin", Sys.getenv("PATH"), sep=":"))

Thanks!


回答1:


I fixed this by telling R where "convert" is by using

Sys.setenv(PATH=paste("/opt/local/bin", Sys.getenv("PATH"), sep=":"))


来源:https://stackoverflow.com/questions/39922770/trying-to-make-movie-of-3d-pca-plot-rgl-using-movie3d

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!