Displaying 20 results from an estimated 2000 matches similar to: "Can't merge on datetime?"
2013 Feb 27
2
matrix multiplication
Hi,
Try this:
#mat1 is the data
res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7]-x1[2,7]))+(abs(x1[1,4]-x1[2,4])*abs(x1[1,8]-x1[2,8]))}));new1}))
2012 Sep 05
4
Summarizing data containing data/time information (as factor)
Dear R user
I want to create a table (as below) to summarize the attached data
(Test.csv, which can be read into R by using 'read.csv(Test.csv, header=F)'
), to indicate the day that there are any data available, e.g.value=1 if
there are any data available for that day, otherwise value=0.
28/04 29/04 30/04 01/05 02/05
532703 0 1 1
2017 Dec 06
2
Odd dates generated in Forecasts
Dear friends,
I have a weekly time series which starts on Jan 4th, 2003 and ends on
december 31st, 2016.
I set up my ts object as follows:
MyTseries <- ts(mydataset, start=2003, end=2016, frequency=52)
MyModel <- auto.arima(MyTseries, d=1, D=1)
MyModelForecast <- forecast (MyModel, h=12)
Since my last observation was on december 31st, 2016 I expected my forecast
date to start on
2018 May 16
1
Systemfit Question
I can't get my simultaneous equations to work using system fit. Please help.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
str(Empdata)
Empdata$gnipc<-as.numeric(Empdata$gnipc)
install.packages("systemfit")
library("systemfit")
pdata <- plm.data(Empdata,
2017 Dec 06
0
Odd dates generated in Forecasts
> On Dec 6, 2017, at 5:07 AM, Paul Bernal <paulbernal07 at gmail.com> wrote:
>
> Dear friends,
>
> I have a weekly time series which starts on Jan 4th, 2003 and ends on
> december 31st, 2016.
>
> I set up my ts object as follows:
>
> MyTseries <- ts(mydataset, start=2003, end=2016, frequency=52)
>
> MyModel <- auto.arima(MyTseries, d=1, D=1)
2017 Dec 06
1
Odd dates generated in Forecasts
Thank you very much David. As a matter of fact, I solved it by doing the
following:
MyTimeSeriesObj <- ts(MyData, freq=365.25/7,
start=decimal_date(mdy("01-04-2003")))
After doing that adjustment, my forecasts dates started from 2017 on.
Cheers,
Paul
2017-12-06 12:03 GMT-05:00 David Winsemius <dwinsemius at comcast.net>:
>
> > On Dec 6, 2017, at 5:07 AM, Paul
2018 May 16
0
Systemfit
Sadly you failed to set your email program to send plain text and the data is corrupted at my end.
I also think you need to reduce the size of the data set... the intent here is to increase your understanding, not debug your particular analysis.
I will say that I am having a very challenging time understanding what you are trying to accomplish though. What are the equations that you think need
2018 May 15
2
Systemfit
OK, Let's try this again! Here is the reproducible script; it is long because I had to copy the panel dataset here. My question is related to systemfit; I don't know how to get the result for the entire panel.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
install.packages("systemfit")
2010 Oct 01
3
Converting a dataframe column from string to datetime
Hi,
I have a dataframe column of the form
v<-c("Fri Feb 05 20:00:01.43000 2010","Fri Feb 05 20:00:02.274000 2010","Fri Feb 05 20:00:02.274000 2010","Fri Feb 05 20:00:06.34000 2010")
I need to convert this to datetime form. I did the following..
lapply(v,function(x){strptime(x, "%a %b %d %H:%M:%OS %Y")})
This gives me a list that looks like
2007 Dec 11
3
Wrong length of POSIXt vectors (PR#10507)
Full_Name: Petr Simecek
Version: 2.5.1, 2.6.1
OS: Windows XP
Submission from: (NULL) (195.113.231.2)
Several times I have experienced that a length of a POSIXt vector has not been
computed right.
Example:
tv<-structure(list(sec = c(50, 0, 55, 12, 2, 0, 37, NA, 17, 3, 31
), min = c(1L, 10L, 11L, 15L, 16L, 18L, 18L, NA, 20L, 22L, 22L
), hour = c(12L, 12L, 12L, 12L, 12L, 12L, 12L, NA, 12L,
2011 Feb 19
1
problem in plotting numeric x by POSIXt class with lattice
# hi all,
# I'm trying to plot temperatures by date in a trellis plot by their
stations
# I'm plotting the following data.frame
library(lattice)
h <- structure(list(station_name = structure(c(3L, 4L, 2L, 10L, 11L,
12L, 6L, 7L, 5L, 8L, 9L, 3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L, 5L,
8L, 9L, 3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L), .Label = c("Ashqelon",
"Beer Sheva",
2013 Feb 08
2
Can not melt data.frame
I realize it's -12C and we're having the next best thing to a blizzard but why can I not melt this data frame.
I am missing something terribly obvious but I just don't understand what the error message is saying.
John Kane
Kingston ON Canada
Code and aata below
#================================================#
library(reshape2)
melt(mydata, id.vars = c("date"))
2018 May 15
0
Systemfit
... and the mailing list is picky about attachments... whatever you attached did not conform to the stringent requirements mentioned in the Posting Guide. Pasting the code right into the email is usually safest, though you DO have to post using plain text (as the Posting Guide indicates) or your code may get mangled by the automatic html format removal.
On May 15, 2018 7:04:31 AM PDT, Bert Gunter
2007 Jan 17
2
problem with unlist POSIX date at midnight
Dear R-users,
I use unlist of POSIX dates to extract the year, hour etc. With that I
can search for files in my database which are in the form
'yyyymmddhh_synops.txt'
However, I get stucked during midnight where unlist just gives NA's.
The script is given below, the problem accurs at acc.period[16]
(midnight). However when I write out the character, unlist works well.
But
2005 Oct 06
2
isdst
Can someone, please, explain the difference is results below (notice
the isdst value)
> unlist(as.POSIXlt('2005-7-1'))
sec min hour mday mon year wday yday isdst
0 0 0 1 6 105 5 181 1
> unlist(as.POSIXlt(as.Date('2005-7-1')))
sec min hour mday mon year wday yday isdst
0 0 0 1 6 105 5 181 0
2018 May 15
1
Systemfit
Unless there is good reason not to, always cc the list -- there are lots of
smarter folks than I on it who can help.
I may or may not have time to look at this. Hopefully someone else will.
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip
2003 Aug 13
1
Problems with addition in big POSIX dates
Have you noticed any problems with big dates (>=1/1/2040) in R?
Here is the bit of code that I'm having trouble with:
> test.date <- strptime("1/1/2040",format="%m/%d/%Y")
>
> unlist(test.date)
sec min hour mday mon year wday yday isdst
0 0 0 1 0 140 0 0 0
>
> date.plus.one <- as.POSIXct(test.date) +
2020 Oct 23
2
The presence/absence of `zone` in POSIXlt depending on time zone as a cause of possible inconsistences?
Dear all,
I have just detected what seems a minor inconsistence with data types. If one unlists a POSIXlt time with GMT zone gets a numeric vector, since the POSIXlt list has no `zone` element, while if one unlists a POSIXlt time with a non GMT zone (also non specifying tz if the Sys.timezone is not GMT) gets a character vector due to including the `zone` element.
> x <-
2009 Feb 27
0
POSIXlt, POSIXct, strptime, GMT and 1969-12-31 23:59:59
R-devel:
Some very inconsistent behavior, that I can't seem to find documented.
Sys.setenv(TZ="GMT")
str(unclass(strptime("1969-12-31 23:59:59","%Y-%m-%d %H:%M:%S")))
List of 9
$ sec : num 59
$ min : int 59
$ hour : int 23
$ mday : int 31
$ mon : int 11
$ year : int 69
$ wday : int 3
$ yday : int 364
$ isdst: int 0
- attr(*, "tzone")= chr
2020 Oct 01
3
timezone tests and R-devel
The return value of Sys.time() today with a timezone of US/Eastern is
unchanged between 4.0.3-patched and devel, but on devel the following test
fails
all.equal(x, as.POSIXlt(x))
with
x = Sys.time()
This means that devel does not complete make tests (failure on
tests/reg-tests-2.R)
It is entirely possible that it is an error on my end, I use
export TZ="US/Eastern"
but I have been