Displaying 20 results from an estimated 52 matches for "precip".
Did you mean:
precio
2006 May 18
2
matrix transformation into 3 columns II.
Dear R-users
Sorry for posting the previous message too soon before I have finished it.
I have matrix (mprecip) with headers:
> dim(mprecip)
[1] 6268 170
> mprecip
date GilzeRijen Eindhoven Volkel ZuidLimburg Arcen Ubachsberg
1 01/01/1978 NA 0.0 NA 0.1 NA NA
2 01/02/1978 NA 0.0 NA 0.0 NA NA
3 01/03/1978...
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
input="precip...
2018 Apr 18
0
How to replace numeric value in the column contains Text (Factor)?
The simplest would be to convert precip to character and then back to a factor if you really want it to be a factor. This will also remove the levels that no longer exist.
str(dat)
# 'data.frame': 5 obs. of 3 variables:
# $ Sites : Factor w/ 5 levels "Site1","Site2",..: 1 2 3 4 5
# $ temp : num 14 15 1...
2018 Apr 18
3
How to replace numeric value in the column contains Text (Factor)?
...:5,3]<-"20" but it generated NA>
do you have any suggestions for me?
dat<-structure(list(Sites = structure(1:5, .Label = c("Site1", "Site2",
"Site3", "Site4", "Site5"), class = "factor"), temp = c(14, 15,
12, 12.5, 17), precip = structure(c(3L, 4L, 5L, 2L, 1L), .Label = c("15",
"34", "high", "low", "medium"), class = "factor")), .Names = c("Sites",
"temp", "precip"), class = "data.frame", row.names = c(NA, -5L
))
> dat[...
2011 Feb 17
3
summing 15 minute precip data to daily
Hi all,
i'm sure there is an easy way to do this, but i'm stumped, so any help would
be appreciated.
i have a single column of data for precipitation every 15 minutes over a
year. i want to sum the precip to daily data.
so the first 96 records = the first day, the second 96 records = the second
day, and so on....
is there a way to write a for loop that would sum the data to daily, and
write each value to a second object so i end up with...
2012 Oct 04
3
R combining vectors into a data frame but without a continuous common variable
Hello,
I have two different files which I'd like to combine to make one data frame
but I've no idea how to do it! The first file has two columns; one is the
date, the following is a binary code for debris flow events. Then my other
file has also two columns; the date and then precipitation data.
The thing is, is that the two date columns don't all contain the same dates.
The binary one is every day from April - October from 1900 - 2005, yet the
precipitation file has dates from from say, 1911 to 2004, with some missing
data on certain months and during certain years.
So...
2005 Nov 15
1
combination xyplot and barchart?
Dear R community,
I am having trouble determining how to create the graph I want
utilizing my relatively limited knowledge of R. So far I have been
using the lattice library to create most of what I need.
The dataset (enviro) consists of 2 variables (Temp and Precip) for each
Day of a 2-yr period (Year). I wish to display Temp and Precip along
the y axis plotted by Day on the x axis to allow comparison (one year's
data in each of 2 panels stacked on top of each other) between the
years. Essentially what I want it to look like is an xyplot (Temp ~ Day...
2006 Jan 16
1
label of second y-axis in xyplot (lattice)
Dear group,
First I provide you with an example, I found in the newsgroup. Then I'd like to explain my problem to you by means of the output.
enviro <-
data.frame(Year = rep(2001:2002, each = 365),
Day = rep(1:365, 2),
Precip = pmax(0, rnorm(365 * 2)),
Temp = 2 + 0.2 * rnorm(365 * 2))
xyplot(Precip + Temp ~ Day | Year, data=enviro,
layout = c(1, 2),
panel = panel.superpose.2,
type = c('h', 'l'))
Now my question.
How can I achieve different labels for two y-...
2010 Apr 15
1
Alignment of x-axis labels
Dear all,
I'm having trouble getting the correct spacing between x-axis labels on a barplot. This is the command I'm using to generate the plot:
temp <- barplot(precip, beside=TRUE, xaxt="n", las=1, xpd=FALSE, col="grey28", ylim=c(0, max(precip)))
Here is the structure of temp:
> str(temp)
?num [1:96, 1] 0.7 1.9 3.1 4.3 5.5 6.7 7.9 9.1 10.3 11.5 ...
And here is the structure of the data being plotted:
> str(precip)
?num [1:96] 1841 287...
2024 Nov 06
1
Using multiple dat files
...tor, i.e. W[[1]]$year, etc.. You can also use data frame
indices for the columns, i.e. W[[1]][ ,1] or W[[1]][ ,"year"] . All of
which I believe you know.
However, I will hazard a *guess* (so exercise due diligence and check) as
to the cause of your original error,
"dd(data = W[[1]]$Precip, time.scale = W[[1]]$year)
Fehler in W[[1]]$year : $ operator is invalid for atomic vectors'
even though I know **nothing** about the dd() function. My guess is:
"data" is usually an argument to a function that tells it to use
"nonstandard evaluation" to look for arguments...
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"] with 7 slots
..@ data :'data.frame': 499105 obs. of 2 variables:
.. ..$ PRECIP.pred: num [1:499105] 0.000536 0.000536...
2009 Jul 12
1
variance explained by each predictor in GAM
Hi,
I am using mgcv:gam and have developed a model with 5 smoothed predictors
and one factor.
gam1 <- gam(log.sp~ s(Spr.precip,bs="ts") + s(Win.precip,bs="ts") + s(
Spr.Tmin,bs="ts") + s(P.sum.Tmin,bs="ts") + s( Win.Tmax,bs="ts")
+factor(site),data=dat3)
The total deviance explained = 70.4%.
I would like to extract the variance explained by each predictor. Is there
a...
2013 Apr 18
1
Arranging two different types of ggplot2 plots with axes lined up
...mple 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 test case:
library(ggplot2)
library(gridExtra)
#generate test precipitation data
year<-c(2000,2001,2002,2003,2004)
precip<-c(46,100,80,74,20)
yp<-data.frame(year, precip)
#generate test fecal coliform data
year2<-c(2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,
2001,2001,2001,2001,2001,2001,2001,2001,2001,2001,
2002,2002,2002,2002,2002,2002,2002,200...
2011 Dec 09
3
ggplot with geom_tile
Dear R-users,
I am trying to make a plot with ggplot-geom_tile(), but cannot remove some unwanted (white) lines through my plot.
Below a reproducible example:
#####
library(ggplot2)
tot=as.data.frame(rep(seq(-50,50,5),each=21))
names(tot)="precip"
temp=rep(seq(-5,5,0.5),21)
tot$temp=temp
disc=array(dim=c(21,21))
for(i in 1:21){
for(y in 1:21){
temp<- rev(seq(10000+((i-1)*500),12000+((i-1)*500),100))
disc[i,y]=temp[y]
}}
disc1=t(disc)
bla=as.vector(disc1)
tot$dis=bla
cols=c("darkred"," white",&quo...
2011 Mar 13
4
readMat - how to retrieve the variables
Hello
I have a matlab MAT file that contains one single variable: a. The
structure of a is as follows:
a.river1.flow (flow values)
a.river1.date_flow (date)
a.river1.precip (precipitation values)
a.river1.date_precip
a.river2.flow
a.river2.date_flow
a.river2.precip
a.river2.date_precip
I have used readMat to load the variable a in R, however I have no idea how
readMat translates a. I managed to get some values out of
data=readMat("matfile.mat")
data$a[,,1...
2003 Oct 15
0
qqnorm(*, datax=TRUE, xlab,ylab) -- S+ compatibility problem
Just found because an old (written for S+) function of mine did
label plots wrongly with R.
Example --- inspired from example(qqnorm) ---
data(precip)
qqnorm(precip, ylab = "Precipitation [in/yr] ...")
qqnorm(precip, ylab = "Precipitation [in/yr] ...", datax = TRUE)
this is all "fine" -- `datax' is a switch that just switches the
axes but keeps the meaning of "ylab labels the data axis"
(i.e, when...
2005 Nov 07
2
how to export density_function output?
Dear all,
quite a naive question: I have a data frame and I computed "the kernel
density estimate" with density on each column.
Now I'd like to export in a txt file the density function output for each
column, but, when if I use write.table, I get a message "Error in
as.data.frame.default(x[[i]], optional = TRUE) : can't coerce class
"density" into a
2009 Jul 27
1
Creating new data frame using loop
...ith using a "for" loop to read and separate a large dataset. The response I got worked great, but now I have another problem with using my loop.
Basically I have a number of different files containing columned data. There are 132 datasets, named such that I have something in the form...
precip_colxxx.txt
...where xxx is a number ranging from 1 to 132. What I want to do is read in every 13th table and extract the third column, and then place this in a new dataset. The new dataset will thus compose of 11 columns of data. I have written the following bit of script to read in every 13th tab...
2010 Sep 15
1
Difficulty creating Julian day in data frame
...,
I'm attempting to add a "Julian Day" column to a data frame.
Here is my code and the resulting data frame:
vic.data <- read.table("C:/VIC/data/vic.data.csv", header=F)
names(vic.data) <- c("year", "month", "day", "precip", "evap",
"runoff", "baseflow", "Tsup", "SM1", "SM2", "SM3", "SWE")
vic.data$temp.date <- as.Date(paste(vic.data$year, "/",
vic.data$month, "/", vic.data$day, sep=""))...
2007 Sep 10
1
overlay lattice histograms with goodness-of-fit pdfs
Hello,
I am new to R exploratory data analysis and plotting. Is anyone aware of a way
to overlay a set of conditional histograms with conditional PDFs? Below, I
generate a lattice plot of precipitation histograms based on different months
and stations, given a subset of the dataset:
histogram(~ data | month * station,
data = sta.stack[sta.stack[,"type"]=="precip" & (sta.stack[,"month"]=="Dec" |
sta.stack[,"month"]=="Jan" |...