similar to: selecting columns from a data frame or data table by type, ie, numeric, integer

Displaying 20 results from an estimated 2000 matches similar to: "selecting columns from a data frame or data table by type, ie, numeric, integer"

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
2013 Aug 16
1
as.Date.character speed improvement suggestion
R-Devel, I store and retrieve a large amount of financial data (millions of rows) in a PostgreSQL database keyed by date (and represented in R by class Date). Unfortunately, I frequently find that a great deal of processing time is spent converting dates from character representations to Date class representations in R, presumably because strptime is not fast for large vectors (>10,000
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
2016 Apr 30
1
selection columns by type, ie, numeric
My? thanks to Bill Dunlap and??Giorgio Garziano for? their help.?? It is greatly appreciated.? I works so well, wow. Carl Sutton CPA [[alternative HTML version deleted]]
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
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
Hi, I was able to replicate the solution as suggested by William in case of data.frame class, not in case of data.table class. In case of data.table, I had to do some minor changes as shown below. library(data.table) a <- 1:10 b <- c("a","b","c","d","e","f","g","h","i","j") c <- seq(1.1,
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 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) <-
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" >