Re: [R] doubt in climate variability analysis in R! - code

2010-10-31 Thread steven mosher
Ok I downloaded it and showed you how to get your data out. How to read it
into a raster brick,
how to plot the data, how to get the mean rainfall of every day.lots more
you can do.

there is a  bad bit of data in the last time step.

check my blog.

In the future what you should do is write code to emulate your problem. for
example, in your problem you had created a ncdf file with a 3D matrix of
65,69,2192.
You should just do a subset of that, show the code to create a ncdf with
random numbers in it.

creating working code that emulates your problem is key if you want help.

Off list for the rest.

On Sun, Oct 31, 2010 at 10:21 AM,  wrote:

>
>
> I am sorry, i think the link was broken..! here is the correct one!!!
>
> http://www.4shared.com/file/4zV0g3JR/RF_80-85.html
>
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] doubt in climate variability analysis in R! - code

2010-10-31 Thread govindas


I am sorry, i think the link was broken..! here is the correct one!!!

http://www.4shared.com/file/4zV0g3JR/RF_80-85.html  


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] doubt in climate variability analysis in R! - code included!

2010-10-30 Thread govindas


--- Begin Message ---

   I am sorry, i think the link was broken..! here is the correct one!!![1]
   http://www.4shared.com/file/4zV0g3JR/RF_80-85.htmlÂ

   --
   Regards,
   Mahalakshmi
   Graduate Student
   #20, Department of Geography
   Michigan State University
   East Lansing, MI 48824
   Quoting "Nordlund, Dan (DSHS/RDA)" :
   >> -Original Message-
   >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
   >> project.org] On Behalf Of govin...@msu.edu
   >> Sent: Friday, October 29, 2010 11:56 AM
   >> To: r-help@r-project.org
   >> Subject: Re: [R] doubt in climate variability analysis in R! - code
   >> included!
   >>
   >>
   >>
   >> the following code was used 
   >>
   >> library(akima)
   >> library(clim.pact)
   >> nc.1 <- "RF_80-05.nc"
   >> nc.rf.in <- open.ncdf(nc.1)
   >>
   >> x1 <- retrieve.nc(nc.1, v.nam="Rainfall",l.scale=FALSE,  x.rng=c(70,
   >> 80), y.rng=c(10, 13.5))
   >>
   >> #dimension is checked for the subset. (lon, lat, time) is changed as
   >> (time, lat, lon)
   >> >dim(x1$dat)
   >> #[1] 2192Â Â Â  8Â Â  20
   >>
   >> My question is - how can i convert this array into a dataframe so that
   >> i have "lat", "lon", "precipitation values" in 3 different columns
   >> (note, I will have it for just a single day). So, my expected dataframe
   >> will have rainfall values for each given pair of "lon" and "lat".
   >>
   >> Or is there any other better way to do my spatial variogram analysis
   >> for a single day given the above dataset?
   >>
   >> here is the link for the dataset.
   >> [2]HTTP://WWW.4SHARED.COM/FILE/4ZV0G3JR/RF_80-85.HTML
   >>
   >
   > The link to the data did not work, so we still don't have a
   > self-contained, reproducible example.
   >
   > Dan
   >
   > Daniel J. Nordlund
   > Washington State Department of Social and Health Services
   > Planning, Performance, and Accountability
   > Research and Data Analysis Division
   > Olympia, WA 98504-5204
   >
   >
   >

References

   1. http://www.4shared.com/file/4zV0g3JR/RF_80-85.html
   2. http://WWW.4SHARED.COM/FILE/4ZV0G3JR/RF_80-85.HTML
--- End Message ---
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] doubt in climate variability analysis in R! - code included!

2010-10-30 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of govin...@msu.edu
> Sent: Friday, October 29, 2010 11:56 AM
> To: r-help@r-project.org
> Subject: Re: [R] doubt in climate variability analysis in R! - code
> included!
> 
> 
> 
> the following code was used 
> 
> library(akima)
> library(clim.pact)
> nc.1 <- "RF_80-05.nc"
> nc.rf.in <- open.ncdf(nc.1)
> 
> x1 <- retrieve.nc(nc.1, v.nam="Rainfall",l.scale=FALSE,  x.rng=c(70,
> 80), y.rng=c(10, 13.5))
> 
> #dimension is checked for the subset. (lon, lat, time) is changed as
> (time, lat, lon)
> >dim(x1$dat)
> #[1] 2192    8   20
> 
> My question is - how can i convert this array into a dataframe so that
> i have "lat", "lon", "precipitation values" in 3 different columns
> (note, I will have it for just a single day). So, my expected dataframe
> will have rainfall values for each given pair of "lon" and "lat".
> 
> Or is there any other better way to do my spatial variogram analysis
> for a single day given the above dataset?
> 
> here is the link for the dataset.
> HTTP://WWW.4SHARED.COM/FILE/4ZV0G3JR/RF_80-85.HTML
> 

The link to the data did not work, so we still don't have a self-contained, 
reproducible example.

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] doubt in climate variability analysis in R! - code included!

2010-10-29 Thread govindas


the following code was used  

library(akima)
library(clim.pact)
nc.1 <- "RF_80-05.nc"
nc.rf.in <- open.ncdf(nc.1)

x1 <- retrieve.nc(nc.1, v.nam="Rainfall",l.scale=FALSE,  x.rng=c(70, 80), 
y.rng=c(10, 13.5))

#dimension is checked for the subset. (lon, lat, time) is changed as (time, 
lat, lon)
>dim(x1$dat)
#[1] 2192    8   20

My question is - how can i convert this array into a dataframe so that i have 
"lat", "lon", "precipitation values" in 3 different columns (note, I will have 
it for just a single day). So, my expected dataframe will have rainfall values 
for each given pair of "lon" and "lat". 

Or is there any other better way to do my spatial variogram analysis for a 
single day given the above dataset?

here is the link for the dataset.
HTTP://WWW.4SHARED.COM/FILE/4ZV0G3JR/RF_80-85.HTML

-- 
Regards,
Mahalakshmi
Graduate Student
#20, Department of Geography
Michigan State University
East Lansing, MI 48824 Quoting govin...@msu.edu:

>
>
> Hello all,
>
> I  am trying to use "clim.pact" package for my work, but since this 
> is  the  beginning for me to use gridded datasets in "R", I am having 
> some   trouble.
>
> I want to do seasonal analyses like   trends, anomalies, variograms, 
> EOF and probably kriging too to   downscale my 1 degree gridded data 
> to 0.5.  So, as a first step, I   compiled my entire dataset (with 25 
> yeears of daily dataset which were   present as 25 files) into a 
> single netcdf file.
>
> Then, I downloaded clim.pact to do further analysis, which works but  
> seems  to change dataset's original dimensions' order for  
> "retrieve.nc"   function (i.e. original lon, lat, time order was 
> changed  to time,  lat,  lon after using this function to get a 
> subset). I am not  sure as  to why  this happened and not able to get 
> any plots such as box  plot  (showing  trend in "lon", "lat", 
> "time"), variogram (or variance),   correlation  analysis done 
> because of this conversion problem.
>
> Further, basic "R"  functions seem to work well with objects such as  
>  dataframe, matrix ..etc  with time in a separate column, and the 
> data   values (precipitation, or  temperature) in a separate coulmn 
> with   corresponding station values  (lon/lat). So, now I have very 
> little idea   about what I have to do. Can anyone suggest me a better 
> (probably  more refined way) way than what I am currently doing to 
> analyze these  data?
>
>  
>
> --
> Regards,
> Mahalakshmi
> Graduate Student
> #20, Department of Geography
> Michigan State University
> East Lansing, MI 48824
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.