Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
kvalobs:kvoss:system:qc2:8hdk376snf09zj37dk82s92:ncdf [2009-06-20 22:35:59] paule |
kvalobs:kvoss:system:qc2:8hdk376snf09zj37dk82s92:ncdf [2022-05-31 09:29:32] (current) |
||
|---|---|---|---|
| Line 15: | Line 15: | ||
| $ R CMD INSTALL ncdf | $ R CMD INSTALL ncdf | ||
| $ history | $ history | ||
| + | ... | ||
| + | ... | ||
| + | # there are perhaps even easier ways to do this: | ||
| + | |||
| + | $ install.packages(" | ||
| + | |||
| + | # no source was linked ... but the mirror choose automatically opens | ||
| + | # and one just selects a site and the install happens! | ||
| + | ... | ||
| + | $ | ||
| </ | </ | ||
| Line 21: | Line 31: | ||
| < | < | ||
| $ R | $ R | ||
| - | | + | |
| - | > | + | |
| - | > | + | library(ncdf) |
| - | > | + | |
| - | > ff <- lm(y ~ x) | + | |
| - | > z=ff$coefficients[1]*x + ff$coefficients[2] | + | |
| - | > | + | x[x==-1]=0 |
| - | > | + | |
| - | > | + | |
| - | > xx=x[!is.na(x) & x>=0 & x < 100] | + | |
| - | > yy=y[!is.na(x) & x>=0 & x < 100]yyy=yy[!is.na(xx) & xx>=0 & xx < 100] | + | yy=y[!is.na(x) & x>=0 & x < 100] |
| - | > | + | yyy=yy[!is.na(yy) & yy>=0 & yy < 100] |
| - | > | + | xxx=xx[!is.na(yy) & yy>=0 & yy < 100] |
| + | jpeg(filename=paste(Shortname,' | ||
| + | plot(xxx, | ||
| + | XC=cor(xxx, | ||
| + | ff <- lm(xxx ~ yyy) | ||
| + | | ||
| + | | ||
| + | | ||
| + | # | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| </ | </ | ||
| + | |||
| + | Alternatively, | ||
| + | < | ||
| + | $ Rscript plot_netcdf.R "Test Plot" OUTPUT | ||
| + | </ | ||
| + | that will produce the file OUTPUT.jpg with the plot title "Test Plot". | ||
| + | * {{kvalobs: | ||
| + | |||
| + | |||