arielle
arielle

Reputation: 945

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

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!

Upvotes: 2

Views: 1644

Answers (1)

arielle
arielle

Reputation: 945

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

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

Upvotes: 2

Related Questions