Estimado Jesús Para Fernández Siempre se puede, pero, quien recibe define en que forma debe pasar los datos, por lo cual si usted escribe la función tiene esa posibilidad.
Javier Rubén Marcuzzi El 29 de marzo de 2018, 6:48, Jesús Para Fernández < [email protected]> escribió: > Si , eso lo se , pero.. Y si quisiera pasar el string?? > > Obtener Outlook para Android<https://aka.ms/ghei36> > > ________________________________ > From: Carlos Ortega <[email protected]> > Sent: Thursday, March 29, 2018 11:34:06 AM > To: Jesús Para Fernández > Cc: [email protected] > Subject: Re: [R-es] Pasar argunmentos string a una formula > > Hola, > > Pero... > > En vez de pasar el string, puedes pasar solamente el valor... > > n_tree <- c(200, 300, 400) > > for(i in n_tree) { > > randomForest(Species ~ ., data=iris, maxnodes=4, ntree=i)) > > } > > Saludos, > Carlos Ortega > www.qualityexcellence.es<https://nam02.safelinks.protection. > outlook.com/?url=http%3A%2F%2Fwww.qualityexcellence.es&data=02%7C01%7C% > 7C0183e6d6d10644a4ef3308d5955837fa%7C84df9e7fe9f640afb435aaaaaaaa > aaaa%7C1%7C0%7C636579128477537399&sdata=40JOb%2FPI9v1HZ6p3ssC%2BaPAJ% > 2B2NXnJ1PnomkbA%2F7BHc%3D&reserved=0> > > El 29 de marzo de 2018, 10:52, Jesús Para Fernández < > [email protected]<mailto:[email protected]>> > escribió: > Buenas > > Tengo en un string guardado lo siguiente: > > > parametros > [1] "ntree=10" "ntree=30" "ntree=50" "ntree=100" "ntree=200" > > > Con un bucle for quiero ir metiendolo en el modelo, pero no se muy bien > como hacerlo, ya que con deparse no me funciona, con get tampoco (obvio, no > es un objeto), y no se muy bien como hacerlo de manera dinamica > > for(i in seq_along(parametros)){ > modelo <- randomForest(Class~.,datos,parametros[i]) > } > > > Es importante que me coja la cadena entera y no solo cambiar el numero de > arboles, pe"ntree=10", ya que si cambio a un svm, ... quiero tb meter los > parametros por cadena, desde una funcion. > > Gracias!! > Jesús > > [[alternative HTML version deleted]] > > > _______________________________________________ > R-help-es mailing list > [email protected]<mailto:[email protected]> > https://stat.ethz.ch/mailman/listinfo/r-help-es<https:// > nam02.safelinks.protection.outlook.com/?url=https%3A%2F% > 2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-help-es&data=02%7C01%7C% > 7C0183e6d6d10644a4ef3308d5955837fa%7C84df9e7fe9f640afb435aaaaaaaa > aaaa%7C1%7C0%7C636579128477537399&sdata=3GVabXJIQ8v7e7FXRzzHGjXeGI9UFz > i68uAkamEk2vk%3D&reserved=0> > > > > > -- > Saludos, > Carlos Ortega > www.qualityexcellence.es<https://nam02.safelinks.protection. > outlook.com/?url=http%3A%2F%2Fwww.qualityexcellence.es&data=02%7C01%7C% > 7C0183e6d6d10644a4ef3308d5955837fa%7C84df9e7fe9f640afb435aaaaaaaa > aaaa%7C1%7C0%7C636579128477537399&sdata=40JOb%2FPI9v1HZ6p3ssC%2BaPAJ% > 2B2NXnJ1PnomkbA%2F7BHc%3D&reserved=0> > > [[alternative HTML version deleted]] > > > _______________________________________________ > R-help-es mailing list > [email protected] > https://stat.ethz.ch/mailman/listinfo/r-help-es > > [[alternative HTML version deleted]] _______________________________________________ R-help-es mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-help-es
