[R] rZeppelin: Easy Spark for R Data Scientists

2016-01-04 Thread Amos B. Elberg
rZeppelin is an R Interpreter for the Apache (Incubating) Zeppelin project.  

The intention of rZeppelin is to make it possible for regular R-using 
non-programmer to integrate the power of Spark, and the wide range of ML 
packages available for Python and scala, into their day-to-day toolbox — 
without having to learn a new language, without any learning curve beyond a 
review of the SparkR API, and without the budget needs or administrative 
overhead of setting up a Spark or hadoop infrastructure.  

Zeppelin is a notebook (like iPython) built on top of Spark.  Zeppelin provides 
interactive data visualization and other features, and interpreters for a wide 
variety of “big data” stores. 

rZeppelin makes it possible to combine R, scala, and Python code in a single 
data/ML pipeline, seamlessly, from a single, familiar, interface.  (And without 
breaking lazy evaluation!)

This means that you can use the Spark package-base of ultra-fast 
implementations of popular ML algorithms optimized for clusters, as well as 
python packages, as an extension of your existing work with R.  

For example, imagine loading text data in R, running LDA on the text using the 
distributed implementation of LDA in Spark’s MLLIB, tagging the text using 
advanced Python NLP packages such as gensim, and then visualizing and further 
processing the results in R — all from the same interface, in the same session. 

rZeppelin lets you do this because the R interpreter, along with Zeppelin’s 
scala and Python interpreters, share the same Spark backend.  

Apart from Spark, most common datatypes can be moved among R, scala, and Python 
through the “ZeppelinContext,” a shared environment.  

rZeppelin is integrated with Zeppelin’s interactive visualization features.  It 
also uses knitr for compatibility with most R data visualization and 
interactive visualization packages, such as ggplot2 and rCharts.  

rZeppelin is available here:  https://github.com/elbamos/Zeppelin-With-R  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] R package built using newer version of R

2016-01-04 Thread Duncan Murdoch

On 04/01/2016 2:02 PM, Tyler Auerbeck wrote:

We're currently looking at using the R eclipse plugin StatET as our
development environment. Due to certain requirements, we're still using
2.15.1. However a required package of StatET was built using 2.15.3, which
results in the following warning:

Warning message:
package 'rj' was built under R version 2.15.3

I'm still fairly new to R, but is there any way for us to rebuild this
package using 2.15.1? It doesn't appear to cause us any issues, but it's
still not desirable for users to see that warning.

Any help would be appreciated.


Yes, it's quite easy to do so.  StatET probably gives menu options to do 
it, but I don't know them:  you might want to ask them.  From the R 
console, try


install.packages("pkgname", type="source")

and if you have the necessary prerequisites (e.g. compilers), you'll get 
it installed from source.   If it fails, post the errors and the results 
of sessionInfo() here, and we'll probably be able to tell you what to do 
next.


Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R package built using newer version of R

2016-01-04 Thread Tyler Auerbeck
We're currently looking at using the R eclipse plugin StatET as our
development environment. Due to certain requirements, we're still using
2.15.1. However a required package of StatET was built using 2.15.3, which
results in the following warning:

Warning message:
package 'rj' was built under R version 2.15.3

I'm still fairly new to R, but is there any way for us to rebuild this
package using 2.15.1? It doesn't appear to cause us any issues, but it's
still not desirable for users to see that warning.

Any help would be appreciated.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R-es] Tildes en Slidify

2016-01-04 Thread Jesús Para Fernández
Buenas Pedro,

Yo lo que hago para un paquete que estoy haciendo es usar el c�digo UTF-16, el 
cual extraigo de este conversor online:
https://r12a.github.io/apps/conversion/

si por ejemplo quiero escribir la palabra estad�stica, lo hago poniendo: 
estad\uEDstica (con el \u indico que va un caracter especial y con el ED que es 
el �).

Si por ejemplo quiero escribir electr�nico pongo electr\u6Fnico,

 y as� para el resto de caracteres especiales.

Un saludo
Jes�s



> From: pedroherreropeti...@gmail.com
> Date: Wed, 30 Dec 2015 16:24:32 +0100
> To: victorgrandagar...@gmail.com
> CC: r-help-es@r-project.org
> Subject: Re: [R-es] Tildes en Slidify
> 
> Muchas gracias Victor.
> Despu�s de mandar este mail encontr� el hilo sobre fix-encode, sin embargo
> al instalarlo slidify deja de funcionarme y tengo que volver a instalarlo
> para poder seguir ejecut�ndolo.
> Ya he planteado la pregunta en github aprovechando un hilo que hab�a
> abierto otro usuario pero que no daba ninguna informaci�n sobre sesi�n ni
> nada (https://github.com/ramnathv/slidify/issues/469).
> 
> Estoy intentando encontrar otro paquete con funcionalidades similares a
> slidify (vamos, que permita hacer presentaciones que se puedan entregar
> directamente a clietne de manera m�s o menos sencilla) pero no encuentro
> nada.
> 
> Un saludo a todos
> 
> El 30 de diciembre de 2015, 16:13, V�ctor Granda Garc�a <
> victorgrandagar...@gmail.com> escribi�:
> 
> > Hola Pedro.
> >
> > Yo he usado el paquete pero no he tenido ning�n problema con las tildes
> > (me las reconoce perfectamente), quiz�s porque al estar en linux todo mi
> > sistema est� configurado en UTF-8.
> > De todas formas el paquete tiene una rama (branch) en github que se supone
> > soluciona el problema: https://github.com/ramnathv/slidify/tree/fix-encode
> > Para instalarla desde R tienes que tener el paquete devtools cargado e
> > instalar con install_github('ramnathv/slidify@fix-encode')
> > Tienes mas informaci�n en https://github.com/ramnathv/slidify/issues/417 (en
> > ese enlace el nombre de la rama est� mal escrito, es como te lo he puesto
> > arriba).
> >
> > Espero que con esto puedas solucionarlo, un saludo.
> >
> > El mi�., 30 dic. 2015 a las 15:40, Pedro Herrero Petisco (<
> > pedroherreropeti...@gmail.com>) escribi�:
> >
> >> Hola a todos.
> >>
> >> Estoy creando un documento con Slidify y me surge un problema con las
> >> letras con tildes que no me las reconoce y en su lugar pone un signo
> >> de interrogaci�n.
> >>
> >> He probado a poner R-Studio por defecto en UTF-8 y en Windows-1252 y
> >> tengo puesto como diccionario principal es espa�ol. Nada de esto ha
> >> funcionado.
> >>
> >> �Alguien ha usado este paquete y ha conseguido solucionar este problema?
> >>
> >> Muchas gracias a todos y que teng�is un magn�fico 2016 :-)
> >>
> >> [[alternative HTML version deleted]]
> >>
> >> ___
> >> R-help-es mailing list
> >> R-help-es@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-help-es
> >>
> >
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
  
[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

[R] Better scrolling feature in ggplot using Shiny???

2016-01-04 Thread Kunal Shah
Hello,

I have plotted a ggplot of large data around 3 points. I opened it in
Shiny. I want a scrolling feature so that I can just scroll the data.

I tried to write a code in Shiny where the user can select the slider
range. But "scrolling" by that is not efficient and not at all smooth

Any help is appreciated


Regards

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R-es] Tildes en Slidify

2016-01-04 Thread Pedro Herrero Petisco
Muchas gracias Jesús, para otro tipo de documentos sí que uso una técnica
parecida a la que comentas, pero por algún motivo en Slidify no me funciona
:-(

Un saludo

El 4 de enero de 2016, 10:46, Jesús Para Fernández <
j.para.fernan...@hotmail.com> escribió:

> Buenas Pedro,
>
> Yo lo que hago para un paquete que estoy haciendo es usar el código
> UTF-16, el cual extraigo de este conversor online:
> https://r12a.github.io/apps/conversion/
>
> si por ejemplo quiero escribir la palabra estadística, lo hago poniendo:
> estad\uEDstica (con el \u indico que va un caracter especial y con el ED
> que es el í).
>
> Si por ejemplo quiero escribir electrónico pongo electr\u6Fnico,
>
>  y así para el resto de caracteres especiales.
>
> Un saludo
> Jesús
>
>
>
> > From: pedroherreropeti...@gmail.com
> > Date: Wed, 30 Dec 2015 16:24:32 +0100
> > To: victorgrandagar...@gmail.com
> > CC: r-help-es@r-project.org
> > Subject: Re: [R-es] Tildes en Slidify
>
> >
> > Muchas gracias Victor.
> > Después de mandar este mail encontré el hilo sobre fix-encode, sin
> embargo
> > al instalarlo slidify deja de funcionarme y tengo que volver a instalarlo
> > para poder seguir ejecutándolo.
> > Ya he planteado la pregunta en github aprovechando un hilo que había
> > abierto otro usuario pero que no daba ninguna información sobre sesión ni
> > nada (https://github.com/ramnathv/slidify/issues/469).
> >
> > Estoy intentando encontrar otro paquete con funcionalidades similares a
> > slidify (vamos, que permita hacer presentaciones que se puedan entregar
> > directamente a clietne de manera más o menos sencilla) pero no encuentro
> > nada.
> >
> > Un saludo a todos
> >
> > El 30 de diciembre de 2015, 16:13, Víctor Granda García <
> > victorgrandagar...@gmail.com> escribió:
> >
> > > Hola Pedro.
> > >
> > > Yo he usado el paquete pero no he tenido ningún problema con las tildes
> > > (me las reconoce perfectamente), quizás porque al estar en linux todo
> mi
> > > sistema está configurado en UTF-8.
> > > De todas formas el paquete tiene una rama (branch) en github que se
> supone
> > > soluciona el problema:
> https://github.com/ramnathv/slidify/tree/fix-encode
> > > Para instalarla desde R tienes que tener el paquete devtools cargado e
> > > instalar con install_github('ramnathv/slidify@fix-encode')
> > > Tienes mas información en
> https://github.com/ramnathv/slidify/issues/417 (en
> > > ese enlace el nombre de la rama está mal escrito, es como te lo he
> puesto
> > > arriba).
> > >
> > > Espero que con esto puedas solucionarlo, un saludo.
> > >
> > > El mié., 30 dic. 2015 a las 15:40, Pedro Herrero Petisco (<
> > > pedroherreropeti...@gmail.com>) escribió:
> > >
> > >> Hola a todos.
> > >>
> > >> Estoy creando un documento con Slidify y me surge un problema con las
> > >> letras con tildes que no me las reconoce y en su lugar pone un signo
> > >> de interrogación.
> > >>
> > >> He probado a poner R-Studio por defecto en UTF-8 y en Windows-1252 y
> > >> tengo puesto como diccionario principal es español. Nada de esto ha
> > >> funcionado.
> > >>
> > >> ¿Alguien ha usado este paquete y ha conseguido solucionar este
> problema?
> > >>
> > >> Muchas gracias a todos y que tengáis un magnífico 2016 :-)
> > >>
> > >> [[alternative HTML version deleted]]
> > >>
> > >> ___
> > >> R-help-es mailing list
> > >> R-help-es@r-project.org
> > >> https://stat.ethz.ch/mailman/listinfo/r-help-es
> > >>
> > >
> >
> > [[alternative HTML version deleted]]
> >
> > ___
> > R-help-es mailing list
> > R-help-es@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-help-es
>

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] Una inquietud.

2016-01-04 Thread Carlos Ortega
Hola,

Feliz Año!.

Mira esto:

http://www.r-tutor.com/elementary-statistics/interval-estimation/interval-estimate-population-mean-unknown-variance

Saludos,
Carlos Ortega
www.qualityexcellence.es

El 2 de enero de 2016, 22:16, heber sarmiento via R-help-es <
r-help-es@r-project.org> escribió:

> Cordial Saludo a todos y un deseo por que el próximo año se
> EXCELENTE,hablando de algo nuevo, quisiera saber si alguien sabe si en R
> existe algún paqueteque me calcule intervalos de confianza para la media
> poblacional y para la diferencia de promedios, teniendo en cuenta que
> a) se conoce la varianzab) no se conoce la varianza.c) las varianzas
> pueden ser iguales pero desconocidas
> d) Las varianzas son diferentes
> Estoy en la actualidad programando un script para esto pero es muy
> tedioso, agradezco sugerencias
> UN abrazo solidarioHeber
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>



-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R] Estimating MA parameters through arima or through package "dlm"

2016-01-04 Thread Stefano Sofia
Dear list users,
I want to use apply a MA(2) process (x=beta1*epsilon_(t-1) + 
beta2*epsilon_(t-1) + epsilon_(t)) to a given time series (x), and I want to 
estimate the two parameters beta1, beta2 and the variance of the random 
variable epsilon_(t).

If I use
MA2_1 <- Arima(x, order=c(0,0,2))
I get the following result

[1] "MA2_1"
Series: x
ARIMA(0,0,2) with non-zero mean

Coefficients:
  ma1 ma2  intercept
  -0.0279  0.0783 5.3737
s.e.   0.0667  0.0622 0.0245

sigma^2 estimated as 0.1284:  log likelihood=-92.63
AIC=193.25   AICc=193.43   BIC=207.11
[1] 0 2 0 0 1 0 0

From this straightforward analysis V[epsilon]=0.1284, beta1=-0.0279 and 
beta2=0.0783.

I also tried to use a DLM representation of ARIMA models and estimate the 
unknown parameters by maximum likelihood through the dlm package (in particular 
applying the example at section 3.2.6, page 115, of "Dynamic Linear Models with 
R" by Petris, Petrone and Campagnoli:

arma_parameters <- function(x)
{
  buildGap <- function(u)
  {
gap <- dlmModARMA(ma = u[2 : 3], sigma2 = u[1])
return(gap)
   }
   init <- c(0.005, 0.004, 0.003)
   outMLE <- dlmMLE(x, init, buildGap)
   dlmGap <- buildGap(outMLE$par)
}

and this gives:
[1] "outMLE"
$par
[1] 1.00816794 0.02349296 0.02364788

$value
[1] 3089.196

$counts
function gradient
  10   10

$convergence
[1] 0

$message
[1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"

[1] "dlmGap"
$FF
 [,1] [,2] [,3]
[1,]100

$V
 [,1]
[1,]0

$GG
 [,1] [,2] [,3]
[1,]010
[2,]001
[3,]000

$W
   [,1] [,2] [,3]
[1,] 1.00816794 0.0236848488 0.0238410337
[2,] 0.02368485 0.0005564272 0.0005600964
[3,] 0.02384103 0.0005600964 0.0005637899

$m0
[1] 0 0 0

$C0
  [,1]  [,2]  [,3]
[1,] 1e+07 0e+00 0e+00
[2,] 0e+00 1e+07 0e+00
[3,] 0e+00 0e+00 1e+07

In this case
V[epsilon]=W[1,1]=1.00816794
beta1=W[2,1]/W[1,1]=0.02349296
beta2=W[3,1]/W[1,1]=0.02364788

I presume that these two approaches should give comparable results, but this 
does not happen.
Is the model that I used correct? And does it make sense to perform this kind 
of comparison?

This is the log of a rainfall time series (which has already been 
deseasonalised):
[1] 6.014937 4.978801 5.654592 5.616771 5.612398 5.837147 5.121580 5.832176
[9] 5.205654 5.355642 5.405376 6.257859 5.516247 5.500850 4.708629 5.482304
[17] 5.689684 5.727824 4.779123 5.289277 5.217107 5.976351 4.630838 5.683240
[25] 5.345678 5.906179 5.605434 5.497578 5.898801 5.660875 5.111988 5.571013
[33] 5.949340 5.374352 4.841033 5.995706 5.661223 5.458734 4.454347 5.795754
[41] 5.995706 5.596939 5.399971 5.908898 5.282696 5.438514 5.528635 6.022721
[49] 5.524257 5.519459 4.957235 5.547518 5.080783 5.411200 5.056883 5.798183
[57] 5.086361 5.536547 5.220356 5.141664 5.847017 5.052417 5.734635 5.340419
[65] 5.724238 5.634432 5.685958 5.307773 5.817706 5.134032 4.987708 5.110179
[73] 5.423628 5.347108 4.859037 5.556828 5.487283 5.661223 5.732370 5.469325
[81] 5.726848 5.419207 5.172187 5.608006 5.130490 5.586874 5.171052 5.683240
[89] 4.674696 5.286245 5.342813 5.370638 5.432411 5.748118 6.355239 5.557986
[97] 5.399067 5.222516 5.279644 5.425390 5.540871 5.917818 5.132853 5.689007
[105] 5.900993 5.007296 5.102911 5.778271 5.318120 5.927726 5.066385 5.716699
[113] 5.511815 4.714921 5.383577 5.319100 5.269403 5.354698 5.145749 5.204556
[121] 5.878296 5.070161 5.441552 5.213304 5.450180 5.695750 4.893352 5.425390
[129] 5.682559 5.487283 4.213608 5.751620 5.432411 5.379436 5.700444 5.580484
[137] 5.357529 5.319100 4.532599 5.603225 5.208393 5.254888 5.017280 5.349961
[145] 4.374498 5.187944 5.585374 5.716370 3.561046 5.119789 5.163070 5.422745
[153] 5.863915 5.651436 4.762174 5.655642 4.797442 5.735927 4.911183 5.240688
[161] 5.148076 5.477300 4.572647 5.493473 5.437644 4.854371 4.908233 4.755313
[169] 5.582744 5.527841 5.613128 5.211124 5.275049 5.462984 5.016617 5.981919
[177] 5.566817 5.094364 5.314191 5.712742 5.299317 5.452325 4.691348 5.851628
[185] 5.410753 5.488938 5.660179 5.900993 5.380819 5.256453 4.781641 5.531807
[193] 5.497578 5.274537 4.325456 5.271973 5.077047 5.258536 5.280662 5.247024
[201] 5.995208 4.700480 4.991113 5.457029 5.194622 5.487283 5.197391 5.747161
[209] 5.842094 5.372497 5.306781 5.641907 5.565286 5.259057 5.241218 4.759607
[217] 4.550714 5.230574 4.470495 5.664348 4.846547 5.771130 4.823502 5.598422
[225] 5.627621 5.547518 5.596939 5.468482 5.536940 5.606170 5.281680 5.656691
[233] 5.283204 5.752255 5.192401 4.550714


Thank you for your attention and your help
Stefano




AVVISO IMPORTANTE: Questo messaggio di posta elettronica può contenere 
informazioni confidenziali, pertanto è destinato solo a persone autorizzate 
alla ricezione. I messaggi di posta elettronica per i client di Regione Marche 
possono contenere informazioni confidenziali e con privilegi legali. Se non si 
è il destinatario specificato, non leggere, 

Re: [R-es] T4 templates R

2016-01-04 Thread Javier Marcuzzi
Estimados

Comprendo las alternativas, yo pensaba en algo sencillo como una archivo rnw, 
md, algo que permita en forma fácil mezclar R con código para generar R, lo que 
me gusto de T4 (que desconozco si corre en la versión de visual studio code – 
que tiene R) es la forma más o menos limpia de generar código.

r-eval-expression puede estar dentro de la línea de mi pensamiento, pero estimo 
una complicación de lectura al ojo humano, el escribir el código R que genera 
el código R, todo en R, pide cierta concentración que en casos donde la 
cantidad de líneas R aumenta, es un “R + lío = Relio”. Tendría que encontrar un 
“marcado” en el código para facilitar la lectura.

Aunque esta pregunta fue por curiosidad, no me encuentro en un problema 
concreto para resolver.

Javier Rubén Marcuzzi


De: Francisco Viciana
Enviado: lunes, 4 de enero de 2016 6:02
Para: r-help-es@r-project.org
Asunto: Re: [R-es] T4 templates R

Una alternativa que creo  resuelve la cuestión es mediante un 
"precompilador", como "gcc -E" o cualquier otro, incluyendo irectiva 
#include y  #define para la parametrización del código. Si embargo me 
parece una solución un tanto barroca, yo intentaría parametrizarlo 
usando código R puro.


Fran

On 03/01/16 20:10, Carlos Ortega wrote:
> Hola,
>
> "sed" está también en Windows:
> http://gnuwin32.sourceforge.net/packages/sed.htm
> Y si se quiere ir un poco más lejos, basta con instalarse Cygwin:
> https://www.cygwin.com/ y así tener un Linux conviviendo con Windows (no es
> necearia ninguna partición), con sed, awk/gawk, y otras alternativas...
>
> Y dependiendo de la complejidad de lo que quieras hacer, puedes hasta
> generar codigo "R" dentro de R y luego ejecutarlo sin salirte de la misma
> sesión, a través de la función "eval()":
>
> http://stackoverflow.com/questions/1743698/r-eval-expression
> http://stackoverflow.com/questions/18886015/evalparsetext-x-inside-a-function-how-to-evaluate-in-global-environment
>
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>
>
> El 2 de enero de 2016, 21:27, Javier Marcuzzi <
> javier.ruben.marcu...@gmail.com> escribió:
>
>> Estimado Carlos Ortega
>>
>>
>>
>> Podría ser sh, pero creo awk (gawk), están para todos los sistemas, awk
>> llegó  a mi por un software de genética que lo utilizaba para colocar los
>> resultados a cada individuo, por decirlo de alguna forma. Pero reformulando
>> mi pregunta y mezclándola con su respuesta, fit <- lm (y ~ …….., data =
>> misdatos), suponiendo que mis datos tiene columnas A,B,C,D, …,
>>
>> Una especie de plantilla que cree
>>
>> Fit <- lm( Y+ a, data=misdatos)
>>
>> Fit <- lm( Y+ a+b, data=misdatos)
>>
>> Fit <- lm( Y+ a+b+c, data=misdatos)
>>
>> Fit <- lm( Y+ b+c, data=misdatos)
>>
>> Fit <- lm( Y+ c, data=misdatos)
>>
>>
>>
>> Las diferentes combinaciones para todos los modelos posible, algunos
>> ilógicos en la realidad pero estadísticamente posibles. Con un poco de
>> trabajo esto no sería complicado, pero posiblemente hay alguna persona
>> desarrolló facilitando la edición de código.
>>
>>
>>
>> Javier Rubén Marcuzzi
>>
>>
>> *De: *Carlos Ortega 
>> *Enviado: *sábado, 2 de enero de 2016 17:02
>> *Para: *Javier Marcuzzi 
>> *CC: *r-help-es@r-project.org
>> *Asunto: *Re: [R-es] T4 templates R
>>
>>
>>
>> Hola,
>>
>> En Linux, Mac puedes hacerlo de una forma bastante directa.
>>
>> - Por un lado tienes tus ficheros que son las plantillas con el código
>> R donde los campos a cambiar los tienes bien identificados.
>> - Y por otro tienes un programa que altera estas plantillas y que
>> genera los "*.R"
>>
>> Un ejemplo podría ser este.
>>
>> A) El fichero con la plantilla:
>>
>> #---Plantilla en el fichero: ModeloLineal.plantilla
>>
>> mysDatos <- read.table("FILEDATOS.csv", header=T, as.is=T, sep=";")
>>
>> fit <- lm( y ~. , data=mysDatos)
>>
>> summary(fit)
>>
>> #
>>
>> B) Y este sería el fichero con que modificaría la plantilla anterior para
>> generar el ".R". Este  fichero en entornos Linux, Unix, Mac simplemente los
>> ejecutarías como un shell script.
>>
>>
>>
>> #!/bin/sh
>>
>> sed s/FILEDATOS/mi_nombre_fichero/g ModeloLineal.plantilla > ModeloLineal.R
>>
>>
>>
>> (el caso del ejemplo exige que tu fichero de datos tenga como nombre de la
>> columna de la variable a modelar "y", también exigiría que tu fichero
>> estuviera en formato ".csv".
>>
>>
>>
>> Saludos,
>>
>> Carlos Ortega
>>
>> www.qualityexcellence.es
>>
>>
>>
>> El 1 de enero de 2016, 22:34, Javier Marcuzzi <
>> javier.ruben.marcu...@gmail.com> escribió:
>>
>>
>> Estimados
>>
>> Buen 2016, año nuevo cosas nuevas, estoy leyendo un librito de unas 200
>> páginas sobre T4, básicamente crea plantillas y se puede colocar dentro de
>> ellas el código, por ejemplo por cada elemento de la lista realizar lo
>> siguiente (if, sum, lm ...).
>>
>> Es  mucho más fácil ver un video (por suerte o por malo forma parte de
>> visual studio), 

[R] dput sparseMatrix list

2016-01-04 Thread Lietz, Haiko
hi all,

when dputting a list of sparse matrices (Matrix package), the output does not 
contain the data but the information that the list contains sparse matrices.

M <- sparseMatrix(i = c(2, 1), j = c(1, 2), x = c(1, 1))

dput(M) ... works.

dput(list(M, M)) ... does not work.

how can I dput a list of sparse matrices?

thx

haiko


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] dput sparseMatrix list

2016-01-04 Thread David Winsemius

> On Jan 4, 2016, at 11:17 PM, Lietz, Haiko  wrote:
> 
> hi all,
> 
> when dputting a list of sparse matrices (Matrix package), the output does not 
> contain the data but the information that the list contains sparse matrices.
> 
> M <- sparseMatrix(i = c(2, 1), j = c(1, 2), x = c(1, 1))
> 
> dput(M) ... works.
> 
> dput(list(M, M)) ... does not work.
> 
> how can I dput a list of sparse matrices?

> MM <- list(M,M)
> dput(MM)
list(, 
)

No problem.

I do get an error (clarifying the "did not work" statement), as (perhaps) did 
you?

> dput(M,M)
Error in cat("new(\"", clx, "\"\n", file = file, sep = "") : 
  invalid connection

Perhaps the `dput` function was not configured to handle two S4 objects in  a 
list?

> [[alternative HTML version deleted]]

Please do better next time.

> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] problem in installing package xpose4 in Rstudio

2016-01-04 Thread swati j
With R, package xpose4 is working well, but when I open Rstudio and try to
install package xpose4

following error message is displayed

> install.packages("C:/Users/om/Downloads/xpose4_4.5.3.tar.gz", repos =
> NULL, type = "source")
Installing package(s) into ‘C:/Users/om/Documents/R/win-library/2.15’
(as ‘lib’ is unspecified)
ERROR: dependencies 'gam', 'Hmisc' are not available for package 'xpose4'
* removing 'C:/Users/om/Documents/R/win-library/2.15/xpose4'
Warning in install.packages :
  running command 'C:/PROGRA~1/R/R-215~1.1/bin/i386/R CMD INSTALL -l
"C:/Users/om/Documents/R/win-library/2.15"
"C:/Users/om/Downloads/xpose4_4.5.3.tar.gz"' had status 1
Warning in install.packages :
  installation of package ‘C:/Users/om/Downloads/xpose4_4.5.3.tar.gz’ had
non-zero exit status

please help me to sort out this problem.

Swati Jaiswal

PhD Scholar (CSIR-Senior Research Fellow)

Pharmacokinetics & Metabolism Division

CSIR-Central Drug Research Institute

*Lucknow-226031, India*

*Mobile +91 9473837970*

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] problem in installing package xpose4 in Rstudio

2016-01-04 Thread David Winsemius

> On Jan 3, 2016, at 11:19 PM, swati j  wrote:
> 
> With R, package xpose4 is working well, but when I open Rstudio and try to
> install package xpose4
> 
> following error message is displayed
> 
>> install.packages("C:/Users/om/Downloads/xpose4_4.5.3.tar.gz", repos =
>> NULL, type = "source")
> Installing package(s) into ‘C:/Users/om/Documents/R/win-library/2.15’
> (as ‘lib’ is unspecified)
> ERROR: dependencies 'gam', 'Hmisc' are not available for package 'xpose4'
^ ^ ^ ^  ^   ^
| | | |  ^   |   | 

Please READ error messages. Don't just freak out when you see the work "error". 
The rest of the message has meaning.

-- 
David.

> * removing 'C:/Users/om/Documents/R/win-library/2.15/xpose4'



> Warning in install.packages :
>  running command 'C:/PROGRA~1/R/R-215~1.1/bin/i386/R CMD INSTALL -l
> "C:/Users/om/Documents/R/win-library/2.15"
> "C:/Users/om/Downloads/xpose4_4.5.3.tar.gz"' had status 1
> Warning in install.packages :
>  installation of package ‘C:/Users/om/Downloads/xpose4_4.5.3.tar.gz’ had
> non-zero exit status
> 
> please help me to sort out this problem.
> 
> Swati Jaiswal
> 
> PhD Scholar (CSIR-Senior Research Fellow)
> 
> Pharmacokinetics & Metabolism Division
> 
> CSIR-Central Drug Research Institute
> 
> *Lucknow-226031, India*
> 
> *Mobile +91 9473837970*
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Better scrolling feature in ggplot using Shiny???

2016-01-04 Thread Jeff Newmiller
Server-side rendering of large amounts of data is often criticized this way.  
In general, the answer lies in client-side rendering, which these days usually 
means serving a Web page with embedded data and Javascript (e.g. D3), not 
ggplot images. The drawback seems to be a significant amount of extra effort 
and learning JS (off-topic here), or paying someone else to do that grunt-work.

The CRAN Task View on graphics is a little dated in this respect, but may have 
some options if Web pages are not required.  The "plotly" package works with 
the plotly Web service, but your tool then becomes tied with that service and 
its licensing requirements, though they do make it easier to get an interactive 
plot. The "googleVis" package offers some similar features,  with similar 
baggage. 

Please (re-)read the Posting Guide mentioned at the bottom of every r-help 
mailing list, which for one thing mentions that this is a plain text mailing 
list.  Posting in HTML is bound to lead to corrupted communication (us not 
being able to decipher your post) sooner or later,  and only you can prevent 
that by adjusting your email client when you send to this list.

[1] https://cran.r-project.org/web/views/Graphics.html

-- 
Sent from my phone. Please excuse my brevity.

On January 4, 2016 2:47:19 AM PST, Kunal Shah  wrote:
>Hello,
>
>I have plotted a ggplot of large data around 3 points. I opened it
>in
>Shiny. I want a scrolling feature so that I can just scroll the data.
>
>I tried to write a code in Shiny where the user can select the slider
>range. But "scrolling" by that is not efficient and not at all smooth
>
>Any help is appreciated
>
>
>Regards
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Estimating MA parameters through arima or through package "dlm"

2016-01-04 Thread Mark Leeds
Hi: I don't have time to look at the details of what you're doing but the
"equivalence"
between state space and arima ( as paul gilbert pointed out a few weeks ago
) is not a true equivalence.

 if you are in an area of the parameter space that the state space
formulation
 can't reach, then you won't get the same parameter estimates. so, what
you're doing
might be okay or might not be, depending on whether the state space
formulation
can reach that area of the parameter space. there's another state space
formulation that is truly equivalent which is called the SSOE formulation
or innovations representation but
I don't know if you want to get into that. google "SSOE state space" if
you're interested.


Mark






On Mon, Jan 4, 2016 at 9:25 AM, Stefano Sofia <
stefano.so...@regione.marche.it> wrote:

> Dear list users,
> I want to use apply a MA(2) process (x=beta1*epsilon_(t-1) +
> beta2*epsilon_(t-1) + epsilon_(t)) to a given time series (x), and I want
> to estimate the two parameters beta1, beta2 and the variance of the random
> variable epsilon_(t).
>
> If I use
> MA2_1 <- Arima(x, order=c(0,0,2))
> I get the following result
>
> [1] "MA2_1"
> Series: x
> ARIMA(0,0,2) with non-zero mean
>
> Coefficients:
>   ma1 ma2  intercept
>   -0.0279  0.0783 5.3737
> s.e.   0.0667  0.0622 0.0245
>
> sigma^2 estimated as 0.1284:  log likelihood=-92.63
> AIC=193.25   AICc=193.43   BIC=207.11
> [1] 0 2 0 0 1 0 0
>
> From this straightforward analysis V[epsilon]=0.1284, beta1=-0.0279 and
> beta2=0.0783.
>
> I also tried to use a DLM representation of ARIMA models and estimate the
> unknown parameters by maximum likelihood through the dlm package (in
> particular applying the example at section 3.2.6, page 115, of "Dynamic
> Linear Models with R" by Petris, Petrone and Campagnoli:
>
> arma_parameters <- function(x)
> {
>   buildGap <- function(u)
>   {
> gap <- dlmModARMA(ma = u[2 : 3], sigma2 = u[1])
> return(gap)
>}
>init <- c(0.005, 0.004, 0.003)
>outMLE <- dlmMLE(x, init, buildGap)
>dlmGap <- buildGap(outMLE$par)
> }
>
> and this gives:
> [1] "outMLE"
> $par
> [1] 1.00816794 0.02349296 0.02364788
>
> $value
> [1] 3089.196
>
> $counts
> function gradient
>   10   10
>
> $convergence
> [1] 0
>
> $message
> [1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"
>
> [1] "dlmGap"
> $FF
>  [,1] [,2] [,3]
> [1,]100
>
> $V
>  [,1]
> [1,]0
>
> $GG
>  [,1] [,2] [,3]
> [1,]010
> [2,]001
> [3,]000
>
> $W
>[,1] [,2] [,3]
> [1,] 1.00816794 0.0236848488 0.0238410337
> [2,] 0.02368485 0.0005564272 0.0005600964
> [3,] 0.02384103 0.0005600964 0.0005637899
>
> $m0
> [1] 0 0 0
>
> $C0
>   [,1]  [,2]  [,3]
> [1,] 1e+07 0e+00 0e+00
> [2,] 0e+00 1e+07 0e+00
> [3,] 0e+00 0e+00 1e+07
>
> In this case
> V[epsilon]=W[1,1]=1.00816794
> beta1=W[2,1]/W[1,1]=0.02349296
> beta2=W[3,1]/W[1,1]=0.02364788
>
> I presume that these two approaches should give comparable results, but
> this does not happen.
> Is the model that I used correct? And does it make sense to perform this
> kind of comparison?
>
> This is the log of a rainfall time series (which has already been
> deseasonalised):
> [1] 6.014937 4.978801 5.654592 5.616771 5.612398 5.837147 5.121580 5.832176
> [9] 5.205654 5.355642 5.405376 6.257859 5.516247 5.500850 4.708629 5.482304
> [17] 5.689684 5.727824 4.779123 5.289277 5.217107 5.976351 4.630838
> 5.683240
> [25] 5.345678 5.906179 5.605434 5.497578 5.898801 5.660875 5.111988
> 5.571013
> [33] 5.949340 5.374352 4.841033 5.995706 5.661223 5.458734 4.454347
> 5.795754
> [41] 5.995706 5.596939 5.399971 5.908898 5.282696 5.438514 5.528635
> 6.022721
> [49] 5.524257 5.519459 4.957235 5.547518 5.080783 5.411200 5.056883
> 5.798183
> [57] 5.086361 5.536547 5.220356 5.141664 5.847017 5.052417 5.734635
> 5.340419
> [65] 5.724238 5.634432 5.685958 5.307773 5.817706 5.134032 4.987708
> 5.110179
> [73] 5.423628 5.347108 4.859037 5.556828 5.487283 5.661223 5.732370
> 5.469325
> [81] 5.726848 5.419207 5.172187 5.608006 5.130490 5.586874 5.171052
> 5.683240
> [89] 4.674696 5.286245 5.342813 5.370638 5.432411 5.748118 6.355239
> 5.557986
> [97] 5.399067 5.222516 5.279644 5.425390 5.540871 5.917818 5.132853
> 5.689007
> [105] 5.900993 5.007296 5.102911 5.778271 5.318120 5.927726 5.066385
> 5.716699
> [113] 5.511815 4.714921 5.383577 5.319100 5.269403 5.354698 5.145749
> 5.204556
> [121] 5.878296 5.070161 5.441552 5.213304 5.450180 5.695750 4.893352
> 5.425390
> [129] 5.682559 5.487283 4.213608 5.751620 5.432411 5.379436 5.700444
> 5.580484
> [137] 5.357529 5.319100 4.532599 5.603225 5.208393 5.254888 5.017280
> 5.349961
> [145] 4.374498 5.187944 5.585374 5.716370 3.561046 5.119789 5.163070
> 5.422745
> [153] 5.863915 5.651436 4.762174 5.655642 4.797442 5.735927 4.911183
> 5.240688
> [161] 5.148076 5.477300 4.572647 5.493473 5.437644 4.854371 4.908233
> 4.755313
> [169] 5.582744 5.527841 5.613128 5.211124