similar to: Time problems (POSIXct)

Displaying 20 results from an estimated 7000 matches similar to: "Time problems (POSIXct)"

2006 Jun 23
3
Problems with weekday extraction from zoo objects
Hi Folks! I'm struggling with dates - but enough about my personal life..... I have two daily time series files. In one (x) the date format is Y/m/d and the other (y) is d/m/y. I used read.zoo on both and they read into R with no problem. Then I use: weekdays(as.Date(x$DATE)) and get what I expect - all the days of the week in my data set. When I use:
2012 Nov 23
3
daily maximum temperature
Hello, I want to filter the daily maximum temperature. For this i made this skript, but it come out wrong results. Can anybody help me? Thanks for your help! Best regards datos$X <- as.POSIXct(strptime(datos$X, "%d/%m/%Y %H:%M:%S")) z <- aggregate(zoo(datos$Ta), as.POSIXct(datos$X), max) > str(datos) 'data.frame': 17137 obs. of 5 variables: $ X : Factor w/
2013 Mar 08
2
Zoo Data
Hi Jakob, dat1<-read.table(text=" TIME, Value1, Value2 01.08.2011 02:30:00, 4.4, 4.7 01.09.2011 03:00:00, 4.2, 4.3 01.11.2011 01:00:00, 3.5, 4.3 01.12.2011 01:40:00, 3.4, 4.5 01.01.2012 02:00:00, 4.8, 5.3 01.02.2012 02:30:00, 4.9, 5.2 01.08.2012 02:30:00, 4.1, 4.7 01.12.2012 03:00:00, 4.7, 4.3 01.01.2013 01:00:00, 3, 4.3 01.01.2013 01:30:00, 3.8, 4.1 01.01.2013 02:00:00, 3.8,
2008 Oct 01
9
time segments intersection
Hi all, Please, how could I calculate the time that two time segments has in common? Is there any function to perform this calculation? For instance, given four POSIXlt objects... endPeriod<-as.POSIXlt("2008-09-30") startPeriod<-as.POSIXlt("2007-10-01") endProject<-as.POSIXlt("2007-05-31") startProject<-as.POSIXlt("2006-12-01") that limit
2006 Jul 08
2
String mathematical function to R-function
hello I make a subroutine that give-me a (mathematical) function in string format. I would like transform this string into function ( R function ). thanks for any tips. cleber #e.g. fun_String = "-100*x1 + 0*x2 + 100*x3" fun <- function(x1,x2,x3){ return( ############ evaluation( fun_String ) ############ ) True String mathematical function :-( :-( > nomes [1]
2009 Nov 09
3
How to transform the Matrix into the way I want it ???
Hi, R users, I'm trying to transform a matrix A into B (see below). Anyone knows how to do it in R? Thanks. Matrix A (zone to zone travel time) zone z1 z2 z3 z1 0 2.9 4.3 z2 2.9 0 2.5 z3 4.3 2.5 0 B: from to time z1 z1 0 z1 z2 2.9 z1 z3 4.3 z2 z1 2.9 z2 z2 0 z2 z3 2.5 z3 z1 4.3 z3 z2 2.5 z3 z3 0 The real matrix I have is much larger, with more than 2000 zones. But I think it should
2011 Mar 29
5
Integration with variable bounds
If this is posted elsewhere I cannot find it. I need to perform multiple integration where some of the variables are in the bounds of the other variables. I was trying to use R2Cuba function but cannot set the upper and lower bounds. My code so far is : int <- function(y){ u2 = y[1] z2 = y[2] u1 =y[3] z1 = y[4] ff <- u1*(z1-u1)*u2*(z2-u2)*exp(-0.027*(12-z2)) return(ff) }
2012 Aug 08
3
help, please! matrix operations inside 3 nested loops
hello, this is my script: #1) read in data: daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt', header=TRUE, sep="\t") daten<-as.matrix(daten) #2) create empty matrix: indxind<-matrix(nrow=617, ncol=617) indxind[1:20,1:19] #3) compare cells to each other, score: for (s in 3:34) { #walks though the matrix colum by colum, starting at
2006 Jun 15
3
matrix selection return types
Dear Rusers, I would like some comments about the following results (under R-2.2.0) > m = matrix(1:6 , 2 , 3) > m [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 > z1 = m[(m[,1]==2),] > z1 [1] 2 4 6 > is.matrix(z1) [1] FALSE > z2 = m[(m[,1]==0),] > z2 [,1] [,2] [,3] > is.matrix(z2) [1] TRUE Considered together, I'm a bit surprised about
2002 Mar 27
2
Error with nls
Dear R-group members, I use: platform i386-pc-mingw32 arch x86 os Win32 system x86, Win32 status major 1 minor 4.1 year 2002 month 01 day 30 language R I try to fit a 2 compartment model. The compartments are open, connected to each other and
2008 Oct 04
3
How to plot countours with fixted densities?
Hello, I used the following codes to generate bivariate normal dependence structure with unit Frechet margins. Sigma <- matrix(c(1,.5*sqrt(1),.5*sqrt(1),1),2,2) # generate y <- mvrnorm(Nsam, c(0,0), Sigma) # random v <- cbind(pnorm(y[,1],mean = 0, sd = 1), pnorm(y[,2],mean = 0, sd = 1)) z <- cbind(-1/log(v[,1]),-1/log(v[,2])) z1 <- z[,1] z2 <- z[,2] And to
2013 Oct 18
1
crr question‏ in library(cmprsk)
Hi all I do not understand why I am getting the following error message. Can anybody help me with this? Thanks in advance. install.packages("cmprsk") library(cmprsk) result1 <-crr(ftime, fstatus, cov1, failcode=1, cencode=0 ) one.pout1 = predict(result1,cov1,X=cbind(1,one.z1,one.z2)) predict.crr(result1,cov1,X=cbind(1,one.z1,one.z2)) Error: could not find function
2017 Jul 28
3
problem with "unique" function
I have the joint distribution of three discrete random variables z1, z2 and z3 which is captured by "z" and "prob" as described below. For example, the probability for z1=0.46667, z2=-1 and z3=-1 is 2.752e-13. Also, the probability adds up to 1. > head(z) z1 z2 z3 [1,] -0.46667 -1.0000 -1.0000 [2,] -0.33333 -0.9333 -0.9333 [3,] -0.20000 -0.8667 -0.8667
2006 Jun 14
3
A question about stepwise procedures: step function
Dear all, I tried to use "step" function to do model selection, but I got an error massage. What I don't understand is that data as data.frame worked well for my other programs, how come I cannot make it run this time. Could you please tell me how I can fix it? ***************************************************************************************************
2008 Jul 11
1
Comparing complex numbers
Is there an easy way to compare complex numbers? Here is a small example: > (z1=polyroot(c(1,-.4,-.45))) [1] 1.111111-0i -2.000000+0i > (z2=polyroot(c(1,1,.25))) [1] -2+0i -2+0i > x=0 > if(any(identical(z1,z2))) x=99 > x [1] 0 # real and imaginary parts: > Re(z1); Im(z1) [1] 1.111111 -2.000000 [1] -8.4968e-21 8.4968e-21 > Re(z2); Im(z2) [1] -2
2006 Mar 16
2
Using of LME function in non-replicate data
Hello all R-users! In Jun-2005, I find the follow discussion about using of LME function ( in NLME library ) for fitting non-replicate data The thread: ANOVA vs REML approach to variance component estimation http://tolstoy.newcastle.edu.au/R/help/05/06/6498.html Someone expose the follow problem: # non-replicate data y <- c(2.2, -1.4, -0.5, -0.3, -2.1, 1.5, 1.3, -0.3, 0.5, -1.4,
2008 Apr 03
3
summary(object, test=c("Roy", "Wilks", "Pillai", ....) AND ellipse(object, center=....)
Dear All, I would be very appreciative of your help with the following 1). I am running multivariate multiple regression through the manova() function (kindly suggested by Professor Venables) and getting two different answers for test=c("Wilks","Roy","Pillai") and tests=c("Wilks","Roy",'"Pillai") as shown below. In the
2006 Jan 27
1
about lm restrictions...
Hello all R-users _question 1_ I need to make a statistical model and respective ANOVA table but I get distinct results for the T-test (in summary(lm.object) function) and the F-test (in anova(lm.object) ) shouldn't this two approach give me the same result, i.e to indicate the same significants terms in both tests??????? obs. The system has two restrictions: 1) sum( x_i ) = 1 2) sum(
2005 Jun 02
4
plot/lm/abline
Hi, when I run > plot.default(z1, z2, xlab = "x", ylab = "y", main = "xxxx", pch = "+") > abline(lm(z1 ~ z2)) then the plot is plotted perfectly (scatterplot), however, the lm() function doesnt appear on the plot. What could be wrong? (Yesterday it worked perfectly, with the lm() line.) Running R 2 on OS X. Mathias Hunsk??r Furevik Norway
2004 Mar 10
1
Shorewall2 - Action commands
Dear All, I have read all the documentation I can find but I still have not understood how, in what context and where to use the action commands enumerated in /usr/share/shorewall/actions.std. Illustrating with SMB traffic for instance, how can one use AllowSMB, DropSMB and RejectSMB to control SMB traffic instead of the classic ACCEPT z1 z2 udp 135,445 ACCEPT z1