Displaying 20 results from an estimated 200 matches similar to: "convert Factor as numeric"
2010 Apr 16
1
data frame manipulation
Dear group,
Here is my data.frame :
df <-
structure(list(DESCRIPTION = c("PRM HGH GD ALU", "PRM HGH GD ALU",
"PRIMARY NICKEL", "PRIMARY NICKEL", "PRIMARY NICKEL", "PRIMARY NICKEL",
"STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ",
"STANDARD LEAD ",
2010 Apr 15
1
sum rows in a data.frame...solution
Found this solution. It is maybe not the most elegant way, but it does the
job.
> a=as.data.frame(substr(lme$DESCRIPTION,1,14))
> colnames(a)=c("DESCRIPTION")
> lme=as.data.frame(c(a,lme[,2:3]))
> lme
DESCRIPTION CLOSING.PRICE POSITION
1 PRIMARY NICKEL 25,755.7100 0
2 PRIMARY NICKEL 25,760.8600 0
3 PRM HGH GD ALU 2,415.9000 0
2010 Apr 30
1
read.csv and blank character in object name of my data.frame
Dear group,
Here is my data frame:
position100415 <-
structure(list(DESCRIPTION = structure(1:9, .Label = c(" SUGAR NO.11 Jul/10
",
" SUGAR NO.11 May/10 ", "CORN May/10 ", "COTTON NO.2 Jul/10 ",
"CRUDE OIL miNY May/10 ", "ROBUSTA COFFEE (10) Jul/10 ", "SILVER May/10 ",
"SOYBEANS Jul/10 ", "WHEAT May/10
2010 Apr 23
2
read.csv data frame thousands separator
Dear group,
Here is my df, trades1 :
trades1 <-
structure(list(Instrument.Long.Name = c("CORN", "CORN", "CORN",
"CORN", "CORN", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS",
"SOYBEANS", "SOYBEANS", "STANDARD LEAD USD", "STANDARD LEAD USD",
"SPCL
2010 Apr 28
1
gsub,regex and replacing
Dear group,
I need to modify some characters in a data frame. I want to use gsub and the
regex functionalities to do this.
Here is the data frame (df):
DESCRIPTION prix quantity
1 CORN Jul/10 -1.5 0
2 CORN May/10 -1082.0 -3
3 ROBUSTA COFFEE (10) Jul/10 11084.0 8
4 SOYBEANS Jul/10 1983.5
2010 May 11
1
merge two data frames
Dear group,
I have these 2 following data frame:
allcon <-
structure(list(DESCRIPTION = structure(1:17, .Label = c("COFFEE C Jul/10",
"COPPER May/10", "CORN Jul/10", "CORN May/10", "COTTON NO.2 Jul/10",
"CRUDE OIL miNY May/10", "GOLD Jun/10", "HENRY HUB NATURAL GAS May/10",
"ROBUSTA COFFEE (10)
2010 May 11
1
merging data frame
Dear group,
I have 3 data frames I would like to merge.
Here they are:
pose16 <-
structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L,
6L, 7L, 8L, 9L, 12L), .Label = c("COPPER May/10", "COTTON NO.2 Jul/10",
"CRUDE OIL miNY May/10", "GOLD Jun/10", "ROBUSTA COFFEE (10) Jul/10",
"SOYBEANS Jul/10", "SUGAR NO.11
2010 Apr 28
3
data frame move columns
Dear group,
Here is my df:
avprix <-
structure(list(DESCRIPTION = c("CORN Jul/10", "CORN May/10",
"ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SPCL HIGH GRADE ZINC USD",
"STANDARD LEAD USD"), prix = c(-1.5, -1082, 11084, 1983.5, -2464,
-118), quantity = c(0, -3, 8, 2, -1, 0), fees = c(-8.64, -30.24,
-26.4, -25.92, -37.5,
2010 Apr 15
4
Does "sink" stand for anything?
Hello Everyone,
Learning about R and its wonderful array of functions. If it's not obvious, I usually try to find out what a function stands for. I think this helps me remember better.
One function that has me stumped is "sink." Can anyone tell me if this stands for something?
Thanks,
Paul
__________________________________________________
[[alternative HTML
2010 May 26
5
(no subject)
Dear group,
Here is my data frame:
> dput(u)
structure(list(DESCRIPTION = structure(c(2L, 5L, 6L, 7L, 9L,
11L, 12L, 15L, 14L, 16L, 1L, 10L, 3L, 4L, 13L, 8L, 17L), .Label = c("COFFEE
C Jul/10",
"COPPER May/10", "CORN Jul/10", "CORN May/10", "COTTON NO.2 Jul/10",
"CRUDE OIL miNY May/10", "GOLD Jun/10", "HENRY HUB
2010 May 11
2
Regex and gsub
Dear group,
Here is my df :
df3 <-
structure(list(DESCRIPTION = c("COPPER May/10", "COTTON NO.2 Jul/10",
"CRUDE OIL miNY May/10", "GOLD Jun/10", "ROBUSTA COFFEE (10) Jul/10",
"SOYBEANS Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 May/10",
"WHEAT Jul/10", "SPCL HIGH GRADE ZINC USD",
2010 May 12
1
data frame subscription
Dear group,
Here is my df :
pose16 <-
structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L,
6L, 7L, 8L, 9L, 12L), .Label = c("COPPER May/10", "COTTON NO.2 Jul/10",
"CRUDE OIL miNY May/10", "GOLD Jun/10", "ROBUSTA COFFEE (10) Jul/10",
"SOYBEANS Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 May/10",
2010 Aug 04
3
merge two data frames
Dear list,
here are my two data frames:
av <-
structure(list(DESCRIPTION = c("COFFEE C Sep/10", "COPPER Sep/10",
"CORN Dec/10", "CRUDE OIL miNY Sep/10", "GOLD Aug/10", "HENRY HUB
NATURAL GAS Sep/10",
"PALLADIUM Sep/10", "SILVER Sep/10", "SOYBEANS Nov/10", "SPCL HIGH
GRADE ZINC USD",
"SUGAR
2010 May 20
6
writing function
Dear group,
I am trying to write functions, but as a beginner, everything is not so
obvious.
Let's say I want the results in a list of elemts like this :
tot1, tot2, etc
Here is a function:
toto <-
function(x,y)
{
for(i in x:y){
paste(c("tot",i),collapse="")<-(i*2)
}
}
If I type this :
>toto(1,5)
I get this message error:
Error in paste(c("tot",
2018 Feb 06
3
CRON JOBS
Buenas,
Voy a dejar un programa en produccion en un servidor, el cual tiene que ejecutarse cada minuto, y si se reinicia el servidor o lo uqe sea, que se ponga a trabajar directamete.
?R server permite hacer eso, o tengo que generar un script que se ejecute desde un cronjob del servidor?
Desde mi ignorancia, considero que la segunda opcion es la m?s robusta frente a fallos.
Un saludo
Jes?s
2015 Nov 08
2
desviacion estandard
Hola, ¿qué tal?
Lo que te pasa no es tan raro:
set.seed(1234)
muestra <- abs(rnorm(100))
sd(muestra)
#[1] 0.5811866
muestra.ceros <- c(muestra, rep(0, 100000))
sd(muestra.ceros)
#[1] 0.03196273
En una muestra de números positivos, añadir un cero (sobre todo si
está lejos de la media) sube la varianza. Si añado otro, posiblemente
también. Pero cuando añado muchísimos ceros, la varianza
2016 Oct 24
2
Quitar datos atípicos de una recta
Ok, lo pruebo y os digo...
Jesús
________________________________
De: Isidro Hidalgo Arellano <ihidalgo en jccm.es>
Enviado: lunes, 24 de octubre de 2016 9:46
Para: 'Jesús Para Fernández'; r-help-es en r-project.org
Asunto: RE: [R-es] Quitar datos atípicos de una recta
Hay un paquete que lo hace, pero no lo he utilizado, así que no sé cómo se porta: "outliers"...
Un
2016 Sep 13
2
t-test y distribución de variables
Hola,
Estoy analizando unos datos para una tesis doctoral.
Durante la investigación se han recogido distintas variables clínicas de
dos grupos (n=30 y n=40). Me encuentro que las comparaciones de medias
se han realizado mediante t-tests sin preocuparse de estudiar la
distribución de las variables. Al revisar si las variables se ajustan a
la distribución normal, aunque los QQplots no tienen
2005 May 17
0
Building openssh4.0p1 on AIX 5.3 with openssl 0.9.7g and tcp_wrapper
Hi all,
Would appreciate if you can help me resolve this issue. I'm getting
following error on running configure: The library libcrypto.a is under
"/opt/freeware/lib" and is the only instance of libcrypto.a. And I'm using
IBM AIX C compiler 6.0.
configure: error: *** Can't find recent OpenSSL libcrypto (see config.log
for details) ***
CONFIGURE
$ ./configure
2016 May 17
2
buscar y reemplazar tabs dentro de un archivo
Estimado Eric
Las filas que faltan, ¿son filas enteras, donde todo es valor NA o ?? en un data.frame?
Porque si es así podrías importar todo y luego buscar (filtrar) los que no son NA.
Copio y pego un código que utilizo en un trabajo, posiblemente le sea útil.
Tratamientos$Tratamiento[Tratamientos$Tratamiento == ""] <- NA # asignar NA a las celdas vacías
Tratamientos<-