similar to: converting character vector "hh:mm" to chron or strptime 24 clock time vectors

Displaying 20 results from an estimated 1000 matches similar to: "converting character vector "hh:mm" to chron or strptime 24 clock time vectors"

2007 Mar 10
2
read a irregular text file data into dataframe()
I am using R2.4.1 calling a text file contains the following data structure: when i call the file into R using tData<-read.table("c:\\test.txt") it gave me Error saying, irregular column in the data set however i need to use the below type of data Is there any alternative in R? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0010 0028 0061 0088 0010 0042 0084 0004 0010 0055 0010 0018 0040 0042
2012 May 25
1
Multiple rms summary plots in a single device
I would like to incorporate multiple summary plots from the rms package into a single device and to control the titles, and also to open a new device when I reach a specified number of plots. Currently I am only getting a single "plot(summary(" graph in the upper left- hand corner of each successive device. However, in the rms documention I see instances of a loop being used with
2013 Apr 17
1
Bug in VGAM z value and coefficient ?
Dear, When i multiply the y of a regression by 10, I would expect that the coefficient would be multiply by 10 and the z value to stay constant. Here some reproducible code to support the case. *Ex 1* library(mvtnorm) library(VGAM) set.seed(1) x=rmvnorm(1000,sigma=matrix(c(1,0.75,0.75,1),2,2))
2009 Feb 03
1
How to show variables used in lm function call?
Hello R users, I am new to R and am wondering if anyone can help me out with the following issue: I wrote a function to build ts models using different inputs, but when R displays the call for a model, I cannot tell which variables it is using because it shows the arguments instead of the real variables passed to the function. (e.g Call: lm(formula = dyn(dep ~ lag(dep, -1) + indep)) --->
2009 Feb 07
3
Output results to a single postscript document
Hello R users, I have been trying to output all my results (text, plots, etc) into the same postscript file as one document, but have been unable to...Can anyone help me improve my code below so that I can accomplish this? Currently I have to output them separately then piece them back together into one document.. Thanks in Advance for any help! options (scipen=999, digits=7)
2000 Feb 11
1
new chron problems in RW0990
Dear all, In RW0901 I could > dates("01/01/2000") [1] 01/01/100 where only the printing was wrong, but the double numeric representation of the chron object was calculated correctly but now in RW0990 > dates("01/01/2000") Error in fun(yy, ...) : must be 2-digit (numeric) year specification and also the followig doesn't help > dates("01/01/2000",
2005 Nov 02
2
Orientation of tickmarks labels in boxplot/plot
Hi, I have been trying draw tickmark labels along the y - axis perpendicular to the y axis while labels along the x - axis parallel to x axis while making box plot. Here is my test dataset. TData ID Ratio 1 0 7.075 2 0 7.414 3 0 7.403 4 0 7.168 5 0 6.820 6 0 7.294 7 0 7.238 8 0 7.938 9 1 7.708 10 1 8.691 11 1 8.714 12 1 8.066 13 1 8.949 14 1 8.590 15 1 8.714 16 1
2016 Apr 23
2
Data Frame Column Name Attribute
I am attempting to add a calculated column to a data frame. Basically, adding a column called "newcol2" which are the stock closing prices from 1 day to the next. The one little hang up is the name of the column. There seems to be an additional data column name included in the attributes (dimnames?). So when i run HEAD(DATAFRAMENAME) i get the column name = "Open". but
2000 Feb 16
1
chron and mysql
R 0.90.1 chron 2.2-2 MySQL 3.22.30 Attempts to create a chron object fail when using date and time data from a mysql database. It appears that chron does not like 4 digit years. Is this the problem? my data look like: > c.time[1:10,] Date Time 1 2000-02-14 10:15:02 2 2000-02-14 10:17:03 3 2000-02-14 10:18:03 4 2000-02-14 10:19:03 5 2000-02-14 10:20:04 6 2000-02-14
2007 Aug 23
1
Estimate Intercept in ARIMA model
Hi, All, This is my program ts1.sim <- arima.sim(list(order = c(1,1,0), ar = c(0.7)), n = 200) ts2.sim <- arima.sim(list(order = c(1,1,0), ar = c(0.5)), n = 200) tdata<-ts(c(ts1.sim[-1],ts2.sim[-1])) tre<-c(rep(0,200),rep(1,200)) gender<-rbinom(400,1,.5) x<-matrix(0,2,400) x[1,]<-tre x[2,]<-gender fit <- arima(tdata, c(1, 1, 0), method = "CSS",xreg=t(x))
2010 Nov 02
1
Setting the names of a data.frame
I have tData as below. I need to set the names with the headers from the first row in sHeaders Sorry .. forgot how to set the names from row in another data frame .. pls advise. names(tData) = sHeaders[1,] does not work correctly Also, why doesn't drop.levels(sHeaders) not work? dput(tData) structure(list(V1 = structure(c(3L, 1L, 1L, 2L), .Label = c("P H Ravi Kumar", "Rahul
2012 Mar 29
1
Adding duration (hh:mm:ss)\Converting factor column into duration class
Hi All, I have a data frame: Time1 Time2 1 176:46:10 41:48:06 2 171:28:57 61:19:10 3 178:25:15 34:05:35 4 74:04:20 25:01:55 5 136:11:20 37:59:32 6 138:17:17 30:22:27 7 183:04:48 29:25:02 8 179:35:01 19:29:44 > str(df) 'data.frame': 8 obs. of 2 variables: $ Time1: Factor w/ 583 levels
2017 Jun 14
1
spurious warning in ave()
Consider the following simple data set and a call to ave: > tdata <- data.frame(f1=c(1,1,1,1,2,2,2,2), f2=c(1,2,1,2,1,1,1,1), y=1:8) > with(tdata, table(f1, f2)) f2 f1 1 2 1 2 2 2 4 0 > with(tdata, ave(y, f1, f2, FUN=max)) [1] 3 4 3 4 8 8 8 8 Warning message: In FUN(X[[i]], ...) : no non-missing arguments to max; returning -Inf There are no missing values in the
2018 May 01
4
issue with model.frame()
A user sent me an example where coxph fails, and the root of the failure is a case where names(mf) is not equal to the term.labels attribute of the formula -- the latter has an extraneous newline. Here is an example that does not use the survival library. # first create a data set with many long names n <- 30? # number of rows for the dummy data set vname <- vector("character",
2005 Jan 07
3
Basic Linear Algebra
I don't normally have to go anywhere near this stuff , but it seems to me that this should be a straight-forward process in R. For the purposes of this enquiry I thought I would use something I can work out on my own. So I have my matrix and the right hand results from that matrix tdata <- matrix(c(0,1,0,-1,-1,2,0,0,-5,-6,0,0,3,-5,-6,1,-1,-1,0,0),byrow = T,ncol = 5) sumtd <-
2010 Nov 11
3
Evaluation puzzle
The survexp function can fail when called from another function. The "why" of this has me baffled, however. Here is a simple test case, using a very stripped down version of survexp: survexp.test <- function(formula, data, weights, subset, na.action, rmap, times, cohort=TRUE, conditional=FALSE, ratetable=survexp.us, scale=1, npoints, se.fit,
2013 Jun 25
1
Perplexed with environment
Hi I migrated from Linux to Mac, but I don't this has anything to do with it, but I am not sure. I am writing a small logger package, in which I have a file aaa.R: ,---- | .logData <- new.env() | assign("loggingThreshold", 10, envir = .logData) | assign("logToFile", FALSE, envir = .logData) | assign("logFileName", NULL, envir = .logData) | |
2010 Nov 03
4
Drawing circles on a chart
Dear Group, I have the following data matrix which is a timeseries. > dput(tData) structure(list(A = c(0.2, 0.13, 0.05, 0.1, 0.02, 0.18, 0.09, 0.06, 0.13), B = c(0.15, 0.06, 0.09, 0.02, 0.03, 0.12, 0.01, 0.15, 0.06), C = c(-0.1, 0, -0.07, -0.06, -0.05, -0.05, -0.06, -0.08, -0.07), D = c(-0.15, -0.05, -0.1, -0.03, -0.13, -0.04, -0.1, -0.04, -0.15), E = c(-0.17, -0.16, -0.08, -0.07, -0.09,
2001 Dec 14
1
Logistic regression : dicrepancies between glm and nls ?
Dear list, I'm trying to learn how to use nlme to be able to fit ad analyse mixed-model logistic regressions. In order to keep things simple, I started by the simplest possible model : a one (fixed-effect ...) continuous variable. This problem is, of course, solved by glm, but I wanted to look at a "hand-made" nls fit, in order to be able to "generalize" to nlme
2010 Oct 07
1
model.frame deficiency
The model.frame function has trouble with a certain type of really long formula. Here is a test: tname <- paste('var', 1:50, sep='') tmat <- matrix(rnorm(500), ncol=50, dimnames=list(NULL, tname)) tdata <- data.frame(tmat) temp1 <- paste( paste(tname, tname, sep='='), collapse=', ') temp2 <- paste("~1 + cbind(", temp1, ")")