similar to: more on date conversion differences in 2.2.1 vs 2.3.1

Displaying 20 results from an estimated 900 matches similar to: "more on date conversion differences in 2.2.1 vs 2.3.1"

2002 Feb 02
1
chron problem: extracting days and years
Hello r-help, I'm trying to split a character vector of dates of the form "dd-mmm-yy" into component days, months and years. But > library(chron) > testdate<-as.POSIXlt(strptime("17-Sep-98","%d-%b-%y")) > testdate [1] "1998-09-17" > months(testdate) [1] "September" # which is fine, but for days and years I get >
2011 May 30
1
CLI command 'database deltree' doesn't remove family with space in its name
While playing with DB function in Dialplan, I have added some garbage in AstDB. These are some family names with space in them. See this, demo*CLI> database show /18-05-2011 00:00:0052011175221575/TESTDATE : 2011-05-14 21:33:46 /18-05-2011 00:00:0052011175221575/TEST1 : 410 /18-05-2011 00:00:0052011175221575/TEST2 : 155 /18-05-2011 00:00:0052011182614252/TEST3 :
2008 Jul 24
2
Can R fill in missing values?
Hi, I know this can be done in Stata (which is quite messy) but I wanted to know if it can be done in R. So lets say I have a merged data set (I used the merge function by date for the attached two files), where all the missing values are filled with NAs (which is what the all.x=TRUE does). Is there any way to replace those NAs with the value of the latest row that contains a value? For
2008 Mar 03
1
Tapply for Group Specific Means and Proportions
UseRs, I am working on a dataset (see small example below) where individuals were followed on a specific date-time combo and multiple repeated measurements were taken (e.g., height in meters, behavior class in 2 letter code). Observation numbers varied between individual (ranging from 1 observation for each date-time combo to >50) I am trying to summarize the data into 1 row per
2008 Jul 23
2
Can't Load Text Files
Hi, I've completely forgotten how to do R, and it seems I can't even load simple files correctly. I have two tab deliminated text files (attached, these were test files of the larger data files I'm trying to work with) that I am trying to load into R so that I can merge them. They were originally excel files but I used "saved as" to reformat to text. I don't know if
2002 Dec 27
1
Solaris Date getting changed while using samba
Skipped content of type multipart/alternative-------------- next part -------------- **************************Disclaimer************************************************** Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified
2005 Oct 31
0
Problem using reshape with missing values in idvar
Hello everybody, I have been recently using reshape to convert "long" data to "wide" data. Everything was going well until I reached some problematic datasets. It has taken me a couple of weeks to finally figure out what might be happening. The problem is reproducible with test cases, and on two versions of R (Windows 2.2.0 and x86-64 Fedora Core 3 R 2.2.0). The data
2012 Jan 24
6
Checking for invalid dates: Code works but needs improvement
Hello Everyone, Still new to R. Wrote some code that finds and prints invalid dates (see below). This code works but I suspect it's not very good. If someone could show me a better way, I'd greatly appreciate it. Here is some information about what I'm trying to accomplish. My sense is that the R date functions are best at identifying invalid dates when fed character data in their
2009 Dec 10
2
different randomForest performance for same data
Hello, I came across a problem when building a randomForest model. Maybe someone can help me. I have a training- and a testdataset with a discrete response and ten predictors (numeric and factor variables). The two datasets are similar in terms of number of predictor, name of variables and datatype of variables (factor, numeric) except that only one predictor has got 20 levels in the training
2008 Sep 24
4
rowSums()
Say I have the following data: testDat <- data.frame(A = c(1,NA,3), B = c(NA, NA, 3)) > testDat A B 1 1 NA 2 NA NA 3 3 3 rowsums() with na.rm=TRUE generates the following, which is not desired: > rowSums(testDat[, c('A', 'B')], na.rm=T) [1] 1 0 6 rowsums() with na.rm=F generates the following, which is also not desired: > rowSums(testDat[, c('A',
2004 Mar 05
3
as.POSIXct problem
Hi all, I'm having difficulty converting a 'dates' object to a POSIXct object: testDATES<-c(35947,35971,36004,36008,36053,36066) testDATES<-chron(dates=testDATES, format = c(dates = "m/d/y"), origin=c(month = 12, day = 30, year = 1899)) >[1] 06/01/98 06/25/98 07/28/98 08/01/98 09/15/98 09/28/98 > as.POSIXct(testDATES) [1] NA NA NA NA NA NA
2011 Jan 17
1
Replacing rows in a data frame
R-helpers, Below is a simple example of some output that I am getting while trying to work with a data frame in R 2.12.1 for Mac. ----- > testdat <- data.frame(matrix(ncol=10, nrow=10)) > colnames(testdat) <- c('a','b','c','d','e','f','g','h','i','j') > testdat[seq(1,10,3),] <-
2010 Sep 29
2
resampling issue
I am trying to get R to resample my dataset of two columns of age and length data for fish. I got it to work, but it is not resampling every replicate. Instead, it resamples my data once and then repeated it 5 times. Here is my dataset of 9 fish samples with an age and length for each one: Age Length 2 200 5 450 6 600 7 702 8 798 5 453 4 399 1 120 2 202 Here is my code which resamples my
2011 Mar 12
1
Column order in stacking/unstacking
Dear R users, I'm having some problems with the stack() and unstack() functions, and wondered if you could help. I have a large data frame (400 rows x 2000 columns), which I need to reduce to a single column of values (and therefore 800000 rows), so that I can use it in other operations (e.g., generating predictions from a GLM object). However, the problem I'm having can be reproduced
2010 Sep 29
2
repeat a function
I have R randomly sampling my array made up of 2 columns of data. Here is my code randomly sampling 5 different rows from my dataset to create a new dataset of 8 rows of data: testdat<-growth[sample(5,8,replace=T),] Now I want to tell R to repeat this function 50 times and give me the output. I have been searching the internet and have been unable to figure this out. Any advice
2011 Feb 15
3
expected behavior when parsing lines with special characters
Say I have a tab-delimited table I want to read into R. What should I expect to happen if some of the entries contain the character " ' "? I thought it would read the file fine, but that is not what happens. Instead, all the values in between two " ' "s get read into one field, and things are just seriously messed up. Is this a bug, and besides removing the offending
2011 Apr 13
3
predict()
Hi, I am experimenting with the function predict() in two versions of R and the R extension package "survival". library(survival) set.seed(123) testdat=data.frame(otime=rexp(10),event=rep(0:1,each=5),x=rnorm(10)) testfm=as.formula('Surv(otime,event)~x') testfun=function(dat,fm) { predict(coxph(fm,data=dat),type='lp',newdata=dat) } # Under R 2.11.1 and
2011 Apr 13
3
predict()
Hi, I am experimenting with the function predict() in two versions of R and the R extension package "survival". library(survival) set.seed(123) testdat=data.frame(otime=rexp(10),event=rep(0:1,each=5),x=rnorm(10)) testfm=as.formula('Surv(otime,event)~x') testfun=function(dat,fm) { predict(coxph(fm,data=dat),type='lp',newdata=dat) } # Under R 2.11.1 and
2012 Jan 26
0
R-help Digest, Vol 107, Issue 25
Hi Rui, Thanks for your reply to my post. My code still has various shortcomings but at least now it is fully functional. It may be that, as I transition to using R, I'll have to live with some less than ideal code, at least at the outset. I'll just have to write and re-write my code as I improve. Appreciate your help. Paul Message: 66 Date: Tue, 24 Jan 2012 09:54:57 -0800 (PST)
2011 Jun 17
1
sink() and library() calls cause script to stop when called from php
Hello all, I have a php script that makes a call system(PATH_PROJECT_ROOT . '/sh/combineDays.sh ' . $dateString . " " . PATH_PROJECT_ROOT); and within combineDays.sh I run an R script: R --slave --vanilla --args $testDates $BASEDIR $defaultSearchVersion < $BASEDIR"R/combineDays.R" At the end of this R script, I try to write results to a file, but the