Displaying 20 results from an estimated 6000 matches similar to: "Problem with my function using as.POSIXct"
2012 Oct 10
3
How to replicate SAS by group processing in R
Hello,
I am trying to re-code all my programs from SAS into R.
In SAS I use the following code:
proc sort data=upper;
by tdate stock_symbol expire strike;
run;
data upper1;
set upper;
by tdate stock_symbol expire strike;
if first.expire then output;
rename strike=astrike;
run;
on the following data set:
tdate stock_symbol expiration strike
9/11/2012 C 9/16/2012
2012 Oct 19
4
Creating a new by variable in a dataframe
Hello,
I have a dataframe w/ 3 variables of interest: transaction,date(tdate) &
time(event_tim).
How could I create a 4th variable (last_trans) that would flag the last
transaction of the day for each day?
In SAS I use:
proc sort data=all6;
by tdate event_tim;
run;
/*Create last transaction flag per day*/
data all6;
set all6;
by tdate event_tim;
last_trans=last.tdate;
Thanks
2012 Aug 31
2
Conditional merging in R & if then statement
1)I am wandering how the following SQL statement can be written in R language
w/o using sqldf:
create table detail2 as
select a.*
from detail a,
pdetail b
where a.TDATE=b.TDATE
and (a.STIM >= b.STIM and a.STIM <=b.MAXTIM)
2) when try if then in R it only applies to the 1st row & not to whole
dataset like in SAS. How do you get round that?
in SAS:
data summary;
set all1;
2018 Apr 15
4
Adding a new conditional column to a list of dataframes
Hi all ..,
I have a list of 7000 dataframes with similar column headers and I wanted to add a new column to each dataframe based on a certain condition which is the same for all dataframes.
When I extract one dataframe and apply my code it works very well as follows :-
First suppose this is my first dataframe in the list
> OneDF <- Mylist[[1]]
> OneDF
ID Pdate
2015 Nov 06
2
(sin asunto)
Hola a tod en s,
sigo intentando representar una variable en función de meses. En la columna
Mesos tengo los meses de la siguiente manera:
01/08/1996, 01/09/1996 etc.
He probado con el siguiente comando:
plot(Mesos, Serie01)
obteniendo
y tendría que obtener:
[image: Imágenes integradas 2]
Pero donde pone Observation Index, me gustaria tener los meses (para esta
grafica he usado
2018 Apr 15
0
Adding a new conditional column to a list of dataframes
> On Apr 15, 2018, at 4:08 AM, Allaisone 1 <Allaisone1 at hotmail.com> wrote:
>
>
> Hi all ..,
>
>
> I have a list of 7000 dataframes with similar column headers and I wanted to add a new column to each dataframe based on a certain condition which is the same for all dataframes.
>
>
> When I extract one dataframe and apply my code it works very well as
2012 Aug 29
2
Deduping in R by multiple variables
I have a dataset w/ 184K obs & 16 variables. In SAS I proc sort nodupkey it
in seconds by 11 variables.
I tried to do the same thing in R using both the unique & then the
!duplicated functions but it just hangs there & I get no output. Does
anyone know how to solve this?
This is how I tried to do it in R:
detail3 <-
2018 Jul 26
2
Aw: Re: Panic: Leaked view for index - virtual mailbox
I am pretty sure Synoptic/INBOX/Archives will not be same as INBOX/Archives.
a SELECT Synoptic/INBOX/Archives
a NO Mailbox doesn't exist: Synoptic/INBOX/Archives (0.001 + 0.000 secs).
a SELECT INBOX/Archives
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)]
Flags permitted.
* 45 EXISTS
So as you can see, specifying
2018 Feb 05
1
Bug in dovecot 2.3 virtual plugin
Hi,
did you have time to investigate about 'Panic: file unichar.c' bug ?
Because I have the same problem with a 2.3.0 installation without
virtual plugin.
Thanks,
Marco
On 2018-01-03 16:52, Aki Tuomi wrote:
> This is not a bug in virtual plugin, but in some email which contains invalid unicode sequence somehow. Can you send me a core file? This should not have occured ofc but
2018 Jan 03
4
Bug in dovecot 2.3 virtual plugin
Hi there!
I compiled dovecot 2.3 from git. Because there is already a bug in
virtual-plugin, and i hoped, it get fixed... but it doesn't. So this
is the error-message from the log
J?n 03 16:27:08 aldebaran dovecot[26460]:
indexer-worker(jakob)<26476><qQ6g1+BhIJvAqAAO:sjYhMTH2TFpsZwAAk1Mx3g>:
Panic: file unichar.c: line 160 (uni_ucs4_to_utf8_c): assertion
failed:
2019 Nov 07
2
dovecot ignores users sieve-script
Hi there!
I recognized that dovecot ignores users sieve-script. The global and the
post-sieve-scripts are working, but users sievescript is ignored.
You can see the sieve trace-files last lines
? 65:?? finishing match with result: not matched
? 65: jump if result is true
? 65:?? not jumping
? 65: jumping to line 67
? 67: jumping to line 77
????? ## Finished executing script 'global'
?
?
2018 Jul 26
3
Panic: Leaked view for index - virtual mailbox
Hi!
Was looking at your config and I am puzzled why you are adding
? mailbox INBOX/Archives {
??? auto = no
??? special_use = \Archive
? }
under namespace 'Synoptic'? Do you actually have a virtual folder config
for all those folders? You can't just "move" folders into a namespace by
declaring them there, those become Synoptic/INBOX/Archives, and require
a dovecot-virtual
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
2012 Aug 24
1
POSIXct-coerced NA's not considered NA by is.na()
Hello folks,
I found a strangeness while experimenting with POSIXct vectors and
lists. It seems that coerced NA's aren't "real" NAs, at least as
considered by is.na()?
> date_vec = c(as.POSIXct(now()), as.POSIXct(now()+1),NA,"b")
> date_vec
[1] "2012-08-22 15:00:46 COT" "2012-08-22 15:00:47 COT" NA
[4] NA
Warning message:
In
2003 Jun 05
1
question about POSIXct conversion
Hello!
I am trying to compute minimal time on some data like this:
mt<-tapply(mrsh$time1,list(mrsh$var1,mrsh$var2),min):
a b
145 1054800600 1054789800
340 1054804500 1054794600
349 1054820400 1054792800
55 1054800600 1054789200
57 1054814100 1054791000
78 1054822200 1054790400
843
2003 Jan 22
1
Convert numeric value to POSIXct
Hi,
How do I convert a numeric value indicating the time since 1970, back into
a POSIXct class object? I have tried format.POSIXct and as.POSIXct
without success.
For example
> ccc
[1] "1945-01-01 15:00:00 MDT"
> ddd<- as.numeric(ccc);
> ddd
[1] -788842800
> format.POSIXct(ddd)
Error in format.POSIXct(ddd) : wrong class
> as.POSIXct(ddd)
Error in
2003 Sep 02
1
convert character to POSIXct
Dear list-members,
I would like to calculate the difference between two points in time. To convert a 'time (GMT)'-character with the format "1/1/1999 01:01:01" into an object of class "POSIXct"', I first use the strptime() as suggested in the details help(as.POSIXct).
e.g.
starttime<-strptime("1/1/1999 01:01:01",format="%d/%m/%Y %H:%M:%S")
2012 Jan 19
2
POSIXct value display incorrect for some values
First, the reproducable example, showing how converting from character to
POSIXct to character changes the milliseconds in the first time stamp
though not in the second:
> as.POSIXct('2010-06-03 9:03:58.324')
[1] "2010-06-03 09:03:58.323 PDT"
> as.POSIXct('2010-06-03 9:03:58.325')
[1] "2010-06-03 09:03:58.325 PDT"
This seems to be due to truncation of
2006 Oct 04
2
integers to POSIXct
What is the recommended way to convert/coerce and integer to a POSIXct
please?
d <- as.POSIXct(Sys.Date())
i <- as.integer(d)
as.POSIXct(i)
Error in as.POSIXct.default(i) : do not know how to convert 'i' to class
"POSIXlt"
This appears to be the behaviour in 2.3.1 and 2.4.0 on windows XP.
I have tried searching on this and found as.Date.integer in package zoo
which
2018 May 16
2
Date method of as.POSIXct does not respect tz
R 3.5.0
Is it intended that the Date method of as.POSIXct does not respect the
tz parameter? I suggest changing as.POSIXct.Date to this:
function (x, tz = "", ...)
.POSIXct(unclass(x) * 86400, tz = tz)
Currently, the best workaround seems to be using the character method if
one doesn't want the default timezone (which is often an annoying DST
timezone).
This came up on