Displaying 20 results from an estimated 1100 matches similar to: "Extract, sum and Loop in R"
2013 Mar 11
3
New Stack
Hi Experts, I am newbie in R. Could you please share your idea to create a stack with no value or zero value? Nrow=1,Ncol=1, Ncell=1, I aim to work with looping, I want to make a first layer with zero values to add other layers further. Thanks.
Best Regards,
..................Anup KhanalNorwegian Institute of science and Technology (NTNU)Trondheim, NorwayMob:(+47) 45174313
2013 Feb 22
1
Netcdf file in R
Good afternoon,
I am a new in R. I have to work with large climate data.I am not able to read the netcdf file. Can anyone try with this file attached ?
Best Regards,
..................Anup KhanalNorwegian Institute of science and Technology (NTNU)Trondheim, NorwayMob:(+47) 45174313
2013 Apr 26
1
How to export graph value in R
Dear exports,I have created a hypsometric curve (area-elevation curve) for my watershed by using simple command hypsometric(X,main="Hypsometric Curve", xlab="Relative Area above Elevation, (a/A)", ylab="Relative Elevation, (h/H)", col="blue")It plots the hypsometric curve in "RGraphics window", My question is how can I export values which is used
2013 May 01
0
Thornthwaite Method in R
Hi,Has anybody worked with thornthwaite method to calculate the daily evapotranspiration ? I have used the following code to calculate monthly evaporation but what I need is daily evapotranspiration.
Epot <- thornthwaite(Tave, lat, na.rm = FALSE) # Evaluates evapotranspiration for each month.
Do you have any code which works for daily timestep ? Its more technical question, may be some
2013 Apr 05
0
How to see values of hypsographic curve in R
Hi Experts,
Could I ask one question ? I have plotted hypsographic curve for one watershed. I want to see the values of curve as I have to create elevation-volume curve from it. Could you please explain me how to see data that is used in curve ?
Best Regards,..................Anup KhanalNorwegian Institute of science and Technology (NTNU)Trondheim, NorwayMob:(+47) 45174313
2010 May 18
2
Function that is giving me a headache- any help appreciated (automatic read )
note: whole function is below- I am sure I am doing something silly.
when I use it like USGS(input="precipitation") it is choking on the
precip.1 <- subset(DF, precipitation!="NA")
b <- ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum)
DF.precip <- precip.1
DF.precip$precipitation <- b$.data
part, but runs fine outside of the function:
days=7
2010 Jun 06
2
Color scale graphic
Hello
Recently, I've been dealing with a seemingly simple problem. I have a table
with two columns filled with values from a test I made (say, amount of
precipitation and Months measured). Now, instead of plotting a typical
linear graphic with precipitation on the y-axis and the months in the
x-axys, I would like to "convert" the values of precipitation in a color
gradient,
2007 May 24
6
Sum per hour
Dear all,
I have a list of precipitation record and a list of time
I would like to sum them up per hour, or per day.
Does such a function exist ?
example:
time<-c("2000-10-03 14:00:00","2000-10-03 14:10:00","2000-10-03
14:20:00","2000-10-03 15:30:00","2000-10-03 16:40:00","2000-10-03
16:50:00","2000-10-03
2011 Jun 07
1
count length of continues elements in a vector
I am performing a precipitation analysis. data is in the form of daily
precipitation amounts, e.g.
x<- c(4,5,3,0,0,0,2,4,6,4,0,0,0,2,2,0,3,4,1,0,...)
I would like to find the length of the "storm", length of storm would be
defined as the number of days with continues precipitation. in this case the
returned vector would be:
(3,4,2,3,...)
I would also like the amount of
2009 Aug 18
2
value of nth percentile
Dear All,
I have to get the value of say 90th percentile of precipitation time series.. The series is of daily precipitation value of 96 years, I have to to get 90the percentile value of daily precipitation each year. If you know the R code or command for this please let me know.
I would appreciate your early response.
Thanking you,
Sincerely,
Ajay.
2008 Dec 11
2
Principal Component Analysis - Selecting components? + right choice?
Dear R gurus,
I have some climatic data for a region of the world. They are monthly averages
1950 -2000 of precipitation (12 months), minimum temperature (12 months),
maximum temperature (12 months). I have scaled them to 2 km x 2km cells, and
I have around 75,000 cells.
I need to feed them into a statistical model as co-variates, to use them to
predict a response variable.
The climatic
2010 Jan 20
2
Plot frame border to start at zero?
Hello,
I am creating plots of hourly precipitation and accumulated
precipitation (on different axis, see attached image). I was wondering
how can I have the plot frame (black border) start at zero, it looks
like it is plotted less than zero?
The code I use to create the png files is below:
CairoPNG(PNG_file,width=1000, height=600, pointsize=14, bg="white")
opar <-
2010 Oct 19
1
Problems with a specific calculate.
Hello friends of R,
My name is Toni, i'm 25 and I'm working on the Meteorological Investigation team from Balearic Islands.
I had contact to you because I have a problem:
I done a file for every day since 1912 about precipitation. That file has the following structure:
> str(Ast)
Loading required package: sp
Formal class 'SpatialPixelsDataFrame' [package "sp"]
2007 Jun 06
1
spgrass6 and aggregation (bis)
Dear all,
I have some additionale question concerning the spgrass6 package.
* When you set a region in GRASS, does the readGRASS6 function in R only
load data contained in the zoomed region or the whole map ?
* When you have a MASK map in grass, does the readGRASS6 function in R only
load data contained inside the MASK area ?
Could this be the problem ?
Thanks,
Jessica
2012 Mar 07
2
Problems with generalized linear model (glm) coefficients.
Hello to everyone.
I´m writing you because I´m feeling a bit frustrated with my work.
My work consists in finding the relation between the amount of fires and
the weather, so, my response variable is the amount of fires in a fire
season and the explanatory variables are the temperature, the amount of
precipitation and the some others…. my problem is this; I keep getting the
wrong sign in the
2009 Oct 06
1
ggplot2 applying a function based on facet
Look at the bottom of the message for my question
#here is a little function that I wrote
USGS <- function(input="discharge", days=7){
library(chron)
library(gsubfn)
#021973269 is the Waynesboro Gauge on the Savannah River Proper (SRS)
#02102908 is the Flat Creek Gauge (ftbrfcms)
#02133500 is the Drowning Creek (ftbrbmcm)
#02341800 is the Upatoi Creek Near Columbus (ftbn)
#02342500 is
2009 Oct 06
2
ggplot cumsum refined question (?)
OK, so maybe last night was a little too much at one throw, so I have
reduced the data to two stations- one that has precipitation and one
that does not. This is going to be in the context of a larger data
set. I would like to be able to issue a ggplot command and have cum
sum just act on the facets (factors) to apply this.
library(chron)
library(ggplot2)
DF <- structure(list(date_time =
2011 Feb 14
2
how to overlay a map of US on image plot
Dear all,
I have a data set which has latitude, longitude (not in increasing order)
and observed precipitation corresponding to those locations. I am using
image.plot command for that. But I want to overlay a map of US on that plot.
I know we can use map('usa') to draw it, but I dont know how can I overlay
it on the plot of the precipitation data. Can anyone please help me with it?
2013 Apr 18
1
Arranging two different types of ggplot2 plots with axes lined up
Hi all,
I want to arrange two ggplot2 plots on the same page with their x-axes
lined up - even though one is a boxplot and the other is a line plot. Is
there a simple way to do this? I know I could do this using facetting if
they were both the same type of plot (for example, if they were both
boxplots), but I haven't been able to figure it out for two different types
of plots.
Below is my
2008 Sep 04
2
using complete.cases() with nested factors
Hello,
This maybe a newbie question. I have a dataframe that looks like the sample
at the bottom of the email. I have monthly precipitation data from several
sites over several years. For each site, I need to extract years that have
a complete series of 12 monthly precipitation values, while excluding that
year for sites with incomplete data. I can't figure out how to do this
gracefully