similar to: Convert to as.Date

Displaying 20 results from an estimated 1000 matches similar to: "Convert to as.Date"

2009 Mar 25
2
Plot inside For loop
Hi I am plotting a set of data inside a for loop. Is it possible to use plot in for loop without redrawing the whole plot? Am using par(new=TRUE) but that draws on top of the previous plot. Couldn't find any threads about the topic. Thanks Mohan --
2008 Dec 18
3
Parsing unusual date format
Hello, If I have a character string like d <- c("1990m3", "1992m8") #March 1990 and Aug 1992 what is the easiest way to convert it into any standard date form; for example, d <- c("01/03/1990", "01/08/1992") I looked at as.Date but it doesn't seem to address my problem as I have an "m" stuck in the middle of my character string
2009 Feb 25
1
How to get JRI to work from my NetBeans
Hi, I need your help. I have downloaded a precompiled JRI as part of rJava. I have included rJava as part of my R package libraries. Now I need to be able to work with some R functions from my Java apps. I'm using NetBeans on Windows. I have followed some instructions from http://www.rforge.net/JRI/ but i keep on getting errors when compiling my Java app as follows: run: Cannot find JRI
2009 Jan 05
3
if statement
Hi, How do I check for two conditions in an if loop? I want to check if a value lies between 2 other values. For example, A <- ts(rnorm(120), freq=12, start=c(1992,8)) X <- 0.5 Y <- 0.8 I would like to create a new vector C for which C[i] is 0 if A[i] lies in between X and Y. Would be grateful for any help. Sorry for asking such an R-newbie question! Shruthi -- View this message
2009 Apr 02
4
Deleting rows based on identity variable
I have created this data frame to help illustrate my problem. id<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5)) x<-rep((seq(1:5)),5) y<-c(0, 0.1, 0.5, 0.4, 0.2, 0, 0.1, 0.5, 0.4, 0.12, 0, 0.1, 0.5, 0.55, 0.2, 0, 0.1, 0.5, 0.3, 0.2, 0, 0.1, 0.6, 0.4, 0.1) d1<-cbind(id,x,y) I would like to delete all rows where id=4, however, when I tried the command  d2=d1[-c(id==4),] and looked
2009 Feb 25
2
reshape from wide to long
Hi,I would like to reshape the following "wide" data set to "long" form. I would appreciate help with the correct code for "reshape". I tried a few unsuccessfully. Thanks. Chetty __________________________________________________ dat.1 Grp X0 X3 X6 X12 X25 X501 C 0.5326517 0.6930942 0.9403883 1.157571
2009 Jan 20
2
Confidence intervals in ccf()
Hi, I have been running the ccf() function to find cross-correlations of time series across various lags. When I give the option of plot=TRUE, I get a plot that gives me 95% confidence interval cut-offs (based on sample covariances) for my cross-correlations at each lag. This gives me a sense of whether my cross-correlations are statistically significant or not. However, I am unable to get R to
2009 Feb 03
1
Using getSymbols
Hi, How can one ask getSymbols to obtain data within a specified time interval? For example, if I am downloading US PPI data: usppi <- as.zoo(getSymbols("PPIACO", src="FRED", verbose=TRUE, auto.assign=FALSE)) How do I ask getSymbols to truncate starting from Jan-1970 until present? I looked up the help file but couldn't find anything. Another newbie question, can I
2009 Mar 10
1
HAC corrected standard errors
Hi, I have a simple linear regression for which I want to obtain HAC corrected standard errors, since I have significant serial/auto correlation in my residuals, and also potential heteroskedasticity. Would anyone be able to direct me to the function that implements this in R? It's a basic question and I'm sure I'm missing something obvious here. I looked up this post:
2008 Dec 18
1
For and if confusion
I have two date objects X <- c("01-03-1993", "01-05-1997") #Mar 1993 and May 1997 Y <- c("01-02-1995", "01-08-1999") #Feb 1995 and Aug 1999 and a time series object A <- ts(rnorm(120), freq=12, start=c(1992,8)) #Aug 1992 to Aug 2002 I want to create a binary (0-1) vector B that is of length 1:(A). B should have value 1 for the time periods
2009 Feb 12
2
Problem with loading rJava in R
Hello. I am trying to load the rJava package in R-2.7.2 (Windows XP 64-bit RGui) and get the following error message even though the mentioned .dll file is located at the directory listed in the error message. I have tried to uninstall and reinstall the package but that does not resolve the problem. Then uninstallation and re-installation of R did not resolve the issue either. Any suggestions are
2009 Mar 25
4
Manual sort in a for loop
Dear all, I am trying to manually re-sort rows in a number of tables. The rows aren't sorted on any particular values but are simply ordered by user choice (as shown by the row numbers in the code). I have been able to carry out each re-arrangement without the use of the 'for' loop, but cannot seem to successfully execute the statements when incorporated into the loop. The code I have
2009 Feb 27
5
Filtering a dataset's columns by another dataset's column names
Hello all, I hope some of you can come to my rescue, yet again. I have two genetic datasets, and I want one of the datasets to have only the columns that are in common with the other dataset. Here is a toy example (my real datasets have hundreds of columns): Dataset 1: Individual SNP1 SNP2 SNP3 SNP4 SNP5 1 A G T C A 2 T C A G T 3 A C T
2009 Mar 26
4
Reading in files with variable parts to names
Dear all, I'm trying to read in a whole directory of files which have two variable parts to the file name: year and month. E.g. comp198604.asc represents April of 1986 - 'comp' is fixed in each case. Years range between 1986 to 1995 and months are between 1 and 12. Just to be clear, there are 12 files associated with each year: e.g. comp198601, comp198602, ... comp198612 through to
2009 Feb 09
11
Choosing a random number between x and y
Hi, Ive been trying to find a function that will allow me to pull out a number between a minimum and maximum threshold. I want a random decimal number between, for example, 0 and 0.5 or 0 and 0.7. I've been searching everywhere for a function that will allow me to do this in R, but I have yet to be successful. Any help would be much appreciated. Thanks in advance -- View this message in
2009 Feb 02
1
Beveridge Nelson Decomposition
Hi, Would anyone know if it is possible to run a Beveridge Nelson decomposition of a univariate time series object in R? I searched in the help files but didn't come across any potential methods. Thanks very much, Shruthi -- View this message in context: http://www.nabble.com/Beveridge-Nelson-Decomposition-tp21789452p21789452.html Sent from the R help mailing list archive at Nabble.com.
2008 Jan 10
5
Extracting last time value
I have a dataframe as follows: Date time value 20110620 11:18:00 7 20110620 11:39:00 9 20110621 11:41:00 8 20110621 11:40:00 6 20110622 14:05:00 8 20110622 14:06:00 6 For every date, I want to extract the row that has the greatest time. Therefore, ending up like: 20110620 11:39:00 9 20110621 11:41:00 8 20110622 14:07:00 6 I am using for loops (for every date, find largest time value) to do
2007 Dec 26
2
Rbind-ing a list into one item
Hi, I am doing the following: 1. I have a list of files.. Files1=list.files("some directory",pattern="some pattern") 2. I define a list as res=vector("list", length(files1)) 3. I read all the files into this list: res=lapply(files1, read.csv) I now want to rowbind all the items in the list into one big mass (all files have same number of columns). I tried
2007 Dec 19
3
Aggregating by a grouping
Suppose I have: Book Value A 10 B 11 C 9 D 8 A 12 C 4 D 5 B 7 I want to summarize above not by Book but by groupings of Books as in (below) I have a list ... basic_map <- list(c("A",B"),c("C,D")) Big_names <- c("A1", "A2") Names(basic_map) <- big_names So I want to get : A1 40 A2 26 How do I use tapply AND the list to get my
2008 Jan 08
1
Error with rbind and zoo
Hi all: I have a directory of files as in -------------> bunchafiles <- list.files(path="/data/2.3/2006", pattern="returns", full.names=T,recursive=T) .... Each file is a bunch of returns for a particular date (unique). There are like 252 files or so. With a custom function myread (below), I define a vector ----- res <-