Displaying 20 results from an estimated 3000 matches similar to: "Woring message in as.yearmon()"
2013 May 15
1
x and y lengths differ
I have a problem with R. I try to compute the confidence interval for my
df. When I want to create the plot I have this problem: Error in
xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ.
I try this code:
library(dplR)
df.rwi <- detrend(rwl = df, method = "Spline",nyrs=NULL)
write.table(df.rwi,file="rwi.txt",quote=FALSE,row.names=TRUE)
2009 Sep 13
3
How to get last day of a month?
Is there any R function to calculate automatically the last day of a
particular month? For example "sep2009" should be converted to last day of
September of 2009?
Thanks
--
View this message in context: http://www.nabble.com/How-to-get-last-day-of-a-month--tp25425645p25425645.html
Sent from the R help mailing list archive at Nabble.com.
2008 Mar 03
1
Formating a zoo dataset .
Suppose I have following dataset :
> head(data1)
Date Return
1 03/31/00 0.14230650
2 04/28/00 -0.03276228
3 05/31/00 -0.06527890
4 06/30/00 -0.04999873
5 07/31/00 -0.01447902
6 08/31/00 0.22265729
Now I convert it to zoo object :
> data11 = zoo(data1[,2], as.Date(data1[,1], format="%m/%d/%y"))
> head(data11)
2000-03-31 2000-04-28 2000-05-31
2009 Dec 01
1
Problem in reading data
In my Excel file, I have data in following format :
Feb-07 38.49
Mar-07 39.95
Apr-07 37.47
May-07 35.77
Jun-07 32.96
Jul-07 33.27
I tried to copy this data as a time series using following code :
library(zoo)
dat <- read.zoo(file="clipboard", format="%m-%y")
However getting following error :
Error in read.zoo(file = "clipboard", format = "%m-%y") :
2010 Mar 09
3
sorting data whilst ignoring NA's
Hello,
I am very new to R and have hit my first main problem that I hope someone
can easily resolve.
I have some data that looks like this (there are 20,000 rows):
> qdata
day month year flow
[1,] 2 10 1945 NA
[2,] 3 10 1945 NA
[3,] 4 10 1945 NA
[4,] 5 10 1945 NA
[5,] 6 10 1945 2.973
[6,] 7 10 1945 NA
2010 Apr 18
4
confused with yearmon, xts and maybe zoo
R-listers,
I am using xts with a yearmon index, but am getting some inconsistent
results with the date index when i drop observations (for example by using
na.omit).
The issue is illustrated in the example below. If I start with a monthly
zooreg series starting in 2009, yearmon converts this to "Dec-2008". Not
such a worry for my example, but strange. Having converted to xts, i drop
2011 Jan 19
1
Using subset to filter data table
I am having difficulty understanding how I would constrain a data set by
filtering out 'records' based on certain criteria.
Using SQL I could query using 'select * from my.data where LithClass in
('sand', 'clay')' or some such.
Using subset, there seem to be ghosts left behind (that is, all of the
LithClass *.Labels* remain after subset)
> dput(tcc)
2010 Mar 18
1
probable timezone confusion with as.yearmon
It looks like a timezone issue, and it's causing confusion to me at least.
My original data:
gmt <-
c("19880101 0000", "19880101 0100", "19880101 0300", "19880101 0400",
"19880101 0500", "19880101 0600")
These were converted to local dates/times with
akst<-strptime(gmt,format="%Y%m%d %H%M")-(3600*9) # because I want
2009 Nov 09
1
zoo: bug with unique for yearmon
I'm using R 2.10.0, with zoo 1.5-8. The release notes for zoo 1.5-8
claim a bug with unique for yearmon objects has been fixed, but I'm
still having problems.
Browse[1]> tmp2
[1] "Dec 1996" "Dec 1996"
Browse[1]> unique(tmp2)
[1] "Dec 1996" "Dec 1996"
Browse[1]> unique(unique(tmp2))
[1] "Dec 1996"
Browse[1]> as.numeric(tmp2) -
2012 May 04
1
zoo package; a question on as.yearmon and as.yearqtr
Hello,
In zoo package, if I would like the time frame to be 1981M01 to 1982M12,
then I code
time_0<-as.yearmon("1981-01")+(0:23)/12
However, if the time frame of interest becomes 1981M01 to 2011M12, it is
relatively hard to calculate the number of months. Is there any faster way
to do it? Thanks,
miao
[[alternative HTML version deleted]]
2011 Oct 22
3
problem with as.Date
Dear all,
I would like to convert the first column of a dataframe to a date (original
format: year (4 digits) and month (last 2 digits))
>str(dat_FF)
'data.frame': 1022 obs. of 4 variables:
$ date : int 192607 192608 192609 192610 192611 192612 192701 192702
192703 192704 ...
$ Rm.Rf: num 2.69 2.52 0 -3.06 2.42 2.66 0 4.29 0.51 0.57 ...
$ SMB : num -2.49 -1.25 -1.38 -0.2 -0.34
2010 Dec 30
2
optim and singularity
Hello,
I was unable to find clues to my problem in ?optim. Using the data and code
below, I get an error ("system is exactly singular") when a particular line
of code is left in, but have found that 'optim' works when I comment it out.
The line of code in question is after the closeAllConnections() line of code
and contains a call to "na.approx" from the zoo package.
2012 Feb 21
1
Questions on Data reading using zoo package
Hello,
I try to handle the data using read.csv , zoo and aggregate functions.
The data contains NA values. After aggregating monthly data into quarterly
data, all data become NA. Is it because I don't properly aggregate the data
in the presence of NAs? What can I do?
Another problem is that the date in month is presented in Chinese (My OS
is in Chinese.) How can I set the default
2010 Feb 17
2
extract the data that match
Hi r-users,
I would like to extract the data that match. Attached is my data:
I'm interested in matchind the value in column 'intg' with value in column 'rand_no'
> cbind(z=z,intg=dd,rand_no = rr)
z intg rand_no
[1,] 0.00 0.000 0.001
[2,] 0.01 0.000 0.002
[3,] 0.02 0.000 0.002
[4,] 0.03 0.000 0.003
[5,] 0.04 0.000 0.003
[6,]
2009 Apr 24
1
function returns R object with name based on input
I wanted to ask how I can make a for loop or a function return an R
object with a unique name based on either some XX of the for loop or
some input for the function.
For example
if I have a function:
fn<-function(data,year){
which does does some stuff
}
How do I return an object from the function called X.year, such that if
I run fn(data,1989), the output is an object called X.1989?
In
2012 Apr 02
6
[LLVMdev] pb05 results for current llvm/dragonegg
Attached are the Polyhedron 2005 benchmark results for current llvm/dragonegg svn
on x86_64-apple-darwin11 built against Xcode 4.3.2 and FSF gcc 4.6.3. The benchmarks
for -msse3 and -msse4 appear identical (at least for degg+optnz). This is fortunate
since there seems to be a bug in -msse4 on 2.33 GHz (T7600) Intel Core 2 Duo Merom
(http://llvm.org/bugs/show_bug.cgi?id=12434).
2012 Apr 03
0
[LLVMdev] pb05 results for current llvm/dragonegg
Hi Jack,
> Attached are the Polyhedron 2005 benchmark results for current llvm/dragonegg svn
> on x86_64-apple-darwin11 built against Xcode 4.3.2 and FSF gcc 4.6.3.
thanks for the numbers. How does this compare to LLVM 3.0 - were there any
regressions?
Ciao, Duncan.
The benchmarks
> for -msse3 and -msse4 appear identical (at least for degg+optnz). This is fortunate
> since
2008 Nov 04
1
perform Kruskal-Wallis test without using the built-in command in R
Hi,
again i am stuck in my presentation, and i have never learn R before in my
life but need this to be done, so please help me out for a favour:
http://www.nabble.com/file/p20333155/kew.dat kew.dat
run this in R and these comes up:
Month Year Rain
1 Jan 1900 74.400000
2 Feb 1900 80.500000
3 Mar 1900 23.600000
4 Apr 1900 23.600000
5 May 1900 25.100000
6
2008 Oct 11
5
Extracting subset of a vector
I have 2 vecros :
x<-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88)
x1 = sample(x, 5, replace=FALSE)
Now i want to get remaining values of vector "x" those are not member of vector "x1". Can anyone please tell me how to do that?
2012 Jul 30
2
distance matrix and hclustering
Dear R Users,i am very new to R. I want your help on an issue regarding distance matrix and cluster analysis
i had discharge data of 4 rivers(a,b,c,d) in 4 vectors each having 364 values
> dput(qmu)structure(list(a = c(0.26, 0.25, 0.25, 0.25, 0.24, 0.23, 0.22, 0.21, 0.21, 0.21, 0.2, 0.19, 0.19, 0.19, 0.19, 0.18, 0.18, 0.18, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17,