search for: setdt

Displaying 8 results from an estimated 8 matches for "setdt".

2018 May 01
4
Merging dataframes
...Sorry - this may be trivial, but I am struggling here for this. For two dataframes (A and B), I wish to identify (based on a primary key-column present in both A & B) - 1. Which records (rows) of A did not match with B, and 2. Which records of B did not match with A ? I came across a setdt function while browsing, but when I tried it, it says - Could not find function "setdt". Overall, if there is any way of doing it (preferably in some simplified way), please advise. Many thanks in advance. regards, Tito [[alternative HTML version deleted]]
2018 May 01
0
Merging dataframes
...> > For two dataframes (A and B), I wish to identify (based on a primary > key-column present in both A & B) - > > 1. Which records (rows) of A did not match with B, and > > > > 2. Which records of B did not match with A ? > > > > I came across a setdt function while browsing, but when I tried it, it says > - Could not find function "setdt". > > > > Overall, if there is any way of doing it (preferably in some simplified > way), please advise. > > > Many thanks in advance. > > > regards, > &...
2018 May 02
2
Merging dataframes
...d B), I wish to identify (based on a primary >> key-column present in both A & B) - >> >> 1. Which records (rows) of A did not match with B, and >> >> >> >> 2. Which records of B did not match with A ? >> >> >> >> I came across a setdt function while browsing, but when I tried it, it >> says >> - Could not find function "setdt". >> >> >> >> Overall, if there is any way of doing it (preferably in some simplified >> way), please advise. >> >> >> Many thanks in ad...
2018 Jun 25
2
Transformar muchas variables factor en variables binarias de acuerdo a niveles
...stackoverflow.com/questions/33990760/converting-factors-to-binary-in-r df <-data.frame(a = c(1,2,3), b = c(1,1,2), c = c("Rose","Pink","Red"), d = c(2,3,4)) cbind(df[1:2], sapply(levels(df$c), function(x) as.integer(x == df$c)), df[4]) o así library(data.table) setDT(df)[, c(levels(df$c), "c") := c(lapply(levels(c), function(x) as.integer(x == c)), .(NULL))] Pero no me resuelve el tener que hacerlo algunos cientos de veces, que es lo que querría evitar. Sé que es evidente cómo se tiene que hacer, pero soy ciego a esa evidencia :-( Muchas gracia...
2018 May 02
0
Merging dataframes
...>>> key-column present in both A & B) - >>> >>> 1. Which records (rows) of A did not match with B, and >>> >>> >>> >>> 2. Which records of B did not match with A ? >>> >>> >>> >>> I came across a setdt function while browsing, but when I tried it, it >>> says >>> - Could not find function "setdt". >>> >>> >>> >>> Overall, if there is any way of doing it (preferably in some simplified >>> way), please advise. >>> &gt...
2018 Jun 25
2
Transformar muchas variables factor en variables binarias de acuerdo a niveles
...rame(a = c(1,2,3), b = c(1,1,2), c = > > c("Rose","Pink","Red"), d = c(2,3,4)) > > > > cbind(df[1:2], sapply(levels(df$c), function(x) as.integer(x == df$c)), > > df[4]) > > > > o así > > > > library(data.table) > > setDT(df)[, c(levels(df$c), "c") := > > c(lapply(levels(c), function(x) as.integer(x == c)), .(NULL))] > > > > > > Pero no me resuelve el tener que hacerlo algunos cientos de veces, que es > > lo que querría evitar. Sé que es evidente cómo se tiene que hacer, p...
2018 May 02
0
Merging dataframes
...am struggling here for this. >> For two dataframes (A and B), I wish to identify (based on a primary >> key-column present in both A & B) - >> 1. Which records (rows) of A did not match with B, and >> 2. Which records of B did not match with A ? >> I came across a setdt function while browsing, but when I tried it, it says >> - Could not find function "setdt". >> Overall, if there is any way of doing it (preferably in some simplified >> way), please advise. >> Many thanks in advance. >> regards, >> Tito >> [...
2018 Jun 25
2
Transformar muchas variables factor en variables binarias de acuerdo a niveles
...; > c("Rose","Pink","Red"), d = c(2,3,4)) > > > > > > cbind(df[1:2], sapply(levels(df$c), function(x) as.integer(x == df$c)), > > > df[4]) > > > > > > o as? > > > > > > library(data.table) > > > setDT(df)[, c(levels(df$c), "c") := > > > c(lapply(levels(c), function(x) as.integer(x == c)), .(NULL))] > > > > > > > > > Pero no me resuelve el tener que hacerlo algunos cientos de veces, que > es > > > lo que querr?a evitar. S? que es evide...