[R] Singular Spectrum Analysis Plotting Skipping in a loop, but individually it works
കുഞ്ഞായി kunjaai
dileepkunjaai at gmail.com
Mon Sep 28 21:11:07 CEST 2015
Dear Anton & Michael,
Thanks a lot for your nice suggestion,
Now its working....
cheers :)
On Mon, Sep 28, 2015 at 1:24 PM, Michael Dewey <lists at dewey.myzen.co.uk>
wrote:
> Dear Dileep
>
> What happens if you explicitly print it by wrapping the plot command in
> print( )
>
>
> On 28/09/2015 07:01, കുഞ്ഞായി kunjaai wrote:
>
>> Dear all,
>>
>> I am trying to plot Spectrum of Singular Values using "Rssa" package.
>>
>> I am trying to plot singular spectrum plot inside a loop, it is not
>> plotting, but when I am trying to plot individually in terminal it works,
>> and I can save this as png files.
>>
>> My code is given below:
>>
>> *# --------------Calculating and plotting Spectrum of Singular Values of
>> Control---------#*
>> library(ncdf)
>> library(Rssa)
>> season_list <-c('YEAR', 'DJF', 'JJA', 'SON', 'MAM')
>> zone_list <-c('ALLIN', 'WCIND', 'IPIND', 'ECIND', 'NEIND', 'NCIND',
>> 'NWIND', 'WHIND')
>>
>> for (sns in 1:length(season_list)){
>> for (rgn in 1:length(zone_list)){
>> var_noise<-paste(zone_list[rgn], "_", season_list[sns], sep = "")
>> noise1<-get.var.ncdf(f_noise1, var_noise)
>> noise2<-get.var.ncdf(f_noise2, var_noise)
>> # Calculating Covariance Matrix from 'noise1' matrix
>> cv_noise_1 = noise1%*%t(noise1)
>> sigular_spectrum = ssa(cv_noise_1, svd.method = c("eigen"))
>>
>> out_ssa_png =
>>
>> paste("/home/dileep/WORK/Research_wind/CMIP_PiCOntrol_Expiriments/Homogenious_zone/homogenious_tempreture_zone/Homogenous_temp_Codes/Optimal_fingerprint_code/R/ECOF-package/SSA_noise_plots/SSA_",
>> zone_list[rgn], "_", season_list[sns], "_SET_1.png", sep = "")
>>
>> png(out_ssa_png, width= 6, height = 7.0, units = "in", res= 1200,
>> pointsize = 3)
>> print ("Created PNG file")
>> titl = paste(zone_list[rgn], season_list[sns], sep = " ")
>> plot(sigular_spectrum , main=titl)
>> dev.off()
>> print ("Done !")
>> }
>> }
>>
>> *#####----------------------------------------------------------------------------------------###*
>>
>> Thank you in advance
>>
>>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html
>
--
DILEEPKUMAR. R
J R F, IIT DELHI
[[alternative HTML version deleted]]
More information about the R-help
mailing list