Exporting a plot as a jpg

R programming language resources Forums Data manipulation Exporting a plot as a jpg

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #973
    Aelius
    Member

    Hi everyone!

    So I’m working in a lab where we analyze periodic waves of light via waveclock and we had a command script that would analyze each column of data, export the analysis values to a table, and make a jpg of the analysis plot.

    #Iterate through a data file
    for(i in 1:dim(data)[2]){
    whatever = waveclock(ts(data[,i], start=0, freq=6),jpg=paste(“plot_num”,i,sep=””))
    if( !is.null( whatever$modes ) )
    {
    output[i,] = unlist( whatever$modes[1,2:8] )
    }
    }
    write.table(output, “wavelet_output.csv”, sep=”,”)

    This code works fine with R 2.7.0, with the older versions of waveclock 1.0.0 and Rwave 1.24-1
    But does not work with their newer counterparts, I feel the issue is in my script I just don’t know what.

    Any help is much appreciated!

    #974
    Aelius
    Member

    Answered my own question.

    jpg is no longer defined in the waveclock function, just needed to change jpg to png

    new code is:

    whatever = waveclock(ts(data[,i], start=0, freq=6),png=paste(“plot_num”,i,sep=””))

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Scroll to top
Privacy Policy