similar to: recursive lapply and keeping track of data

Displaying 20 results from an estimated 10000 matches similar to: "recursive lapply and keeping track of data"

2017 Aug 14
0
recursive lapply and keeping track of data
You could replace your 'depth' argument with one that shows where in the original data you are at: leaf.func <- function(data, where) { if(is.null(data)) stop("Null data at ", deparse(where)) return(mean(data)) } visit.level <- function(data, where = integer()) { if (length(where) == 2) { return(leaf.func(data, where)) } else
2017 Aug 04
4
define a list with names as variables
Hello, I'm having troubles defining a list where names are variables (of type character). Like this, which gives "foo" instead of "world" (the way I meant it is that "world" is the value of the variable foo). Any hint? > f <- function(foo, bar) { list(foo = bar) } > x <- f("hello", "world") > names(x) [1] "foo"
2017 Aug 04
0
define a list with names as variables
Hi Giovani, I would create an unnamed list and set the names after. Best, Ulrik On Fri, 4 Aug 2017 at 12:08 Giovanni Gherdovich <g.gherdovich at gmail.com> wrote: > Hello, > > I'm having troubles defining a list where names are variables (of type > character). Like this, which gives "foo" instead of "world" (the way I > meant it is that
2017 Aug 04
1
define a list with names as variables
Do you mean like this? > f <- function(foo, bar) { + result <- list(bar) + names(result) <- foo + result + } > (x <- f("hello", "world")) $hello [1] "world" > names(x) [1] "hello" -- Thomas Mailund On 4 August 2017 at 12.08.28, Giovanni Gherdovich (g.gherdovich at gmail.com) wrote: Hello, I'm having troubles defining
2017 Aug 04
2
define a list with names as variables
You can wrap the list-creating function call (e.g. lapply) in a call to ?setNames, or you can use the ?map function from the purrr package. -- Sent from my phone. Please excuse my brevity. On August 4, 2017 3:14:44 AM PDT, Ulrik Stervbo <ulrik.stervbo at gmail.com> wrote: >Hi Giovani, > >I would create an unnamed list and set the names after. > >Best, >Ulrik > >On
2017 Aug 04
0
define a list with names as variables
Hello Thomas, Ulrik, thanks for your suggestions. Giovanni On Fri, Aug 4, 2017 at 12:13 PM, Thomas Mailund <thomas.mailund at gmail.com> wrote: > Do you mean like this? > > >> f <- function(foo, bar) { > + result <- list(bar) > + names(result) <- foo > + result > + } > >> (x <- f("hello", "world")) > $hello >
2006 Nov 16
1
How Aggegate Data in R
Hello: When I use SPSS I execute the AGGREGATE DATA comand for the next data: 2112141123212213212213334 3143244113442312121213344 2114141123112214212113344 2112211122212413421213221 3114444123442414343413344 2312231223212222323223322 2143241123212313131213234 2113241113212313222213333 2113141123112214212113344 2114141123412111114413344 2113211122342314222313234 2114141123112414212113344
2006 Dec 01
4
simple parallel computing on single multicore machine
Dear List, the advent of multicore machines in the consumer segment makes me wonder whether it would, at least in principle, be possible to divide a computational task into more slave R processes running on the different cores of the same processor, more or less in the way package SNOW would do on a cluster. I am thinking of simple 'embarassingly parallel' problems, just like inverting
2005 Oct 26
1
help with a self-starting function in nonlinear least squares regression.
Hello. I am having a problem setting up a self-starting function for use in nonlinear regression (and eventually in the mixed model version). The function is a non-rectangular hyperbola - called "NRhyperbola" - which is used for fitting leaf photosynthetic rate to light intensity. It has one independent variable (Irr) and four parameters (theta, Am, alpha and Rd). I have created this
2018 Mar 15
2
Meetup conjunto "Machine Learning Spain" + "Grupo Usuarios de R de Madrid"....
Buenas a todos, Ayer realizamos un Meetup conjunto con el grupo de "Machine Learning Spain". Parte del material ya está subido a nuestro portal. http://madrid.r-es.org/50-miercoles-14-de-marzo-2018/ Estamos a la espera de que nos compartan los videos. Por si queréis ir viendo la parte de Santiago, mi parte es la misma que la que presenté en la reunión del Grupo hace unas semanas.
2017 Aug 04
0
define a list with names as variables
> f <- function(foo,bar) structure(list(bar),names =foo) > f("hello","world") $hello [1] "world" Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Aug 4, 2017 at 6:12 AM, Jeff
2019 May 06
2
Question about GIT repository
Hello, just a question, I can't see a core "release-2.3.6" branch, nor a pigeonhole "release-0.5.6" branch on the GIT repository, it is outdated? or do you have changed your policy to create a new branch for each new release of dovecot and pigeonhole? Thanks and regards -- +-------------------------------------------------------------------+ | Juan C. Blanco
2018 May 31
2
predicciones sobre el OOB de randomForest
Gracias Carlos. No uso caret, pero lo miraré. Quoting Carlos Ortega <cof en qualityexcellence.es>: > Hola, > > Creo que si utilizas "caret" y en la función "trainControl()" defines "oob" > como criterio de randomización, puedes luego recuperar del objeto del > modelo, las predicciones individuales... > > Saludos, > Carlos Ortega >
2005 Dec 16
3
Help with data.frame and lapply
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello: I'm having problems with this line of code: X.lm <- lapply(names(d), function(x) lm(d["cls"] ~ d[x], data=d)) d[x] is what is giving trouble here, but I don't know exactly how to solve it. What I'm trying to do is to create a linear model from each column of the data frame 'd' to apply ANOVA later. Thanks
2019 May 06
2
Question about GIT repository
OK, thanks!! Juan C. Blanco On 06/05/2019 10:25, Aki Tuomi wrote: > Hi , > > sorry they were accidentically not pushed. Will do so soon. > > Aki >> On 6 May 2019 11:11 Juan C. Blanco via dovecot < dovecot at dovecot.org >> <mailto:dovecot at dovecot.org>> wrote: >> >> >> Hello, just a question, I can't see a core
2019 Feb 18
3
crear un vector con las categorías
Gracias Jorge. No entiendo bien; la variable objetivo es ya factor. El árbol me la predice bien, como factor, también. Es al ir construyendo el vector que lo anota con un nº, según de cuál de las 4 categorías se trate. Quoting Jorge I Velez <jorgeivanvelez en gmail.com>: > Estimado Manuel, > > Debes definir ecsta como factor usando, por ejemplo, > > factor(ecsta,
2019 Feb 19
2
crear un vector con las categorías
Bueno, creo que no contesté tu pregunta. Con training <- data[-i, ] crea una df llamada training, sin la muestra i, que después utiliza para entrenar el algoritmo. Quoting Javier Marcuzzi <javier.ruben.marcuzzi en gmail.com>: > Estimado Manuel Mendoza > > Con sus datos y a modo de curiosidad, ¿que pasa en training <- data[-i, ]? > > Javier Rubén Marcuzzi >
2018 Apr 14
2
Encontrar el más votado
Gracias Carlos J., sale bien, pero me transforma las 6 categorías en números del 1 al 6 ¿sabes cómo evitarlo? Quoting "Carlos J. Gil Bellosta" <cgb en datanalytics.com>: > apply(data, 1, function(x) which.max(table(x))) > > El sáb., 14 abr. 2018 a las 19:54, Manuel Mendoza (<mmendoza en mncn.csic.es>) > escribió: > >> >> Buenas tardes de
2007 Mar 16
3
corAR1 in a random effects panel
Hi everyone, I am interested in estimating this type of random effects panel: y_it = x'_it * beta + u_it + e_it u_it = rho * u_it-1 + d_it rho belongs to (-1, 1) where: u and e are independent and normally zero-mean distributed. d is also independently normally zero-mean distributed. So, I want random effects for group i to be correlated in t, following an AR(1) process. I am
2018 Feb 19
3
gbm.step para clasificación no binaria
Hola de nuevo. Se me olvidaba la principal razón para utilizar gbm.step del paquete dismo. Como sabéis, los boosted si sobreajustan (a diferencia de los random forest o cualquier otro bootstrap) pero gbm.step hace validación cruzada para determinar el nº óptimo de árboles y evitarlo. Es fundamental. La opción que me queda, Carlos, es hacerlo con gbm, pero muchas veces, y usar el