Re: [R] Names of variables needed in newdata for predict.glm

2018-03-08 Thread Marc Schwartz
Hi Bendix, If the 'model' argument to glm() is TRUE (the default), you can get the structure of the model frame that was used to fit the model, by using: > str(mx$data) 'data.frame': 200 obs. of 4 variables: $ D: int 0 1 0 1 1 0 1 1 1 1 ... $ x: num 0.705 2.15 0.572 1.249 0.807 ... $ f:

Re: [R] add single points to a level plot

2018-03-08 Thread lily li
Hi all, I ran the code: > s <- stack(replicate(2, raster(matrix(runif(100), 10 > xy <- data.frame(coordinates(sampleRandom(s, 10, sp=TRUE)), + z1=runif(10), z2=runif(10)) > levelplot(s, margin=FALSE, at=seq(0, 1, 0.05)) + + layer(sp.points(xy, pch=ifelse(pts$z1 < 0.5, 2,

Re: [R] add single points to a level plot

2018-03-08 Thread lily li
Thanks. Now it can run and generate plots, but there are the two lines on each of the plots. I don't know the problem for this? Error using packet 1 any(sp) is not TRUE On Thu, Mar 8, 2018 at 8:48 AM, Eric Berger wrote: > You need to load the package 'rasterVis' > > >

Re: [R] add single points to a level plot

2018-03-08 Thread Jeff Newmiller
library(sos) findFn( "layer" ) findFn( "levelplot" ) Also, experts in spatial analysis tend to answer questions on the special mailing list where the Posting Guide says they should. Read it to find out where that is. -- Sent from my phone. Please excuse my brevity. On March 8, 2018 7:11:34

Re: [R] add single points to a level plot

2018-03-08 Thread Eric Berger
You need to load the package 'rasterVis' > library(rasterVis) HTH, Eric On Thu, Mar 8, 2018 at 5:11 PM, lily li wrote: > Hi all, > > I ran the code: > > s <- stack(replicate(2, raster(matrix(runif(100), 10 > > xy <- data.frame(coordinates(sampleRandom(s, 10,

Re: [R-es] exportar resultados a CSV

2018-03-08 Thread Xavier-Andoni Tibau Alberdi
Si usas R studio puedes pulsar sobre la variable, en el explorador de variables en la parte derecha superior. Des de allí podras mirarlo bien, sin necessidad de exportarlo a csv solo para explorarlo. Analogamente a pulsar encima, puedes usar la función View(), que te dará el mismo resultado. Un

Re: [R-es] Correlacionar una variable con muchas a la vez

2018-03-08 Thread Yesica Pallavicini Fernandez
Hola, Estoy intentando correlacionar una sola variable con 52 mas ¿Sabéis cómo se puede automatizar la función? Gracias Yésica Ya lo he sacado cor(data)[,1] Con esta función se correlaciona la primer variable con todas las demás del arreglo de datos. ¿Cómo me puedo contestar a mi misma para

[R-es] ver los resutados cuando son muy extensos y normalmente se cortan

2018-03-08 Thread Yesica Pallavicini Fernandez
Gracias Carlos y Xavy Efectivamente, cuando la salida del resultado es muy grande y por defecto se cortan y no los puedes ver, se puede usar el comando options(max.print=9) Saludos [[alternative HTML version deleted]] ___ R-help-es

Re: [R-es] exportar resultados a CSV

2018-03-08 Thread Carlos Ortega
Hola, - Puedes exportar cualquier variable a csv con la función "write()" que tiene múltiples parámetros para determinar el formato de salida, separador, etc. - Y sobre la primera pregunta, si R no te muestra todos los resultados es porque hay un límite de resultados que se pueden

Re: [R-es] Más filtrado de variables

2018-03-08 Thread jose luis via R-help-es
Bueno, finalmente lo resolví así. Creé una nueva variable ORDEN2 con un ifelse que me señalase los duplicados de clase y luego selecciono los de menor ORDEN. Pierdo algunos registros de  GRUPO porque solo tienen duplicados, pero esto estaba dentro de lo previsto.Gracias por la ayuda! Datos%>%

Re: [R-es] Imputar NA a SQL Server

2018-03-08 Thread Javier Marcuzzi
Estimado Jesús Para Fernández Pruebe lo siguiente: str_replace_all(values, "'NA'", "NULL") El 8 de marzo de 2018, 17:38, Jesús Para Fernández < j.para.fernan...@hotmail.com> escribió: > Buenas, > > Quiero meter NULL en algunos valores al hacer un insert en una base ded > datos SQL Server,

Re: [R-es] ver los resutados cuando son muy extensos y normalmente se cortan

2018-03-08 Thread Carlos Ortega
Mejor que volcarlos a la consola... utiliza este paquete para visualizar las relaciones.. https://cloud.r-project.org/web/packages/corrr/index.html Saludos, Carlos Ortega www.qualityexcellence.es El 8 de marzo de 2018, 10:22, Yesica Pallavicini Fernandez < yesipa...@gmail.com> escribió: >

Re: [R-es] ver los resutados cuando son muy extensos y normalmente se cortan

2018-03-08 Thread Javier Marcuzzi
Estimada Yesica Pallavicini Fernandez Como ya le escribieron, es un problema relacionado a cuánto se imprime en pantalla, en mi caso personal cuándo hay muchos datos me resulta simple tenerlos en una base de datos, aunque hay otras alternativas más modernas, la que yo aprendí hace mucho tiempo es

Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Ross Boylan
On Thu, Mar 08, 2018 at 03:29:14PM +, Sparapani, Rodney wrote: > Hi Ross: > I agree with Rich and Vitalie. This just works out of the box: no .emacs > fiddling. > Perhaps, you are tripping over the recent tightening of the interface. The > last bullet point > in the New features section of

Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Ross Boylan
On Wed, Mar 07, 2018 at 09:55:51PM -0500, Richard M. Heiberger wrote: > My guess is that starting from outside the package misled ESS. > Try this sequence. > > library(mypackage) > ## then open the R source in directory mypackage/R/ > ## modify the R files and C-c C-c revised functions. They

Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Ross Boylan
On Thu, Mar 08, 2018 at 04:22:04PM +0100, Vitalie Spinu wrote: > > > >> On Wed, Mar 07 2018 18:29, Ross Boylan wrote: > > > The file I opened initially, the one that sources all the others, is above > > the > > package directory. It sources files under the package directory. When I > >

Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Boylan, Ross
I just wanted to evaluate some of the R code in the .Rnw file in my main R process, at global scope. But ESS seemed to think C-c C-r meant to do something else (in that file), like sweaving, instead. It may have tried just to do that on the highlighted region; I didn't investigate except to

Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Vitalie Spinu
>> Just start R inside package directory and start eval-ing stuff as you >> normally do. > Do you mean that R must be launched from inside the package directory? I was imprecise. No, R process could be run from anywhere. It's that ess-r-package-mode is active only within the package directory.

Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Vitalie Spinu
>> On Wed, Mar 07 2018 18:29, Ross Boylan wrote: > The file I opened initially, the one that sources all the others, is above the > package directory. It sources files under the package directory. When I > modified one of them I used C-c C-t C-s to disable the namespace before I did > C-c

Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Sparapani, Rodney
Hi Ross: I agree with Rich and Vitalie. This just works out of the box: no .emacs fiddling. Perhaps, you are tripping over the recent tightening of the interface. The last bullet point in the New features section of 17.11 states… * ESS[R] Namespaced evaluation is now automatically enabled