问题
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