Displaying 20 results from an estimated 300 matches similar to: "as.Date.character speed improvement suggestion"
2016 Apr 29
2
selecting columns from a data frame or data table by type, ie, numeric, integer
Good morning RGuru's
I have a data frame of 575 columns.? I want to extract only those columns that are numeric(double) or integer to do some machine learning with.? I have searched the web for a couple of days (off and on) and have not found anything that shows how to do this.?? Lots of ways to extract rows, but not columns.? I have attempted to use "(x == y)" indices extraction
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
> dt1[ vapply(dt1, FUN=is.numeric, FUN.VALUE=NA) ]
a c
1 1 1.1
2 2 1.0
...
10 10 0.2
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Apr 29, 2016 at 9:19 AM, Carl Sutton via R-help <
r-help at r-project.org> wrote:
> Good morning RGuru's
> I have a data frame of 575 columns. I want to extract only those columns
> that are numeric(double) or integer to do
2006 Sep 20
1
seq.Date not accepting NULL length.out (PR#9239)
There seems to be a bug in seq.Date such that it will not allow the user
to pass in length.out =3D NULL, despite the fact that this is the =
default
argument.
For example:
> dt1 <- as.Date("2004-12-31")
> dt2 <- as.Date("2005-12-31")
> seq.Date(dt1, dt2, length.out =3D NULL, by =3D "month")
Error in seq.Date(dt1, dt2, length.out =3D NULL, by =3D
2009 Aug 12
3
Zoo and numeric data
Hi,
I have a csv file with different datatypes:
2009-01-01, character1, 10, 20.1
2009-01-02, character2, 11, 21.1
(I have attached the file to this post)
I read this file with read.zoo as I want a zoo/xts timeseries:
> t = read.zoo("./data.txt", sep=",", dec = ".", header=FALSE)
If I look at the zoo data all integer/numeric columns are read as
character:
>
2023 Jan 26
2
Resumen de R-help-es, Vol 167, Envío 10
Hola esta es una solución
library(data.table)
library(stringr)
dt <- data.table( V1a = sample(c("1","0"), 10, TRUE)
, V1b = sample(c("1","0"), 10, TRUE)
, V2a = sample(c("1","0"), 10, TRUE)
, V2b = sample(c("1","0"), 10, TRUE)
, V3a =
2009 Nov 02
3
question about difference in date objects
Hi R Community:
I want to take the difference in two dates:
dt2 - dt1.
But, I want the answer in months between those 2 dates.
Can you advise me?
Please respond to: pzs6 at cdc.gov
Thank you!
Phil Smith
Centers for Disease Control and Prevention
2008 Jun 14
1
restricted coefficient and factor in linear regression.
Hi,
my data set is data.frame(id, yr, y, l, e, k).
I would like to estimate Lee and Schmidts (1993, OUP) model in R.
My colleague wrote SAS code as follows:
** procedures for creating dummy variables are omitted **
** di# and dt# are dummy variables for industry and time **
data a2; merge a1 a2 a; by id yr;
proc sysnlin maxit=100 outest=beta2;
endogenous y;
exogenous l e k
2018 Jan 07
1
foverlaps data.table error
Hello All
Have 2 tables
dt1:
start end kwh10min
2013-04-01 00:00:54 UTC 2013-04-01 01:00:10 UTC 0.05
2013-04-01 00:40:26 UTC 2013-04-01 00:50:00 UTC 0.1
2013-04-01 02:13:20 UTC 2013-04-01 04:53:42 UTC 0.15
2013-04-02 02:22:00 UTC 2013-04-01 04:33:12 UTC 0.2
2013-04-01 02:26:23 UTC 2013-04-01 04:05:12 UTC 0.25
2013-04-01 02:42:47 UTC 2013-04-01 04:34:33 UTC 0.3
2013-04-01 02:53:12 UTC 2013-04-03
2010 Mar 03
1
empirical copula code
Hi all,
I have this data set:
## Empirical copula
## dt1 = ranking
## dt2 = observed uniform data associated with the ranking
Sample data,
> dt1
S_i R_i
[1,] 7.0 10.0
[2,] 232.5 440.5
[3,] 143.0 141.5
[4,] 272.5 222.0
[5,] 46.0 34.0
[6,] 527.0 483.0
[7,] 420.5 563.5
[8,] 23.5 16.5
[9,] 56.5 68.5
[10,] 341.5 382.5
> dt2
unisk1 unisk2
[1,] 0.008 0.010
2023 Jan 27
0
Resumen de R-help-es, Vol 167, Envío 10
Hola:
Muchas gracias por responder. Lo pruebo.
Saludos.
On Fri, 27 Jan 2023 01:40:48 +0100
Carlos Ortega <cof en qualityexcellence.es> wrote:
> Hola,
>
> Otra alternativa...
>
> #--------------------
> > library(data.table)
> > library(tidytable)
> > library(stringi)
> >
> > df <- data.frame( V1a =
2023 Jan 28
0
Resumen de R-help-es, Vol 167, Envío 10
Hola, Carlos:
Gracias, funciona también a la perfección y muy ingeniosa la solución.
Disculpa si no te he respondido antes, pero hasta ahora no he podido privarlo.
Gracias por la ayuda y saludos.
On Fri, 27 Jan 2023 01:40:48 +0100
Carlos Ortega <cof en qualityexcellence.es> wrote:
> Hola,
>
> Otra alternativa...
>
> #--------------------
> > library(data.table)
2008 Jun 13
0
restricted coefficient and factor for linear regression.
Hi,
my data set is data.frame(id, yr, y, l, e, k).
I would like to estimate Lee and Schmidts (1993, OUP) model in R.
My colleague wrote SAS code as follows:
** procedures for creating dummy variables are omitted **
** di# and dt# are dummy variables for industry and time **
data a2; merge a1 a2 a; by id yr;
proc sysnlin maxit=100 outest=beta2;
endogenous y;
exogenous l e k
2009 May 01
0
[ wxruby-Bugs-25749 ] DateTimePicker#get_range badly swiged - General DateTime support
Bugs item #25749, was opened at 01/05/2009 21:46
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=218&aid=25749&group_id=35
Category: Incorrect behavior
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Pascal Hurni (phi)
Assigned to: Nobody (None)
Summary: DateTimePicker#get_range badly swiged - General DateTime support
Initial Comment:
2018 Oct 16
2
Comprobar los nombres de columnas entre varios dataframes
Buenas tardes,
Quiero aplicar la función rbind y necesito tener los mismos nombres de
columnas. Como tengo unas 195 variables en cada dataframe, necesito
hacerlo de una forma rápida. Tengo 9 bases de datos y tengo que fusionar
todas. ¿Como puedo comprobar que los nombres de las variables son los
mismos? Y de lo contrario, ¿como detecto las diferencias?
He probado con
2023 Nov 03
2
Sum data according to date in sequence
Hi,
I tried this:
# extract date from the time stamp
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
head(dt1)
colnames(dt1) <- c("date", "EnergykWh")
and
my dt1 becomes these, the dates are replace by numbers.
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
dput(head(dt1))
colnames(dt1) <-
2007 Jun 06
1
fixed effects anova in lme lmer
Can lme or lmer fit a plain regular fixed effects anova? Ie a model without a
random effect, or have there be at least one random effect in order for these
functions to work?
Trying to run such, (1) without specifying a random effect produces an error,
(2) specifying that there is no random effect does not produce the same output
as an anova run in lm(); (2b) specifying that there is no
2023 Nov 02
4
Sum data according to date in sequence
Dear all,
I have this set of data. I would like to sum the EnergykWh according date
sequences.
> head(dt1,20) StationName date time EnergykWh
1 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 12:09 4.680496
2 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 19:50 6.272414
3 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 20:22 1.032782
4 PALO ALTO CA / CAMBRIDGE #1 1/15/2016 8:25 11.004884
5
2023 Nov 03
1
Sum data according to date in sequence
Is this what you are after?
library(tidyverse)
library(lubridate)
input <- structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE
2011 May 10
1
Saving multiple 3x3 TIFF graphics inside a loop
Dear Friends,
I have been trying to save multiple 3x3 (mfrow=c(3,3) graphics inside a loop
using tiff figure format (not using PDF or savePlot functions) with no
success. Could you please help?
Here is a simplified example code:
dat=data.frame (ID=rep(1:10,each=10),IDV=rep(seq(1:10),times=10))
dat$DV <- with(dat, 50+15*IDV)
dat=dat[order(dat$ID,dat$IDV),]
for(i in 1:10){
dt1 =
2008 May 08
2
Microseconds for a zoo object?
Hello
I have a string which contains microseconds, can anyone help on
constructing this in to a time object, with the microseconds, that I can
take to a ZOO file?
Thanks
Sean
> UK[1,3]
[1] "17:09:53.824"
> UK[1,1]
[1] "2007-12-11 00:00:00"
> mydates <- paste( substr(UK[,1], 1, 10), UK[,3])
> mydates[1]
[1] "2007-12-11 17:09:53.824"
>