Displaying 20 results from an estimated 700 matches similar to: "Using lag"
2008 Jul 24
4
Just 2 more questions - for now!
Hi all,
Thanks for the help with my previous post.
I have just two more questions for the minute.
I think I said in a previous post that I like to use the terminal,
i.e. run rterm.exe. On exiting the terminal, I am asked if I want to
save the workspace. If I hit y (yes), the workspace is just saved as
.rdata in my working directory, does anyone know how I can name it
directly from the
2008 Jul 23
6
Using if, else statements
Hi all,
Again I have searched the net and so on, without finding an answer to this
surely simple problem. A short bit of code would be appreciated.
I have a object named `data' with the following column headings.
Date, maxitemp, minitemp, admissions, d.o.w.
Where d.o.w. is day of the week, written "Sun" "Mon" etc.
I just need to scale the Monday admissions by
2012 Feb 10
1
Need to aggregate large dataset by week...
Hi all,
I have a large dataset with ~8600 observations that I want to compress to
weekly means. There are 9 variables (columns), and I have already added a
"week" column with 51 weeks. I have been looking at the functions:
aggregate, tapply, apply, etc. and I am just not savvy enough with R to
figure this out on my own, though I'm sure it's fairly easy. I also have the
Dates
2008 Jul 21
1
Subsetting data by date
Hi all,
Firstly I appologise if this question has been answered previously,
however searching of the archives and the internet generally has not
yielded any results.
I am looking in to the effects of summer weather conditions
(temperature, humidity etc), on the incidences of a breathing disorder
brought on through smoking (COPD). I am fairly new to R and completely
new to the idea of
2008 Aug 21
4
Very confused with class
Hi all,
I am very confused with class.
I am looking at some weather data which I want to use as explanatory
variables in an lm. R has treated these variables as factors (i.e. with
different levels), whereas I want them treated as discretely measured
continuous variables. So I need to reassign the class of these
variables, right?
Indeed, doing
class(southwest$pressure)
(pressure being air
2011 Sep 05
3
function censReg in panel data setting
Hello all,
I have a problem estimating Random Effects model using censReg function.
small part of code:
UpC <- censReg(Power ~ Windspeed, left = -Inf, right =
2000,data=PData_In,method="BHHH",nGHQ = 4)
Error in maxNRCompute(fn = logLikAttr, fnOrig = fn, gradOrig = grad,
hessOrig = hess, :
NA in the initial gradient
...then I tried to set starting values myself and here is
2011 Oct 04
2
About stepwise regression problem
First of all, I have GAMs
noxd<-gam(newNOX~pressure+maxtemp+s(avetemp,bs="cr")+s(mintemp,bs="cr")+s(RH,bs="cr")+s(solar,bs="cr")+s(windspeed,bs="cr")+s(transport,bs="cr"),family=gaussian
(link=log),groupD,methods=REML)
Then I type " summary(noxd)". and show
Family: gaussian
Link function: log
Formula:
newNO2 ~ pressure
2008 Jul 23
0
Fw: Using if, else statements
Sorry in the previos replay I forgot monday' scale
so weight should be:
weight <- c(0.91,1,1,1,1,1.21,1.22)
names(weight) <- c("mon","tue","wed","thu","fri","sat","sun")
----- Original Message -----
From: "Gabriela Cendoya" <gcendoya at balcarce.inta.gov.ar>
To: "Robin Williams" <>
2008 Jul 24
4
Is there an equivalent * operator?
Hi all,
Is there an equivalent to the general * operator in R, where * can
represent any character?
I have a dataset, one column being date, date ranging between
April-September, 97-06. I would like to be able to acquire the data for
a specific month, say September, so that I can take average temperatures
for the month, etc. I thought I would be able to do something like
data.s1 <-
2013 Mar 26
2
Plot cumulative sums of rainfall per year
Hi @all,
I am biting my nails with the following problem:
I have a data set of daily rainfall measurements for the last 20 years. What I want to do is calculate the daily cumulative sum of rainfall but only for every year which means that the cumulative sum has to be reset each year. After the calculations I want to plot each year of cumulative rainfall as a separate line in one graph preferably
2012 Nov 29
4
splitting a string by space except when contained within quotes
I've been trying to split a space delimited string with double-quotes in R
for some time but without success. An example of a string is as follows:
/rainfall snowfall "Channel storage" "Rivulet storage"/
It's important for us because these are column headings that must match the
subsequent data.
Here is some code I've been trying:
str <- 'rainfall
2008 Sep 08
3
Saving functions
Hi,
Appologies for the simple nature of this question, I am unable to find
the answer in manuals (EG and introduciton to R).
I have written a function in a text editor and saved it with an .R
extension. It is saved in my working directory. How can I run it, do I
need to use source? If so, how do I supply the arguments to the
function? Or does it need to be saved in a particular directory?
2008 Jul 22
4
Opening files from R terminal - appologies
Dear all,
I appologise for cluttering up the list with such a basic question,
however I have been unable to find the answer I want (possibly through
my poor usage of the R help system).
As I am visually impaired and using assistive technology, I think I
would prefer to use R from the terminal mode, i.e. by running rterm.exe
found in the bin directory.
I have managed to set my working
2012 Apr 14
2
master thesis
Hi,
For my master thesis I have 24 micro-plots on which I did measurements during 3 months.
The measurements were:
- Rainfall and runoff events throughout 3monts (runoff being dependant on the rainfall, a coefficient (%) has been made per rainfall event and per 3 months)
- Soil texture (3 different textures were differentiated)
- Slope (3 classes of slopes)
- Stoniness (one time measurement)
2012 Jul 04
3
Please help
Dear All,
I am a research student in environment. I have only little programming knowledge. I am currently doing the last project about rainfall impact on ground water quality in an area. It happens that I have to use R to read rainfall data (3 dimension) from ASC file (*.asc), and then write them into one NCDF file (*.nc).
I have been working very hard on study R, but I
2017 Nov 22
2
How to produce rainfall maps
Fwiw the engine behind geom_raster needs explicit observation-per-row form
for input (with no structural normalization), so conversion to points is
perfectly proper here, albeit confusing in context. (It's closer to what
graphics devices actually use ultimately, but the expansion is laid out
very early in ggplot2 because there's no standard for intermediate forms.)
Cheers, Mike
On Wed,
2012 Aug 01
1
finding correlation for lagged values
Hi
I've to find the correlation of a variable and lag of other variable.
My code currently looks like this
y= 32 1 45 26 33 55 15 24 31 78
x=51 69 96 67 71 89 61 42 78 24
lagTimes=2
i want to find the correlation between y and Lag(x,1) and Y &Lag(x,2)
i'm using loop to find the lag and then finding correlation
If there are more variables and need to find the correlation lag
2007 Jul 25
1
how to use "replace" for efficiency
Hi
I think I have been struggling to use replace correctly, I usually
work my way around this using a loop, but I think this is in fact
inefficient.
I have a dataset with runoff from three plots and associated rainfall.
However either the datarecording was sloppy, or the rainfall very
patchy. So I am trying to remove data from my dataset for which the
runoff is larger than the rainfall on the
2005 Mar 11
2
Calculating lengths of runs of 0 or 1 sequences in meteorological data
Dear List Members,
I need some help about programming in S language. My
problem is as follows:
I have meteorological data (about rainfall measurement
each day from 1989-2002), say like
http://www.angelfire.com/ab5/get5/data.rainfall.txt
or http://www.angelfire.com/ab5/get5/R.rainfall.txt
in a sequence of 0(denoting dry day)'s and 1(denoting
wet day)'s. I want to construct a frequency
2008 Aug 28
1
Renaming objects
Hi,
Is there any quick and easy way to rename a number of objects, without
having to rename each one individually and then remove the old one? And
if so, is there anything I can do to adjust the associated comments
accordingly?
Thanks for any help,
Robin Williams
Met Office summer intern - Health Forecasting
robin.williams@metoffice.gov.uk
[[alternative HTML version deleted]]