similar to: Wrong computation of time differenze in POSIXct - additional digits

Displaying 20 results from an estimated 5000 matches similar to: "Wrong computation of time differenze in POSIXct - additional digits"

2012 Jun 14
3
Time difference between two dates/timing
Hi, Here, i have a matrix like this MyMatrix <- *DATETIME HEADER1 HEADER2* 1/1/2010 0:10 197.1947 100.0859 1/1/2010 0:20 203.8811 100.1013 1/1/2010 0:30 206.564 100.0433 1/1/2010 0:40 207.9563 99.9393 i want to get the time difference in minutes between two date. TimeDiff <- MyMatrix[1,1] - MyMatrix[2,1] TimeDiff
2013 May 03
2
Write date class as number of days from 1970
Dear all, I have a dataset with one column being of class Date. When I write the output, I would like that column being written as number of days from 1970-01-01. I could not find anywhere a way to do it. Thanks, Marco -- View this message in context: http://r.789695.n4.nabble.com/Write-date-class-as-number-of-days-from-1970-tp4666155.html Sent from the R help mailing list archive at
2012 Sep 24
1
POSIXct coerced into numeric when filling a data frame
Hello I have a list of POSIXct objects, from which I want to extract those values that match a specific date, keeping them in POSIXct format. For a specific date there is 0-2 matching values. As an example (the actual list and objects are much longer): x<-list() x[["first"]]<-as.POSIXct(c("2011-08-27 10:45:00 GMT", "2011-10-30 15:45:00 GMT",
2009 Sep 11
1
What determines the unit of POSIXct differences?
Dear All, what determines if a difference between POSIXct objects gets expressed in days or seconds? In the following example, it's sometimes seconds, sometimes days. as.POSIXct('2009-09-01') - as.POSIXct(NA) Time difference of NA secs c(as.POSIXct('2009-09-01'), as.POSIXct(NA)) - c(as.POSIXct('2009-09-01'), as.POSIXct('2009-08-31')) Time differences in
2008 Jan 27
1
bug in difftime with as.POSIXct
I am trying to do ephemeris calculations in R, which involves calculating an elapsed time. As illustrated below, difftime seems to have problems with my method, since the fractional day is sometimes the correct 0.5 and sometimes the incorrect 0.46. I am doing this on with R-2.6.1 on a powerpc-apple-darwin8.10.1 system. I get the same results for as.POSIXlt() instead of as.POSIXct(), but the
2010 Aug 20
2
Problem with POSIXct in ave
Hi, I am having trouble using the ave function with a POSIXct object. For example: x<-Sys.time()+0:9*3600 dat<-data.frame(id=rep(c('a',' b','c'),each=10),dt=rep(x,3),i=rep(1:10,3)) dat # This is what I want to do: dat$time.elapsed<-unsplit(lapply(split(dat$dt,dat$id),function(x) x-x[1]),f=dat$id) dat # The above code does the trick, but from the standpoint of
2004 Aug 19
2
proposed change to [.POSIXct
R developers, The "tzone" attribute is stripped from a POSIXct object when the subscript command is called ("[.POISXct"). This results in dates being printed in the locale specific format after a subscript operation is applied to a POSIXct object which has cause several problems for me in the past. Here is an example of this problem under R 1.9.1: > x <-
2018 May 11
3
add one variable to a data frame
Hi Sarah, Thank you so much!! I got your good ideas. Ding -----Original Message----- From: Sarah Goslee [mailto:sarah.goslee at gmail.com] Sent: Friday, May 11, 2018 11:40 AM To: Ding, Yuan Chun Cc: r-help mailing list Subject: Re: [R] add one variable to a data frame [Attention: This email came from an external source. Do not open attachments or click on links from unknown senders or
2006 Oct 27
2
POSIXct time zone and daylight savings issues
Hello, Suppose we need a function that takes a POSIXct object and need to calculate the time difference between it and GMT time: gmtDiff <- function(time) { time.gmt <- as.POSIXct(format(time, tz="GMT")) time.plt <- as.POSIXlt(time) dlstime <- ifelse(time.plt$isdst > 0, 1, 0) timezone <- as.numeric(difftime(time, time.gmt, units="hours"))
2018 May 11
0
add one variable to a data frame
Sarah's solutions are good, and here's another, even more basic: tmp1 <- unique(dat1$B) tmp2 <- seq_along(tmp1) dat1$C <- tmp2[ match( dat1$B, tmp1) ] > dat1 N B C 1 1 29_log 1 2 2 29_log 1 3 3 29_log 1 4 4 27_cat 2 5 5 27_cat 2 6 6 1_log 3 7 7 1_log 3 8 8 1_log 3 9 9 1_log 3 10 10 1_log 3 11 11 3_cat 4 12 12 3_cat 4 As a single line
2014 Jun 06
1
Rjulia: a package for R call Julia through Julia C API
hello everyone,recently I write a package for R call Julia through Julia C API https://github.com/armgong/RJulia now the package can do 1 finish basic typemapping, now int boolean double R vector to julia 1d-array is ok,and julia int32 int64 float64 bool 1D array to R vector is also ok. 2 R STRSXP to julia string 1D array and Julia string array to STRSXP is written but not sure it is correct or
2016 Jun 22
2
[GSoC 2016] Enabling Polyhedral Optimizations in Julia - Midterm Report
Dear Community, in an earlier post, students working on LLVM were asked to provide a short report on their GSoC project. in the following I want to give an overview on the current status of my GSoC project and outline my next planned activities. Since my mentoring organization is Julia, I also send this to the according mailing list. *1. Activities so far:* As described in my proposal [1], I
2014 Aug 13
2
[LLVMdev] Advice for setting debug locations
Hello, I'm trying to fix a long standing issue we are having in Julia where when the file information switched, we weren't recording that correctly, so line information showed up in the wrong file. Basically we would always create a scope with the DISubprogram and the given line number. What I tried was to change the scope to be a DIFile instead so we'd get the correct file
2018 May 11
3
add one variable to a data frame
Hi All, I have a data frame dat1: dat1 <-data.frame(N=seq(1, 12,1), B=c("29_log","29_log", "29_log", "27_cat", "27_cat", "1_log", "1_log", "1_log", "1_log", "1_log",
2010 Jul 01
4
possible to plot number line in R?
Hallo! Is there a possibility to plot a number line in R? I would like to display 3 different Intervals on the same number line. Ideally, it would be possible to add a name to each number (e.g. Interval 1, lower cut-off...and so on). I have not found a command for this. Thank you for your help. Julia [[alternative HTML version deleted]]
2013 May 07
4
create unique ID for each group
Hey All, I have a dataset(dat1) like this: ObsNumber ID Weight 1 0001 12 2 0001 13 3 0001 14 4 0002 16 5 0002 17 And another dataset(dat2) like this: ID Height 0001 3.2 0001 2.6 0001
2013 Nov 21
2
[LLVMdev] Building LLVM with asan
Indeed, removing that flag works fine, the only question is why this is added in tools/llvm-shlib/Makefile in the first place then and what to do about it: ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD)) # Don't allow unresolved symbols. LLVMLibsOptions += -Wl,--no-undefined endif On Thu, Nov 21, 2013 at 11:53 AM, Alexander Potapenko <glider at
2013 Sep 21
1
Translating recoding syntax from SPSS to R
Colleagues, I am in the process of learning R. I've been able to import my dataset (from Stata) and do some simple coding. I have now come to coding situation that requires some assistance. This is some code in SPSS that I would like to be able to execute in R: if (race eq 1 and usborn=0) confused=1 . if (race eq 2 and usborn=0) confused=1 . if (race eq 1 and usborn=1) confused=0 . if (race
2010 Mar 30
2
Need help to split a given matrix is a "sequential" way
I need to split a given matrix in a sequential order. Let my matrix is : > dat <- cbind(sample(c(100,200), 10, T), sample(c(50,100, 150, 180), 10, > T), sample(seq(20, 200, by=20), 10, T)); dat [,1] [,2] [,3] [1,] 200 100 80 [2,] 100 180 80 [3,] 200 150 180 [4,] 200 50 140 [5,] 100 150 60 [6,] 100 50 60 [7,] 100 100 100 [8,] 200 150 100 [9,]
2013 Jan 08
2
plot residuals per factor
Dear R-users, I want to plot residuals vs fitted for multiple groups with ggplot2. I try this code, but unsuccessful. library("plyr") models<-dlply(dat1,"d",function(df) mod<-lm(y~x,data=df) ggplot(models,aes(.fitted,.resid), color=factor(d))+ geom_hline(yintercept=0,col="white",size=2)+ geom_point()+ geom_smooth(se=F) -- --- Catalin-Constantin ROIBU