Re: [R-es] Weighted Likelihood

2015-04-16 Thread Olivier Nuñez
No das muchos detalles sobre porque quieres ponderar los datos, pero intuyo que 
es por el diseño. 
Si es así, la función svydesign del paquete te permite especificar bien la 
probabilidad de selección del dato (probs) en la muestra o de manera 
equivalente, o el sampling weight que puedes interpretar como la 
representatividad del dato en la población. Una vez especificado el diseño 
mediante esta función, puedes llevar cualquier análisis estandár de tus datos. 
Un saludo. Olivier 

- Mensaje original -

De: Víctor Nalda Castellet victor.nalda.castel...@gmail.com 
Para: Olivier Nuñez onu...@unex.es 
CC: r-help-es r-help-es@r-project.org 
Enviados: Jueves, 16 de Abril 2015 11:25:10 
Asunto: Re: [R-es] Weighted Likelihood 

Hola, 

He buscado por el pdf de la documentación qué función es la que me puede servir 
pero no encuentro ninguna. 
¿Tenías alguna función especifica de ese paquete pensada? 


Un saludo, y muchas gracias por la ayuda. 

El 16 de abril de 2015, 10:45, Víctor Nalda Castellet  
victor.nalda.castel...@gmail.com  escribió: 



¡Muchas gracias Olivier! 


Un saludo. 

El 16 de abril de 2015, 10:44, Olivier Nuñez  onu...@unex.es  escribió: 

blockquote
Mira el paquete survey. 
Un saludo. Olivier 

- Mensaje original - 
De: Víctor Nalda Castellet  victor.nalda.castel...@gmail.com  
Para: r-help-es  r-help-es@r-project.org  
Enviados: Miércoles, 15 de Abril 2015 14:21:33 
Asunto: [R-es] Weighted Likelihood 

Buenas tardes, 

Estoy intentando ajustar distribuciones utilizando un vector de ponderación 
en los datos (Weighted Likelihood). ¿Existen paquetes en R que resuelven 
esto? He mirado ya el paquete wle pero no me permite introducir los pesos 
mediante los cuales ponderar los datos. 

En un primer momento, se me ha ocurrido realizar lo siguiente: repetir 
cada elemento del vector datos tantas veces como indique el vector pesos 
“modificado” (multiplicado por una potencia de 10, para que sean todos 
números enteros). Y con este vector de datos repetidos realizar el ajuste. 

Pero me gustaría conocer si existen otras formas más elegantes de hacerlo. 


Un saludo, y muchas gracias por adelantado. 

-- 
Víctor Nalda Castellet 

[[alternative HTML version deleted]] 

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






-- 
Víctor Nalda Castellet 

/blockquote




-- 
Víctor Nalda Castellet 


[[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] assign variables to function output

2015-04-16 Thread merm
Hi!

So I'm trying as the header suggests to assign the value(s) output by a
function to a variable, say 'y'

Problem is from what I gather any variables introduced within the function
are contained and the only output I can get is return(value) which is
awkward to work with. Any suggestions?

Cheers!



--
View this message in context: 
http://r.789695.n4.nabble.com/assign-variables-to-function-output-tp4705920.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Casting components

2015-04-16 Thread Bob
Hello,

We are the specialized manufacturer of aluminum casting in China with 
advantages as follows:

1. All kinds of casting processes: low pressure die casting, sand casting, 
gravity premanent mold casting to meet your different demand.
2. 17 years experience only dedicated in aluminum castings with precision 
machining, More profession, more competitive.
3. All molds made by ourself to reduce your cost. Advanced machining equipments 
and testing equipments.

40% of our shipment are for your market, proved our competitive in pricing and 
quality.
Shall you have any interest, pls contact for possible deal.

b.rgds
---
Bob Hu

Ningbo Yinzhou Xusheng Machinery Factory
Skype: bobhu1
Tel: 0086-574-88128603
Cell: 0086-1395832 7774
b...@xs-aluminumcasting.com
www.xs-aluminumcasting.com
__
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] assign variables to function output

2015-04-16 Thread Sergio Fonda
Collect in a vector or dataframe or list the variables of interest and
output it.
Il 16/apr/2015 10:57, merm pione...@student.unimelb.edu.au ha scritto:

 Hi!

 So I'm trying as the header suggests to assign the value(s) output by a
 function to a variable, say 'y'

 Problem is from what I gather any variables introduced within the function
 are contained and the only output I can get is return(value) which is
 awkward to work with. Any suggestions?

 Cheers!



 --
 View this message in context:
 http://r.789695.n4.nabble.com/assign-variables-to-function-output-tp4705920.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 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.


[R-es] Formulario Web

2015-04-16 Thread Gilsanz, Jose Luis
Hola:

Tengo un absoluto desconocimiento de las posibilidades que ofrece R desde el 
punto de vista web así que agradecería que alguien me “encaminara” para un 
proyecto que me está rondando.

El proyecto consistiría básicamente en montar una especie de formulario web al 
cual accederían distintas personas (colaboradores) repartidas por España. El 
formulario tendría una serie de datos precargados y el colaborador debería 
cumplimentar el resto de datos faltantes.
Una vez cumplimentados todos los datos, estos se deben guardar en alguna 
estructura de datos (dataframe???) o algún tipo de BBDD para su posterior 
explotación estadística (esta sería la parte B del proyecto)

En esencia el formulario debería poder:
-Introducir valores de tipo texto o número así como valores de tipo combobox 
(valores pautados previamente),o lo que sería un factor en R.
-Subir documentos (fundamentalmente fotos y pdf) asociados al registro que se 
está editando.
-Ser capaz de mostrar a cada usuario únicamente los registros que tiene que 
rellenar puesto que los registros se distribuirán entre los colaboradores por 
criterios geográficos . De esta manera un colaborador residente en Madrid solo 
“vera” los registros relativos a Madrid y no los del resto de provincias.
-Mostrar mapas, gráficos, fotos “incrustados” en el propio formulario web a 
medida que se van introduciendo datos y/o subiendo documentos.

Lógicamente la mejor forma de hacer esto es usando lenguajes de programación 
web (html, java, php etc) asociados a gestores de bases de datos (SQL server, 
mySQL etc) pero mi desafío consiste en hacer TODO el proceso (Tanto la captura 
como la explotación de los datos) dentro de R, aun cuando puedan usarse 
sistemas auxiliares conectados a R.

Os agradezco desde ya cualquier sugerencia o comentario.

Un cordial saludo

TASACIONES HIPOTECARIAS S.A.
Registration number: A-28/806222.
Registered Office: Pº de la Castellana, 79 - 1ª ; 28046 Madrid

This e-mail is for the use of the intended recipient(s) only. If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it. If you are not the intended recipient, you must not use, disclose or 
distribute this e-mail without the author's prior permission. We have taken 
precautions to minimise the risk of transmitting software viruses, but we 
advise you to carry out your own virus checks on any attachment to this 
message. We cannot accept liability for any loss or damage caused by software 
viruses. If you are the intended recipient and you do not wish to receive 
similar electronic messages from us in future then please respond to the sender 
to this effect

[[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] melt function chooses wrong id variable with large datasets

2015-04-16 Thread PIKAL Petr
Hi

There is something weird with your data and melt function.

AFAIK melt does not use first row as id.variables.

What is result of

str(dataset)

Instead of

melt(dataset,id.vars=dataset[1,], na.rm=TRUE)

melt expects something like

melt(dataset, id.vars=c(norm, jaar), na.rm=TRUE)

If you want more specific answer you shall show us part of your data, 
preferably copy output of

dput(dataset[1:20,])

into your mail.

Cheers
Petr

 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Joachim
 Audenaert
 Sent: Thursday, April 16, 2015 11:37 AM
 To: r-help@r-project.org
 Subject: [R] melt function chooses wrong id variable with large
 datasets

 Hello all,

 I'm using a large dataset consisting of 2 groups of data, 2 columns in
 excel with a header (group name) and 15 000 rows of data. I would like
 like to compare this data, so I transform my dataset with the melt
 function to get 1 column of data and 1 column of ID variables, then I
 can apply different statistical tests. With small datasets this works
 great, the melt function automatically chooses the name in row 1 as ID
 variable and melts the data, thus giving me a matrix with all ID
 variables in column one and the data accordingly in column 2.
 With this big dataset however it chooses the whole first column as ID
 variables in stead of the first row. Is there a reason why this happens
 and how can I make sure the first row is chosen as ID variabele and the
 lower rows as data?

 If I specify that I want the first row to be the id variable I also get
 error.

 melt(dataset,id.vars=dataset[1,], na.rm=TRUE)

 Error: id variables not found in data: norm, jaar

 Are there alternative ways to create a good reshaped dataset?

 Met vriendelijke groeten - With kind regards,

 Joachim Audenaert
 onderzoeker gewasbescherming - crop protection researcher

 PCS | proefcentrum voor sierteelt - ornamental plant research

 Schaessestraat 18, 9070 Destelbergen, Belgi
 T: +32 (0)9 353 94 71 | F: +32 (0)9 353 94 95
 E: joachim.audena...@pcsierteelt.be | W: www.pcsierteelt.be

 Heb je je individuele begeleiding bemesting (CVBB) al aangevraagd? |
 Het PCS op LinkedIn Disclaimer | Please consider the environment before
 printing. Think green, keep it on the screen!
   [[alternative HTML version deleted]]



Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on behalf of the company except for cases in 

Re: [R-es] Weighted Likelihood

2015-04-16 Thread Víctor Nalda Castellet
Hola,

He buscado por el pdf de la documentación qué función es la que me puede
servir pero no encuentro ninguna.
¿Tenías alguna función especifica de ese paquete pensada?


Un saludo, y muchas gracias por la ayuda.

El 16 de abril de 2015, 10:45, Víctor Nalda Castellet 
victor.nalda.castel...@gmail.com escribió:

 ¡Muchas gracias Olivier!


 Un saludo.

 El 16 de abril de 2015, 10:44, Olivier Nuñez onu...@unex.es escribió:

 Mira el paquete survey.
 Un saludo. Olivier

 - Mensaje original -
 De: Víctor Nalda Castellet victor.nalda.castel...@gmail.com
 Para: r-help-es r-help-es@r-project.org
 Enviados: Miércoles, 15 de Abril 2015 14:21:33
 Asunto: [R-es] Weighted Likelihood

 Buenas tardes,

 Estoy intentando ajustar distribuciones utilizando un vector de
 ponderación
 en los datos (Weighted Likelihood). ¿Existen paquetes en R que resuelven
 esto? He mirado ya el paquete wle pero no me permite introducir los
 pesos
 mediante los cuales ponderar los datos.

 En un primer momento, se me ha ocurrido realizar lo siguiente:  repetir
 cada elemento del vector datos tantas veces como indique el vector pesos
 “modificado” (multiplicado por una potencia de 10, para que sean todos
 números enteros). Y con este vector de datos repetidos realizar el ajuste.

 Pero me gustaría conocer si existen otras formas más elegantes de
 hacerlo.


 Un saludo, y muchas gracias por adelantado.

 --
 Víctor Nalda Castellet

 [[alternative HTML version deleted]]

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




 --
 Víctor Nalda Castellet




-- 
Víctor Nalda Castellet

[[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] R help leaves out lines of text

2015-04-16 Thread paul
I am ramping up on the R statistical analysis environment.  I find
that the help leaves out entire lines of text.  The pager is
/usr/lib/R/bin/pager.  I changed it to /bin/less, but I see the same
symptom.  The problem shows up both in xterm and mintty.  The computer
is in a locked down environment, so a straight update of cygwin
packages is not an option.  

Is there anything further I can try to circumvent the problem?

My version info is:

   64-bit Cygwin DLL version 1.7.28
   R version 3.0.1-1

__
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] function as variable name - probably better error message

2015-04-16 Thread Rainer M Krug
Hi

The following code works as expected:


list(plot=Not any more!)

,
|  plot - Not any more!)
| [1] Not any more!
`

But for this I get an error:

,
|  function - Not any more!
| Error: unexpected assignment in function -
`

The error message is quite cryptic and does not help much further. Would
it be possible to provide a more useful error message in this case that
(presumably) function is a reserved word?

Along the same lines - is there a list of reserved words which can not
be used in R as variable names (not even as elements in a a list())?

This is not a huge problem, but it cost me a few minutes of figuring
out.

Thanks,

Rainer

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


signature.asc
Description: PGP signature
__
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] melt function chooses wrong id variable with large datasets

2015-04-16 Thread Joachim Audenaert
Hello all,

I'm using a large dataset consisting of 2 groups of data, 2 columns in 
excel with a header (group name) and 15 000 rows of data. I would like 
like to compare this data, so I transform my dataset with the melt 
function to get 1 column of data and 1 column of ID variables, then I can 
apply different statistical tests. With small datasets this works great, 
the melt function automatically chooses the name in row 1 as ID variable 
and melts the data, thus giving me a matrix with all ID variables in 
column one and the data accordingly in column 2. 
With this big dataset however it chooses the whole first column as ID 
variables in stead of the first row. Is there a reason why this happens 
and how can I make sure the first row is chosen as ID variabele and the 
lower rows as data? 

If I specify that I want the first row to be the id variable I also get 
error. 

melt(dataset,id.vars=dataset[1,], na.rm=TRUE)

Error: id variables not found in data: norm, jaar

Are there alternative ways to create a good reshaped dataset?

Met vriendelijke groeten - With kind regards,

Joachim Audenaert 
onderzoeker gewasbescherming - crop protection researcher

PCS | proefcentrum voor sierteelt - ornamental plant research

Schaessestraat 18, 9070 Destelbergen, Belgi�
T: +32 (0)9 353 94 71 | F: +32 (0)9 353 94 95
E: joachim.audena...@pcsierteelt.be | W: www.pcsierteelt.be   

Heb je je individuele begeleiding bemesting (CVBB) al aangevraagd? | Het 
PCS op LinkedIn
Disclaimer | Please consider the environment before printing. Think green, 
keep it on the screen!
[[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] Weighted Likelihood

2015-04-16 Thread Víctor Nalda Castellet
¡Muchas gracias Olivier!


Un saludo.

El 16 de abril de 2015, 10:44, Olivier Nuñez onu...@unex.es escribió:

 Mira el paquete survey.
 Un saludo. Olivier

 - Mensaje original -
 De: Víctor Nalda Castellet victor.nalda.castel...@gmail.com
 Para: r-help-es r-help-es@r-project.org
 Enviados: Miércoles, 15 de Abril 2015 14:21:33
 Asunto: [R-es] Weighted Likelihood

 Buenas tardes,

 Estoy intentando ajustar distribuciones utilizando un vector de ponderación
 en los datos (Weighted Likelihood). ¿Existen paquetes en R que resuelven
 esto? He mirado ya el paquete wle pero no me permite introducir los pesos
 mediante los cuales ponderar los datos.

 En un primer momento, se me ha ocurrido realizar lo siguiente:  repetir
 cada elemento del vector datos tantas veces como indique el vector pesos
 “modificado” (multiplicado por una potencia de 10, para que sean todos
 números enteros). Y con este vector de datos repetidos realizar el ajuste.

 Pero me gustaría conocer si existen otras formas más elegantes de
 hacerlo.


 Un saludo, y muchas gracias por adelantado.

 --
 Víctor Nalda Castellet

 [[alternative HTML version deleted]]

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




-- 
Víctor Nalda Castellet

[[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] Formulario Web

2015-04-16 Thread miguel.angel.rodriguez.muinos
Hola José Luis.

Mi recomendación es que explores Shiny (http://shiny.rstudio.com/),
puede que sea lo que necesitas.

Un Saludo,
Miguel Ángel Rodríguez Muíños
Consellería de Sanidade
Xunta de Galicia



El 16/04/2015 a las 11:44, Gilsanz, Jose Luis escribió:
 Hola:

 Tengo un absoluto desconocimiento de las posibilidades que ofrece R desde el 
 punto de vista web así que agradecería que alguien me “encaminara” para un 
 proyecto que me está rondando.

 El proyecto consistiría básicamente en montar una especie de formulario web 
 al cual accederían distintas personas (colaboradores) repartidas por España. 
 El formulario tendría una serie de datos precargados y el colaborador debería 
 cumplimentar el resto de datos faltantes.
 Una vez cumplimentados todos los datos, estos se deben guardar en alguna 
 estructura de datos (dataframe???) o algún tipo de BBDD para su posterior 
 explotación estadística (esta sería la parte B del proyecto)

 En esencia el formulario debería poder:
 -Introducir valores de tipo texto o número así como valores de tipo combobox 
 (valores pautados previamente),o lo que sería un factor en R.
 -Subir documentos (fundamentalmente fotos y pdf) asociados al registro que se 
 está editando.
 -Ser capaz de mostrar a cada usuario únicamente los registros que tiene que 
 rellenar puesto que los registros se distribuirán entre los colaboradores por 
 criterios geográficos . De esta manera un colaborador residente en Madrid 
 solo “vera” los registros relativos a Madrid y no los del resto de provincias.
 -Mostrar mapas, gráficos, fotos “incrustados” en el propio formulario web a 
 medida que se van introduciendo datos y/o subiendo documentos.

 Lógicamente la mejor forma de hacer esto es usando lenguajes de programación 
 web (html, java, php etc) asociados a gestores de bases de datos (SQL server, 
 mySQL etc) pero mi desafío consiste en hacer TODO el proceso (Tanto la 
 captura como la explotación de los datos) dentro de R, aun cuando puedan 
 usarse sistemas auxiliares conectados a R.

 Os agradezco desde ya cualquier sugerencia o comentario.

 Un cordial saludo

 TASACIONES HIPOTECARIAS S.A.
 Registration number: A-28/806222.
 Registered Office: Pº de la Castellana, 79 - 1ª ; 28046 Madrid

 This e-mail is for the use of the intended recipient(s) only. If you have 
 received this e-mail in error, please notify the sender immediately and then 
 delete it. If you are not the intended recipient, you must not use, disclose 
 or distribute this e-mail without the author's prior permission. We have 
 taken precautions to minimise the risk of transmitting software viruses, but 
 we advise you to carry out your own virus checks on any attachment to this 
 message. We cannot accept liability for any loss or damage caused by software 
 viruses. If you are the intended recipient and you do not wish to receive 
 similar electronic messages from us in future then please respond to the 
 sender to this effect

   [[alternative HTML version deleted]]

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



Nota: A información contida nesta mensaxe e os seus posibles documentos 
adxuntos é privada e confidencial e está dirixida únicamente ó seu 
destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por 
favor elimínea. A distribución ou copia desta mensaxe non está autorizada.

Nota: La información contenida en este mensaje y sus posibles documentos 
adjuntos es privada y confidencial y está dirigida únicamente a su 
destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, 
por favor elimínelo. La distribución o copia de este mensaje no está autorizada.

See more languages: http://www.sergas.es/aviso_confidencialidad.htm
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] R help leaves out lines of text

2015-04-16 Thread Duncan Murdoch
On 16/04/2015 12:23 AM, paul wrote:
 I am ramping up on the R statistical analysis environment.  I find
 that the help leaves out entire lines of text.  The pager is
 /usr/lib/R/bin/pager.  I changed it to /bin/less, but I see the same
 symptom.  The problem shows up both in xterm and mintty.  The computer
 is in a locked down environment, so a straight update of cygwin
 packages is not an option.  
 
 Is there anything further I can try to circumvent the problem?
 
 My version info is:
 
64-bit Cygwin DLL version 1.7.28
R version 3.0.1-1
 

The Cygwin release is not supported by us, and is known to be buggy,
because it doesn't handle line endings properly.

You'll need to talk to the Cygwin folks if you can't reproduce this in
one of our releases available from cran.r-project.org/bin/windows/base.

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 3.2.0 is released

2015-04-16 Thread Peter Dalgaard
The build system rolled up R-3.2.0.tar.gz (codename Full of Ingredients) this 
morning.

The list below details the changes in this release.

You can get the source code from

http://cran.r-project.org/src/base/R-3/R-3.2.0.tar.gz

or wait for it to be mirrored at a CRAN site nearer to you.

Binaries for various platforms will appear in due course.


For the R Core Team,

Peter Dalgaard


These are the md5sums for the freshly created files, in case you wish
to check that they are uncorrupted:

MD5 (AUTHORS) = eb97a5cd38acb1cfc6408988bffef765
MD5 (COPYING) = eb723b61539feef013de476e68b5c50a
MD5 (COPYING.LIB) = a6f89e2100d9b6cdffcea4f398e37343
MD5 (FAQ) = a699fa0eeef280b78134f0abe0b1c1b0
MD5 (INSTALL) = 3964b9119adeaab9ceb633773fc94aac
MD5 (NEWS) = 99876f56fc07a7eb20825b85add9b66e
MD5 (NEWS.0) = bfcd7c147251b5474d96848c6f57e5a8
MD5 (NEWS.1) = eb78c4d053ec9c32b815cf0c2ebea801
MD5 (NEWS.2) = 8e2f4d1d5228663ae598a09bf1e2bc6b
MD5 (R-latest.tar.gz) = 66fa17ad457d7e618191aa0f52fc402e
MD5 (README) = aece1dfbd18c1760128c3787f5456af6
MD5 (RESOURCES) = a59076c1ac7e9bab0f0a38b3f57a3914
MD5 (THANKS) = ba00f6cc68a823e1741cfa6011f40ccb
MD5 (R-3/R-3.2.0.tar.gz) = 66fa17ad457d7e618191aa0f52fc402e


This is the relevant part of the NEWS file

CHANGES IN 3.2.0:

 NEW FEATURES:

   * anyNA() gains a recursive argument.

   * When x is missing and names is not false (including the default
 value), Sys.getenv(x, names) returns an object of class Dlist
 and hence prints tidily.

   * (Windows.)  shell() no longer consults the environment variable
 SHELL: too many systems have been encountered where it was set
 incorrectly (usually to a path where software was compiled, not
 where it was installed).  R_SHELL, the preferred way to select a
 non-default shell, can be used instead.

   * Some unusual arguments to embedFonts() can now be specified as
 character vectors, and the defaults have been changed
 accordingly.

   * Functions in the Summary group duplicate less.  (PR#15798)

   * (Unix-alikes.) system(cmd, input = ) now uses
 'shell-execution-environment' redirection, which will be more
 natural if cmd is not a single command (but requires a
 POSIX-compliant shell). (Wish of PR#15508)

   * read.fwf() and read.DIF() gain a fileEncoding argument, for
 convenience.

   * Graphics devices can add attributes to their description in
 .Device and .Devices.  Several of those included with R use a
 filepath attribute.

   * pmatch() uses hashing in more cases and so is faster at the
 expense of using more memory. (PR#15697)

   * pairs() gains new arguments to select sets of variables to be
 plotted against each other.

   * file.info(, extra_cols = FALSE) allows a minimal set of columns
 to be computed on Unix-alikes: on some systems without
 properly-configured caching this can be significantly faster with
 large file lists.

   * New function dir.exists() in package base to test efficiently
 whether one or more paths exist and are directories.

   * dput() and friends gain new controls hexNumeric and digits17
 which output double and complex quantities as, respectively,
 binary fractions (exactly, see sprintf(%a)) and as decimals
 with up to 17 significant digits.

   * save(), saveRDS() and serialize() now support ascii = NA which
 writes ASCII files using sprintf(%a) for double/complex
 quantities.  This is read-compatible with ascii = TRUE but avoids
 binary-decimal-binary conversions with potential loss of
 precision.  Unfortunately the Windows C runtime's lack of C99
 compliance means that the format cannot be read correctly there
 in R before 3.1.2.

   * The default for formatC(decimal.mark =) has been changed to be
 getOption(OutDec); this makes it more consistent with format()
 and suitable for use in print methods, e.g. those for classes
 density, ecdf, stepfun and summary.lm.

 getOption(OutDec) is now consulted by the print method for
 class kmeans, by cut(), dendrogram(), plot.ts() and quantile()
 when constructing labels and for the report from legend(trace =
 TRUE).

 (In part, wish of PR#15819.)

   * printNum() and hence format() and formatC() give a warning if
 big.mark and decimal.mark are set to the same value (period and
 comma are not uncommonly used for each, and this is a check that
 conventions have not got mixed).

   * merge() can create a result which uses long vectors on 64-bit
 platforms.

   * dget() gains a new argument keep.source which defaults to FALSE
 for speed (dput() and dget() are most often used for data objects
 where this can make dget() many times faster).

   * Packages may now use a file of common macro definitions in their
 help files, and may import definitions from other packages.

   * A number of macros have been added in the new share/Rd directory
 for use in package overview help pages, and 

Re: [R] function as variable name - probably better error message

2015-04-16 Thread Duncan Murdoch
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 16/04/2015 6:19 AM, Rainer M Krug wrote:
 Hi
 
 The following code works as expected:
 
 
 list(plot=Not any more!)
 
 , |  plot - Not any more!) | [1] Not any more! `
 
 But for this I get an error:
 
 , |  function - Not any more! | Error: unexpected
 assignment in function - `
 
 The error message is quite cryptic and does not help much further.
 Would it be possible to provide a more useful error message in this
 case that (presumably) function is a reserved word?
 
 Along the same lines - is there a list of reserved words which can
 not be used in R as variable names (not even as elements in a a
 list())?

The R Language Definition lists the reserved words (see section
10.3.3).  It oversimplifies things, saying they can't be used as
variable names, when in fact almost any string can be used with proper
quoting.  For example, both of these work:

function - Not any more!
`function` - Not any more!

Duncan Murdoch

 
 This is not a huge problem, but it cost me a few minutes of
 figuring out.
 
 Thanks,
 
 Rainer
 
 
 
 __ 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.
 

-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJVL58yAAoJEHE2Kz23YMZyyv0H/jKjwwkQ1v7jIRsZ9hxcJECU
HHHuAEusv+pgJTybdxn66XykCXQOgaLmGPGksK+CcJrBgLW2WgAh4C0CUpN36DPn
TOYpos9i3wZ8k0Idr8xiEeQ/PcD0pkMEwd6oYY0lL2Ikribu8maVKxcoYvjNIJOE
3E3qrrpZfH9U2a9ws9jxJk8O3n+OQ7x8GQqUNTQHthd5McHZ63F7uIEBH/tHT7Tn
x3gXAFbuSBJ6TtqaOZdPYFh3tV7CNyvJOso8yreSWK+0ZksXGKBtqElDJM0atrAj
bOwEAJe6gGrEPx92NUWkTWeILDa6v96WZzprwLDi+cwt7jItILFligaXlookbf0=
=vKWN
-END PGP SIGNATURE-

__
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] melt function chooses wrong id variable with large datasets

2015-04-16 Thread Jeff Newmiller
Maybe what you really want is the ?stack function.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On April 16, 2015 4:59:47 AM PDT, Joachim Audenaert 
joachim.audena...@pcsierteelt.be wrote:
Thanks,

indeed norm should be in the same group as as the months. everything
works 
fine when the number of data is quite small, but with big datasets (15
000 
values) things seem to go wrong and I can't explain why. It puts norm
as 
an individual column in stead of in the group of months as it does when

the dataset is small.

Met vriendelijke groeten - With kind regards,

Joachim Audenaert 
onderzoeker gewasbescherming - crop protection researcher

PCS | proefcentrum voor sierteelt - ornamental plant research

Schaessestraat 18, 9070 Destelbergen, Belgi�
T: +32 (0)9 353 94 71 | F: +32 (0)9 353 94 95
E: joachim.audena...@pcsierteelt.be | W: www.pcsierteelt.be 



From:   PIKAL Petr petr.pi...@precheza.cz
To: Joachim Audenaert joachim.audena...@pcsierteelt.be
Cc: r-help@r-project.org r-help@r-project.org
Date:   16/04/2015 13:41
Subject:RE: [R]  melt function chooses wrong id variable with 
large datasets



Hi
 
With this dataset I get
 
 dd.m0-melt(dataset, na.rm=T)
Using norm as id variables
 head(dd.m0)
norm variable value
1   45.8713463281901  januari  38.1
2 24.047250681782984  januari  32.4
3 3.7533684144746324  januari  34.5
4 38.594241119279324  januari  20.7
5 26.391897460120358  januari  21.5
6 61.746470001194638  januari  23.1
 
or
 
dd.m-melt(dataset, id.vars=NULL, na.rm=T)
 
 head(dd.m)
  variable value
1  januari  38.1
2  januari  32.4
3  januari  34.5
4  januari  20.7
5  januari  21.5
6  januari  23.1
 tail(dd.m)
variable  value
255 norm  4.856812959269508
256 norm 5.3982910143166514
257 norm 46.553976273304215
258 norm 17.566272518985429
259 norm 20.552451905814117
260 norm 61.894775704479279
 
The latter will put norm to the same column as months. Is it intended?
 
Maybe you want
 
 dd.m1-melt(dataset[,-13], na.rm=T)
No id variables; using all as measure variables
 head(dd.m1)
  variable value
1  januari  38.1
2  januari  32.4
3  januari  34.5
4  januari  20.7
5  januari  21.5
6  januari  23.1
 tail(dd.m1)
variable value
235 december  20.7
236 december  30.9
237 december  36.2
238 december  21.0
239 december  20.2
240 december  21.3
 
Cheers
Petr
 
From: Joachim Audenaert [mailto:joachim.audena...@pcsierteelt.be] 
Sent: Thursday, April 16, 2015 1:13 PM
To: PIKAL Petr
Cc: r-help@r-project.org
Subject: RE: [R] melt function chooses wrong id variable with large 
datasets
 
Hello, 

This is a part of my dataset: 

structure(list(januari = c(38.1, 32.4, 34.5, 20.7, 21.5, 23.1, 
29.7, 36.6, 36.1, 20.6, 20.4, 30.1, 38.7, 41.4, 37, 36, 37, 38, 
23, 26.7), februari = c(31.5, 36.2, 38.2, 26.4, 20.9, 21.5, 30.2, 
33.4, 32.6, 22.2, 21.7, 30, 35.7, 32.8, 39.3, 25.5, 23, 19.9, 
21.3, 20.8), maart = c(34.2, 27, 24.2, 19.9, 19.7, 21.5, 30.6, 
30, 19, 19.6, 20.6, 23.6, 17.9, 17.3, 21.4, 24.1, 20.9, 30.1, 
32.6, 21.3), april = c(26.3, 29.6, 30.3, 23.6, 28.4, 20.7, 24.1, 
27.3, 23.2, 18.3, 24.6, 27.4, 20.4, 18.1, 25.2, 19.8, 21, 23.7, 
19.6, 18.1), mei = c(23.7, 24, 17.2, 23.2, 25.2, 17.2, 16, 15.6, 
13.4, 16, 16.8, 14.6, 19.4, 21, 19.5, 18.5, 13.3, 13.7, 14.3, 
14.1), juni = c(17.7, 14.2, 16.6, 15.7, 13.7, 14.7, 13.1, 12.9, 
15.4, 11.9, 15.2, 15.3, 16.5, 16.1, 11.7, 11.2, 11.5, 10.8, 16.1, 
14.8), juli = c(15.7, 14.5, 10.8, 10.5, 13.4, 12.2, 13.2, 13, 
12.4, 13.1, 9.8, 10.5, 13.4, 11, 13.1, 15, 16.7, 16.1, 18.2, 
15.7), augustus = c(12.9, 12.8, 15.2, 14.5, 17.2, 14.5, 14.4, 
11, 13.1, 13.6, 14.6, 12.7, 13.6, 12.7, 15.5, 17.4, 15.2, 14.2, 
17.7, 19.2), september = c(15.6, 15.5, 15.9, 15.1, 16, 19.4, 
21.5, 23.7, 18.7, 23.8, 18, 16.2, 18.5, 20.6, 18.3, 22.5, 26.9, 
19.4, 15.9, 20.5), oktober = c(21.4, 20.8, 14, 17, 23, 26.4, 
19.6, 22.7, 26.9, 14.7, 15.2, 19.8, 26.9, 20.2, 14.3, 14.8, 18.5, 
21.7, 21.4, 21.8), november = c(24.7, 26.2, 29, 21.6, 17.1, 16.9, 
19.1, 24.7, 25.4, 19.8, 18.2, 16.3, 17, 17.7, 15.5, 14.7, 15.8, 
19.9, 20.4, 23.3), december = c(19.8, 27, 21, 33, 22.6, 28.3, 
21.1, 19, 17.3, 27, 30.2, 24.8, 17.9, 17.9, 20.7, 30.9, 36.2, 
21, 20.2, 21.3), norm = c(45.8713463281901, 24.047250681782984, 
3.7533684144746324, 38.594241119279324, 26.391897460120358, 
61.746470001194638, 6.8321020448487992, 11.933109250115226, 
51.951891096493924, 37.424611852237945, 5.1587836676942374, 
36.552835044409434, 31.781209673851027, 

Re: [R-es] Formulario Web

2015-04-16 Thread Javier Marcuzzi
Estimado Miguel

Es posible lo que dices, pero ¿tienes un servidor para instalar la parte de
R?, si lo tienes ¿cuántos recursos? Me refiero a lo siguiente, puede ser
que su trabajo esté excelente, pero los recursos del servidor al procesar R
tengan un desmedro en la calidad (velocidad) http y de base de datos,
creando una experiencia mala para el usuario.

Hay alternativas, cada vez hay más web R, desconozco la solución
recomendable hoy en día, sin embargo creo que hay que tener muy en cuenta
el servidor, y ese factor puede ser de mucho peso en caso de ser deficiente.

Shiny , es conocido, o por lo menos es una opción de moda por decirlo de
alguna forma, sin embargo creo que podría escribir R desde casi un
obsoleto cgi-bin. Entiendo que no habría limitantes más que su
creatividad.

Javier Marcuzzi

El 16 de abril de 2015, 6:57, miguel.angel.rodriguez.mui...@sergas.es
escribió:

 Hola José Luis.

 Mi recomendación es que explores Shiny (http://shiny.rstudio.com/),
 puede que sea lo que necesitas.

 Un Saludo,
 Miguel Ángel Rodríguez Muíños
 Consellería de Sanidade
 Xunta de Galicia



 El 16/04/2015 a las 11:44, Gilsanz, Jose Luis escribió:
  Hola:
 
  Tengo un absoluto desconocimiento de las posibilidades que ofrece R
 desde el punto de vista web así que agradecería que alguien me “encaminara”
 para un proyecto que me está rondando.
 
  El proyecto consistiría básicamente en montar una especie de formulario
 web al cual accederían distintas personas (colaboradores) repartidas por
 España. El formulario tendría una serie de datos precargados y el
 colaborador debería cumplimentar el resto de datos faltantes.
  Una vez cumplimentados todos los datos, estos se deben guardar en alguna
 estructura de datos (dataframe???) o algún tipo de BBDD para su posterior
 explotación estadística (esta sería la parte B del proyecto)
 
  En esencia el formulario debería poder:
  -Introducir valores de tipo texto o número así como valores de tipo
 combobox (valores pautados previamente),o lo que sería un factor en R.
  -Subir documentos (fundamentalmente fotos y pdf) asociados al registro
 que se está editando.
  -Ser capaz de mostrar a cada usuario únicamente los registros que tiene
 que rellenar puesto que los registros se distribuirán entre los
 colaboradores por criterios geográficos . De esta manera un colaborador
 residente en Madrid solo “vera” los registros relativos a Madrid y no los
 del resto de provincias.
  -Mostrar mapas, gráficos, fotos “incrustados” en el propio formulario
 web a medida que se van introduciendo datos y/o subiendo documentos.
 
  Lógicamente la mejor forma de hacer esto es usando lenguajes de
 programación web (html, java, php etc) asociados a gestores de bases de
 datos (SQL server, mySQL etc) pero mi desafío consiste en hacer TODO el
 proceso (Tanto la captura como la explotación de los datos) dentro de R,
 aun cuando puedan usarse sistemas auxiliares conectados a R.
 
  Os agradezco desde ya cualquier sugerencia o comentario.
 
  Un cordial saludo
 
  TASACIONES HIPOTECARIAS S.A.
  Registration number: A-28/806222.
  Registered Office: Pº de la Castellana, 79 - 1ª ; 28046 Madrid
 
  This e-mail is for the use of the intended recipient(s) only. If you
 have received this e-mail in error, please notify the sender immediately
 and then delete it. If you are not the intended recipient, you must not
 use, disclose or distribute this e-mail without the author's prior
 permission. We have taken precautions to minimise the risk of transmitting
 software viruses, but we advise you to carry out your own virus checks on
 any attachment to this message. We cannot accept liability for any loss or
 damage caused by software viruses. If you are the intended recipient and
 you do not wish to receive similar electronic messages from us in future
 then please respond to the sender to this effect
 
[[alternative HTML version deleted]]
 
  ___
  R-help-es mailing list
  R-help-es@r-project.org
  https://stat.ethz.ch/mailman/listinfo/r-help-es

 

 Nota: A información contida nesta mensaxe e os seus posibles documentos
 adxuntos é privada e confidencial e está dirixida únicamente ó seu
 destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe,
 por favor elimínea. A distribución ou copia desta mensaxe non está
 autorizada.

 Nota: La información contenida en este mensaje y sus posibles documentos
 adjuntos es privada y confidencial y está dirigida únicamente a su
 destinatario/a. Si usted no es el/la destinatario/a original de este
 mensaje, por favor elimínelo. La distribución o copia de este mensaje no
 está autorizada.

 See more languages: http://www.sergas.es/aviso_confidencialidad.htm
 ___
 R-help-es mailing list
 R-help-es@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-help-es


[[alternative HTML version deleted]]


Re: [R] melt function chooses wrong id variable with large datasets

2015-04-16 Thread PIKAL Petr
Hi

With this dataset I get

 dd.m0-melt(dataset, na.rm=T)
Using norm as id variables
 head(dd.m0)
norm variable value
1   45.8713463281901  januari  38.1
2 24.047250681782984  januari  32.4
3 3.7533684144746324  januari  34.5
4 38.594241119279324  januari  20.7
5 26.391897460120358  januari  21.5
6 61.746470001194638  januari  23.1

or

dd.m-melt(dataset, id.vars=NULL, na.rm=T)

 head(dd.m)
  variable value
1  januari  38.1
2  januari  32.4
3  januari  34.5
4  januari  20.7
5  januari  21.5
6  januari  23.1
 tail(dd.m)
variable  value
255 norm  4.856812959269508
256 norm 5.3982910143166514
257 norm 46.553976273304215
258 norm 17.566272518985429
259 norm 20.552451905814117
260 norm 61.894775704479279

The latter will put norm to the same column as months. Is it intended?

Maybe you want

 dd.m1-melt(dataset[,-13], na.rm=T)
No id variables; using all as measure variables
 head(dd.m1)
  variable value
1  januari  38.1
2  januari  32.4
3  januari  34.5
4  januari  20.7
5  januari  21.5
6  januari  23.1
 tail(dd.m1)
variable value
235 december  20.7
236 december  30.9
237 december  36.2
238 december  21.0
239 december  20.2
240 december  21.3

Cheers
Petr

From: Joachim Audenaert [mailto:joachim.audena...@pcsierteelt.be]
Sent: Thursday, April 16, 2015 1:13 PM
To: PIKAL Petr
Cc: r-help@r-project.org
Subject: RE: [R] melt function chooses wrong id variable with large datasets

Hello,

This is a part of my dataset:

structure(list(januari = c(38.1, 32.4, 34.5, 20.7, 21.5, 23.1,
29.7, 36.6, 36.1, 20.6, 20.4, 30.1, 38.7, 41.4, 37, 36, 37, 38,
23, 26.7), februari = c(31.5, 36.2, 38.2, 26.4, 20.9, 21.5, 30.2,
33.4, 32.6, 22.2, 21.7, 30, 35.7, 32.8, 39.3, 25.5, 23, 19.9,
21.3, 20.8), maart = c(34.2, 27, 24.2, 19.9, 19.7, 21.5, 30.6,
30, 19, 19.6, 20.6, 23.6, 17.9, 17.3, 21.4, 24.1, 20.9, 30.1,
32.6, 21.3), april = c(26.3, 29.6, 30.3, 23.6, 28.4, 20.7, 24.1,
27.3, 23.2, 18.3, 24.6, 27.4, 20.4, 18.1, 25.2, 19.8, 21, 23.7,
19.6, 18.1), mei = c(23.7, 24, 17.2, 23.2, 25.2, 17.2, 16, 15.6,
13.4, 16, 16.8, 14.6, 19.4, 21, 19.5, 18.5, 13.3, 13.7, 14.3,
14.1), juni = c(17.7, 14.2, 16.6, 15.7, 13.7, 14.7, 13.1, 12.9,
15.4, 11.9, 15.2, 15.3, 16.5, 16.1, 11.7, 11.2, 11.5, 10.8, 16.1,
14.8), juli = c(15.7, 14.5, 10.8, 10.5, 13.4, 12.2, 13.2, 13,
12.4, 13.1, 9.8, 10.5, 13.4, 11, 13.1, 15, 16.7, 16.1, 18.2,
15.7), augustus = c(12.9, 12.8, 15.2, 14.5, 17.2, 14.5, 14.4,
11, 13.1, 13.6, 14.6, 12.7, 13.6, 12.7, 15.5, 17.4, 15.2, 14.2,
17.7, 19.2), september = c(15.6, 15.5, 15.9, 15.1, 16, 19.4,
21.5, 23.7, 18.7, 23.8, 18, 16.2, 18.5, 20.6, 18.3, 22.5, 26.9,
19.4, 15.9, 20.5), oktober = c(21.4, 20.8, 14, 17, 23, 26.4,
19.6, 22.7, 26.9, 14.7, 15.2, 19.8, 26.9, 20.2, 14.3, 14.8, 18.5,
21.7, 21.4, 21.8), november = c(24.7, 26.2, 29, 21.6, 17.1, 16.9,
19.1, 24.7, 25.4, 19.8, 18.2, 16.3, 17, 17.7, 15.5, 14.7, 15.8,
19.9, 20.4, 23.3), december = c(19.8, 27, 21, 33, 22.6, 28.3,
21.1, 19, 17.3, 27, 30.2, 24.8, 17.9, 17.9, 20.7, 30.9, 36.2,
21, 20.2, 21.3), norm = c(45.8713463281901, 24.047250681782984,
3.7533684144746324, 38.594241119279324, 26.391897460120358,
61.746470001194638, 6.8321020448487992, 11.933109250115226,
51.951891096493924, 37.424611852237945, 5.1587836676942374,
36.552835044409434, 31.781209673851027, 29.09146215582853,
4.856812959269508, 5.3982910143166514, 46.553976273304215,
17.566272518985429, 20.552451905814117, 61.894775704479279
)), .Names = c(januari, februari, maart, april, mei,
juni, juli, augustus, september, oktober, november,
december, norm), row.names = c(NA, 20L), class = data.frame)

I transform my dataset with the following script:

y - melt(dataset,na.rm=TRUE)
variable - y[,1]
value - y[,2]

and can then perform a levene test as follows:

LEVENE - leveneTest(value~variable,y)

When the dataset is small, lets say less than 100 values per column everything 
works great. I get the message:

No id variables; using all as measure variables

When the dataset is much bigger I get the following message

Using norm as id variables, why does this function pick norm as id variable? 
and how can I tell R that each column title is my variable


Met vriendelijke groeten - With kind regards,

Joachim Audenaert
onderzoeker gewasbescherming - crop protection researcher

PCS | proefcentrum voor sierteelt - ornamental plant research


Schaessestraat 18, 9070 Destelbergen, Belgi�
T: +32 (0)9 353 94 71 | F: +32 (0)9 353 94 95
E: joachim.audena...@pcsierteelt.bemailto:joachim.audena...@pcsierteelt.be | 
W: www.pcsierteelt.behttp://www.pcsierteelt.be/



From:PIKAL Petr petr.pi...@precheza.czmailto:petr.pi...@precheza.cz
To:Joachim Audenaert 
joachim.audena...@pcsierteelt.bemailto:joachim.audena...@pcsierteelt.be, 
r-help@r-project.orgmailto:r-help@r-project.org 
r-help@r-project.orgmailto:r-help@r-project.org
Date:16/04/2015 12:13
Subject:RE: [R]  melt function chooses wrong id variable with large 
datasets

Re: [R] melt function chooses wrong id variable with large datasets

2015-04-16 Thread Joachim Audenaert
Thanks,

indeed norm should be in the same group as as the months. everything works 
fine when the number of data is quite small, but with big datasets (15 000 
values) things seem to go wrong and I can't explain why. It puts norm as 
an individual column in stead of in the group of months as it does when 
the dataset is small.

Met vriendelijke groeten - With kind regards,

Joachim Audenaert 
onderzoeker gewasbescherming - crop protection researcher

PCS | proefcentrum voor sierteelt - ornamental plant research

Schaessestraat 18, 9070 Destelbergen, Belgi�
T: +32 (0)9 353 94 71 | F: +32 (0)9 353 94 95
E: joachim.audena...@pcsierteelt.be | W: www.pcsierteelt.be 



From:   PIKAL Petr petr.pi...@precheza.cz
To: Joachim Audenaert joachim.audena...@pcsierteelt.be
Cc: r-help@r-project.org r-help@r-project.org
Date:   16/04/2015 13:41
Subject:RE: [R]  melt function chooses wrong id variable with 
large datasets



Hi
 
With this dataset I get
 
 dd.m0-melt(dataset, na.rm=T)
Using norm as id variables
 head(dd.m0)
norm variable value
1   45.8713463281901  januari  38.1
2 24.047250681782984  januari  32.4
3 3.7533684144746324  januari  34.5
4 38.594241119279324  januari  20.7
5 26.391897460120358  januari  21.5
6 61.746470001194638  januari  23.1
 
or
 
dd.m-melt(dataset, id.vars=NULL, na.rm=T)
 
 head(dd.m)
  variable value
1  januari  38.1
2  januari  32.4
3  januari  34.5
4  januari  20.7
5  januari  21.5
6  januari  23.1
 tail(dd.m)
variable  value
255 norm  4.856812959269508
256 norm 5.3982910143166514
257 norm 46.553976273304215
258 norm 17.566272518985429
259 norm 20.552451905814117
260 norm 61.894775704479279
 
The latter will put norm to the same column as months. Is it intended?
 
Maybe you want
 
 dd.m1-melt(dataset[,-13], na.rm=T)
No id variables; using all as measure variables
 head(dd.m1)
  variable value
1  januari  38.1
2  januari  32.4
3  januari  34.5
4  januari  20.7
5  januari  21.5
6  januari  23.1
 tail(dd.m1)
variable value
235 december  20.7
236 december  30.9
237 december  36.2
238 december  21.0
239 december  20.2
240 december  21.3
 
Cheers
Petr
 
From: Joachim Audenaert [mailto:joachim.audena...@pcsierteelt.be] 
Sent: Thursday, April 16, 2015 1:13 PM
To: PIKAL Petr
Cc: r-help@r-project.org
Subject: RE: [R] melt function chooses wrong id variable with large 
datasets
 
Hello, 

This is a part of my dataset: 

structure(list(januari = c(38.1, 32.4, 34.5, 20.7, 21.5, 23.1, 
29.7, 36.6, 36.1, 20.6, 20.4, 30.1, 38.7, 41.4, 37, 36, 37, 38, 
23, 26.7), februari = c(31.5, 36.2, 38.2, 26.4, 20.9, 21.5, 30.2, 
33.4, 32.6, 22.2, 21.7, 30, 35.7, 32.8, 39.3, 25.5, 23, 19.9, 
21.3, 20.8), maart = c(34.2, 27, 24.2, 19.9, 19.7, 21.5, 30.6, 
30, 19, 19.6, 20.6, 23.6, 17.9, 17.3, 21.4, 24.1, 20.9, 30.1, 
32.6, 21.3), april = c(26.3, 29.6, 30.3, 23.6, 28.4, 20.7, 24.1, 
27.3, 23.2, 18.3, 24.6, 27.4, 20.4, 18.1, 25.2, 19.8, 21, 23.7, 
19.6, 18.1), mei = c(23.7, 24, 17.2, 23.2, 25.2, 17.2, 16, 15.6, 
13.4, 16, 16.8, 14.6, 19.4, 21, 19.5, 18.5, 13.3, 13.7, 14.3, 
14.1), juni = c(17.7, 14.2, 16.6, 15.7, 13.7, 14.7, 13.1, 12.9, 
15.4, 11.9, 15.2, 15.3, 16.5, 16.1, 11.7, 11.2, 11.5, 10.8, 16.1, 
14.8), juli = c(15.7, 14.5, 10.8, 10.5, 13.4, 12.2, 13.2, 13, 
12.4, 13.1, 9.8, 10.5, 13.4, 11, 13.1, 15, 16.7, 16.1, 18.2, 
15.7), augustus = c(12.9, 12.8, 15.2, 14.5, 17.2, 14.5, 14.4, 
11, 13.1, 13.6, 14.6, 12.7, 13.6, 12.7, 15.5, 17.4, 15.2, 14.2, 
17.7, 19.2), september = c(15.6, 15.5, 15.9, 15.1, 16, 19.4, 
21.5, 23.7, 18.7, 23.8, 18, 16.2, 18.5, 20.6, 18.3, 22.5, 26.9, 
19.4, 15.9, 20.5), oktober = c(21.4, 20.8, 14, 17, 23, 26.4, 
19.6, 22.7, 26.9, 14.7, 15.2, 19.8, 26.9, 20.2, 14.3, 14.8, 18.5, 
21.7, 21.4, 21.8), november = c(24.7, 26.2, 29, 21.6, 17.1, 16.9, 
19.1, 24.7, 25.4, 19.8, 18.2, 16.3, 17, 17.7, 15.5, 14.7, 15.8, 
19.9, 20.4, 23.3), december = c(19.8, 27, 21, 33, 22.6, 28.3, 
21.1, 19, 17.3, 27, 30.2, 24.8, 17.9, 17.9, 20.7, 30.9, 36.2, 
21, 20.2, 21.3), norm = c(45.8713463281901, 24.047250681782984, 
3.7533684144746324, 38.594241119279324, 26.391897460120358, 
61.746470001194638, 6.8321020448487992, 11.933109250115226, 
51.951891096493924, 37.424611852237945, 5.1587836676942374, 
36.552835044409434, 31.781209673851027, 29.09146215582853, 
4.856812959269508, 5.3982910143166514, 46.553976273304215, 
17.566272518985429, 20.552451905814117, 61.894775704479279
)), .Names = c(januari, februari, maart, april, mei, 
juni, juli, augustus, september, oktober, november, 
december, norm), row.names = c(NA, 20L), class = data.frame) 

I transform my dataset with the following script: 

y - melt(dataset,na.rm=TRUE) 
variable - y[,1] 
value - y[,2] 

and can then perform a levene test as follows: 

LEVENE - leveneTest(value~variable,y) 

When the dataset is small, lets say less than 100 values per column 
everything works great. I get the message: 

No id variables; using all as measure variables 

When the dataset is much bigger I get 

Re: [R] assign variables to function output

2015-04-16 Thread Jim Lemon
Hi merm,
In case Sergio's message is a little cryptic:

return_a_list-function() {
 a-First item of list
 b-c(2,4,6,8)
 c-matrix(1:9,nrow=3)
 return(list(a,b,c))
}

x-return_a_list()
x

Jim

On Thu, Apr 16, 2015 at 7:21 PM, Sergio Fonda sergio.fond...@gmail.com wrote:
 Collect in a vector or dataframe or list the variables of interest and
 output it.
 Il 16/apr/2015 10:57, merm pione...@student.unimelb.edu.au ha scritto:

 Hi!

 So I'm trying as the header suggests to assign the value(s) output by a
 function to a variable, say 'y'

 Problem is from what I gather any variables introduced within the function
 are contained and the only output I can get is return(value) which is
 awkward to work with. Any suggestions?

 Cheers!



 --
 View this message in context:
 http://r.789695.n4.nabble.com/assign-variables-to-function-output-tp4705920.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 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.

__
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] melt function chooses wrong id variable with large datasets

2015-04-16 Thread Joachim Audenaert
Hello,

This is a part of my dataset:

structure(list(januari = c(38.1, 32.4, 34.5, 20.7, 21.5, 23.1, 
29.7, 36.6, 36.1, 20.6, 20.4, 30.1, 38.7, 41.4, 37, 36, 37, 38, 
23, 26.7), februari = c(31.5, 36.2, 38.2, 26.4, 20.9, 21.5, 30.2, 
33.4, 32.6, 22.2, 21.7, 30, 35.7, 32.8, 39.3, 25.5, 23, 19.9, 
21.3, 20.8), maart = c(34.2, 27, 24.2, 19.9, 19.7, 21.5, 30.6, 
30, 19, 19.6, 20.6, 23.6, 17.9, 17.3, 21.4, 24.1, 20.9, 30.1, 
32.6, 21.3), april = c(26.3, 29.6, 30.3, 23.6, 28.4, 20.7, 24.1, 
27.3, 23.2, 18.3, 24.6, 27.4, 20.4, 18.1, 25.2, 19.8, 21, 23.7, 
19.6, 18.1), mei = c(23.7, 24, 17.2, 23.2, 25.2, 17.2, 16, 15.6, 
13.4, 16, 16.8, 14.6, 19.4, 21, 19.5, 18.5, 13.3, 13.7, 14.3, 
14.1), juni = c(17.7, 14.2, 16.6, 15.7, 13.7, 14.7, 13.1, 12.9, 
15.4, 11.9, 15.2, 15.3, 16.5, 16.1, 11.7, 11.2, 11.5, 10.8, 16.1, 
14.8), juli = c(15.7, 14.5, 10.8, 10.5, 13.4, 12.2, 13.2, 13, 
12.4, 13.1, 9.8, 10.5, 13.4, 11, 13.1, 15, 16.7, 16.1, 18.2, 
15.7), augustus = c(12.9, 12.8, 15.2, 14.5, 17.2, 14.5, 14.4, 
11, 13.1, 13.6, 14.6, 12.7, 13.6, 12.7, 15.5, 17.4, 15.2, 14.2, 
17.7, 19.2), september = c(15.6, 15.5, 15.9, 15.1, 16, 19.4, 
21.5, 23.7, 18.7, 23.8, 18, 16.2, 18.5, 20.6, 18.3, 22.5, 26.9, 
19.4, 15.9, 20.5), oktober = c(21.4, 20.8, 14, 17, 23, 26.4, 
19.6, 22.7, 26.9, 14.7, 15.2, 19.8, 26.9, 20.2, 14.3, 14.8, 18.5, 
21.7, 21.4, 21.8), november = c(24.7, 26.2, 29, 21.6, 17.1, 16.9, 
19.1, 24.7, 25.4, 19.8, 18.2, 16.3, 17, 17.7, 15.5, 14.7, 15.8, 
19.9, 20.4, 23.3), december = c(19.8, 27, 21, 33, 22.6, 28.3, 
21.1, 19, 17.3, 27, 30.2, 24.8, 17.9, 17.9, 20.7, 30.9, 36.2, 
21, 20.2, 21.3), norm = c(45.8713463281901, 24.047250681782984, 
3.7533684144746324, 38.594241119279324, 26.391897460120358, 
61.746470001194638, 6.8321020448487992, 11.933109250115226, 
51.951891096493924, 37.424611852237945, 5.1587836676942374, 
36.552835044409434, 31.781209673851027, 29.09146215582853, 
4.856812959269508, 5.3982910143166514, 46.553976273304215, 
17.566272518985429, 20.552451905814117, 61.894775704479279
)), .Names = c(januari, februari, maart, april, mei, 
juni, juli, augustus, september, oktober, november, 
december, norm), row.names = c(NA, 20L), class = data.frame)

I transform my dataset with the following script:

y - melt(dataset,na.rm=TRUE)
variable - y[,1] 
value - y[,2]

and can then perform a levene test as follows:

LEVENE - leveneTest(value~variable,y)

When the dataset is small, lets say less than 100 values per column 
everything works great. I get the message: 

No id variables; using all as measure variables

When the dataset is much bigger I get the following message

Using norm as id variables, why does this function pick norm as id 
variable? and how can I tell R that each column title is my variable

 
Met vriendelijke groeten - With kind regards,

Joachim Audenaert 
onderzoeker gewasbescherming - crop protection researcher

PCS | proefcentrum voor sierteelt - ornamental plant research

Schaessestraat 18, 9070 Destelbergen, Belgi�
T: +32 (0)9 353 94 71 | F: +32 (0)9 353 94 95
E: joachim.audena...@pcsierteelt.be | W: www.pcsierteelt.be 



From:   PIKAL Petr petr.pi...@precheza.cz
To: Joachim Audenaert joachim.audena...@pcsierteelt.be, 
r-help@r-project.org r-help@r-project.org
Date:   16/04/2015 12:13
Subject:RE: [R]  melt function chooses wrong id variable with 
large datasets



Hi

There is something weird with your data and melt function.

AFAIK melt does not use first row as id.variables.

What is result of

str(dataset)

Instead of

melt(dataset,id.vars=dataset[1,], na.rm=TRUE)

melt expects something like

melt(dataset, id.vars=c(norm, jaar), na.rm=TRUE)

If you want more specific answer you shall show us part of your data, 
preferably copy output of

dput(dataset[1:20,])

into your mail.

Cheers
Petr

 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Joachim
 Audenaert
 Sent: Thursday, April 16, 2015 11:37 AM
 To: r-help@r-project.org
 Subject: [R] melt function chooses wrong id variable with large
 datasets

 Hello all,

 I'm using a large dataset consisting of 2 groups of data, 2 columns in
 excel with a header (group name) and 15 000 rows of data. I would like
 like to compare this data, so I transform my dataset with the melt
 function to get 1 column of data and 1 column of ID variables, then I
 can apply different statistical tests. With small datasets this works
 great, the melt function automatically chooses the name in row 1 as ID
 variable and melts the data, thus giving me a matrix with all ID
 variables in column one and the data accordingly in column 2.
 With this big dataset however it chooses the whole first column as ID
 variables in stead of the first row. Is there a reason why this happens
 and how can I make sure the first row is chosen as ID variabele and the
 lower rows as data?

 If I specify that I want the first row to be the id variable I also get
 error.

 melt(dataset,id.vars=dataset[1,], na.rm=TRUE)

 Error: id variables 

Re: [R] Question with uniroot function

2015-04-16 Thread li li
Hi Jeff,
  Thanks for the reply. I am aware that the sign needs to be different at
the ends of the starting interval.

   Another question:

Is there a way to set the right end point ( (the upper argument in the
uniroot function below) as the point where the function takes on its
minimun, for example my function f1 below?

Thanks very much!



u1 - -3
u2 - 4
pi0 - 0.8

f1 - function(lambda,z,p1){
lambda*(p1*exp(u1*z-u1^2/2)+(0.2-p1)*exp(u2*z-u2^2/2))-(1-lambda)*pi0}

 x - seq(-20,20, by=0.1)
y - numeric(length(x))
for (i in 1:length(x)){y[i] - f1(x[i],p1=0.15,lambda=0.998)}
plot(y ~ x, ylim=c(-1,1))
abline(h=0)


a - uniroot(f1, lower =-10, upper = 0,
   tol = 1e-20,p1=0.15,lambda=0.998)$root





2015-04-15 22:57 GMT-04:00 Jeff Newmiller jdnew...@dcn.davis.ca.us:

 You really need to read the help page for uniroot. The sign needs to be
 different at the ends of the starting interval. This is a typical
 limitation of numerical root finders.
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 ---
 Sent from my phone. Please excuse my brevity.

 On April 15, 2015 7:20:04 PM PDT, li li hannah@gmail.com wrote:
 Hi all,
 In the following code, I am trying to use uniroot function to solve for
 the root (a and b in code below) for function f1.
 I am not sure why uniroot function does not give the answer since when
 we
 look the graph, the function does cross 0 twice.
 Any suggestion?
Thanks.
Hanna
 
 u1 - -3
 u2 - 4
 pi0 - 0.8
 
 f1 - function(lambda,z,p1){
 lambda*(p1*exp(u1*z-u1^2/2)+(0.2-p1)*exp(u2*z-u2^2/2))-(1-lambda)*pi0}
 
 a - uniroot(f1, lower =-10, upper = 0,
tol = 1e-20,p1=0.15,lambda=0.998)$root
 
 b - uniroot(f1, lower =0, upper = 10,
tol = 1e-20,p1=0.15,lambda=0.998)$root
 
 x - seq(-20,20, by=0.1)
 y - numeric(length(x))
 for (i in 1:length(x)){y[i] - f1(x[i],p1=0.15,lambda=0.998)}
 plot(y ~ x, ylim=c(-1,1))
 abline(h=0)
 
[[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
 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] function as variable name - probably better error message

2015-04-16 Thread peter dalgaard
Actually, to split a few hairs, I think the documentation is essentially 
correct. 

Reserved words are not the same as quoted strings. You cannot use them in 
syntactically the same way that you usually use variable names, as unquoted 
strings in expressions. They can BE variable names, or more precisely: object 
names. In fact they often are; you get in deep trouble if you redefine  `for`, 
`function`, or `if` -- as functions, at least. That goes for things like `{` 
too, by the way.

-pd

On 16 Apr 2015, at 13:38 , Duncan Murdoch murdoch.dun...@gmail.com wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512
 
 On 16/04/2015 6:19 AM, Rainer M Krug wrote:
 Hi
 
 The following code works as expected:
 
 
 list(plot=Not any more!)
 
 , |  plot - Not any more!) | [1] Not any more! `
 
 But for this I get an error:
 
 , |  function - Not any more! | Error: unexpected
 assignment in function - `
 
 The error message is quite cryptic and does not help much further.
 Would it be possible to provide a more useful error message in this
 case that (presumably) function is a reserved word?
 
 Along the same lines - is there a list of reserved words which can
 not be used in R as variable names (not even as elements in a a
 list())?
 
 The R Language Definition lists the reserved words (see section
 10.3.3).  It oversimplifies things, saying they can't be used as
 variable names, when in fact almost any string can be used with proper
 quoting.  For example, both of these work:
 
 function - Not any more!
 `function` - Not any more!
 
 Duncan Murdoch
 
 
 This is not a huge problem, but it cost me a few minutes of
 figuring out.
 
 Thanks,
 
 Rainer
 
 
 
 __ 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.
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
 Comment: GPGTools - https://gpgtools.org
 
 iQEcBAEBCgAGBQJVL58yAAoJEHE2Kz23YMZyyv0H/jKjwwkQ1v7jIRsZ9hxcJECU
 HHHuAEusv+pgJTybdxn66XykCXQOgaLmGPGksK+CcJrBgLW2WgAh4C0CUpN36DPn
 TOYpos9i3wZ8k0Idr8xiEeQ/PcD0pkMEwd6oYY0lL2Ikribu8maVKxcoYvjNIJOE
 3E3qrrpZfH9U2a9ws9jxJk8O3n+OQ7x8GQqUNTQHthd5McHZ63F7uIEBH/tHT7Tn
 x3gXAFbuSBJ6TtqaOZdPYFh3tV7CNyvJOso8yreSWK+0ZksXGKBtqElDJM0atrAj
 bOwEAJe6gGrEPx92NUWkTWeILDa6v96WZzprwLDi+cwt7jItILFligaXlookbf0=
 =vKWN
 -END PGP SIGNATURE-
 
 __
 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
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] Resumen de R-help-es, Vol 74, Envío 25

2015-04-16 Thread Gilsanz, Jose Luis
En realidad se trata de que nuestros colaboradores rellenen una especie de 
encuestas sobre mercados inmobiliarios locales con datos de precios, fotos de 
inmuebles representativos etc.

Tras la obtención de esos datos locales vendrá el proceso de análisis de ellos, 
pero eso será en una fase B que de momento esta muy lejana en el tiempo.


 Message: 4
 Date: Thu, 16 Apr 2015 09:11:33 -0500
 From: Patricio Fuenmayor Viteri patricio.fuenma...@outlook.com
 To: r-help-es r-help-es@r-project.org,
   jluis.gils...@tasacionesh.com
   jluis.gils...@tasacionesh.com
 Subject: Re: [R-es] Formulario Web
 Message-ID: blu182-w3301d394b9f265508c2ad299...@phx.gbl
 Content-Type: text/plain; charset=UTF-8

 Hola.Interesante tu proyecto... existen varias formas de enfocarlo:Supongo
 que lo que quieres hacer es implementar un modelo de calificaci?e clientes
 (scoring), esto lo menciono por lo detallas y por el lugar en donde 
 trabajas.- Si
 es as?lo que necesitas es tan solo programar el modelo
 (y=b0+b1x1+b2x2+...bnxn) que como entenderas es una suma y una
 validaci?on respecto a un intervalo de calificaciones (scoring)... que es muy
 sencillo... y no necesitas un motor de calculo poderoso.- Otra forma es que el
 servidor haga todo el trabajo... Tuve experiencia usando PL/R
 http://www.joeconway.com/plr/ (debes usar Postgres) donde el formulario
 (en PHP) llama al proceso que: guardaba en una tabla el registro de los datos,
 y ejecutaba un procedimiento (con PL/R) almacenado en el servidor y
 regresaba los resultados a la misma tabla, que luego era consultada por el
 formulario ... Con esto controlaba tanto el ingreso y salida de las variables 
 ... y
 todo el trabajo fuerte lo hacia el servidor... Espero te sea de ayuda Saludos.
 --Archivo adjunto de mensaje reenviado--From:
 jluis.gils...@tasacionesh.com
 To: r-help-es@r-project.org
 Date: Thu, 16 Apr 2015 09:44:56 +
 Subject: [R-es] Formulario Web

 Hola:

 Tengo un absoluto desconocimiento de las posibilidades que ofrece R desde
 el punto de vista web as?ue agradecer?que alguien me ?encaminara? para
 un proyecto que me est?ondando.

 El proyecto consistir?b?camente en montar una especie de formulario web al
 cual acceder? distintas personas (colaboradores) repartidas por Espa?El
 formulario tendr?una serie de datos precargados y el colaborador
 deber?cumplimentar el resto de datos faltantes.
 Una vez cumplimentados todos los datos, estos se deben guardar en alguna
 estructura de datos (dataframe???) o alg?po de BBDD para su posterior
 explotaci?stad?ica (esta ser?la parte B del proyecto)

 En esencia el formulario deber?poder:
 -Introducir valores de tipo texto o n? as?omo valores de tipo combobox
 (valores pautados previamente),o lo que ser?un factor en R.
 -Subir documentos (fundamentalmente fotos y pdf) asociados al registro que
 se est?ditando.
 -Ser capaz de mostrar a cada usuario ?mente los registros que tiene que
 rellenar puesto que los registros se distribuir?entre los colaboradores por
 criterios geogr?cos . De esta manera un colaborador residente en Madrid
 solo ?vera? los registros relativos a Madrid y no los del resto de provincias.
 -Mostrar mapas, gr?cos, fotos ?incrustados? en el propio formulario web a
 medida que se van introduciendo datos y/o subiendo documentos.

 L?amente la mejor forma de hacer esto es usando lenguajes de
 programaci?eb (html, java, php etc) asociados a gestores de bases de datos
 (SQL server, mySQL etc) pero mi desaf?consiste en hacer TODO el proceso
 (Tanto la captura como la explotaci?e los datos) dentro de R, aun cuando
 puedan usarse sistemas auxiliares conectados a R.

 Os agradezco desde ya cualquier sugerencia o comentario.

 Un cordial saludo



Jones Lang LaSalle Arquitectura, SLU
Registration number: B-61888715
Registered Office: Pº de la Castellana, 51 - 5ª ; 28046 Madrid


This e-mail is for the use of the intended recipient(s) only. If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it. If you are not the intended recipient, you must not use, disclose or 
distribute this e-mail without the author's prior permission. We have taken 
precautions to minimise the risk of transmitting software viruses, but we 
advise you to carry out your own virus checks on any attachment to this 
message. We cannot accept liability for any loss or damage caused by software 
viruses. If you are the intended recipient and you do not wish to receive 
similar electronic messages from us in future then please respond to the sender 
to this effect.
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] assign variables to function output

2015-04-16 Thread Sergio Fonda
That's it ! Sorry for writing in a hurry, Merm!
Il 16/apr/2015 14:14, Jim Lemon drjimle...@gmail.com ha scritto:

 Hi merm,
 In case Sergio's message is a little cryptic:

 return_a_list-function() {
  a-First item of list
  b-c(2,4,6,8)
  c-matrix(1:9,nrow=3)
  return(list(a,b,c))
 }

 x-return_a_list()
 x

 Jim

 On Thu, Apr 16, 2015 at 7:21 PM, Sergio Fonda sergio.fond...@gmail.com
 wrote:
  Collect in a vector or dataframe or list the variables of interest and
  output it.
  Il 16/apr/2015 10:57, merm pione...@student.unimelb.edu.au ha
 scritto:
 
  Hi!
 
  So I'm trying as the header suggests to assign the value(s) output by a
  function to a variable, say 'y'
 
  Problem is from what I gather any variables introduced within the
 function
  are contained and the only output I can get is return(value) which is
  awkward to work with. Any suggestions?
 
  Cheers!
 
 
 
  --
  View this message in context:
 
 http://r.789695.n4.nabble.com/assign-variables-to-function-output-tp4705920.html
  Sent from the R help mailing list archive at Nabble.com.
 
  __
  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.

 __
 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-es] Resumen de R-help-es, Vol 74, Envío 25

2015-04-16 Thread Gilsanz, Jose Luis
Estimado Javier:

Los colaboradores en este caso no son clientes sino personas vinculadas a la 
empresa por lo que el tema del rendimiento, de momento, no me preocupa 
demasiado.
Me interesa mas saber  que , efectivamente, se puede hacer a que luego una vez 
hecho la cosa funcione mas o menos rapida


 Message: 5
 Date: Thu, 16 Apr 2015 11:19:08 -0300
 From: Javier Marcuzzi javier.ruben.marcu...@gmail.com
 To: Miguel Angel Rodriguez Muiños
   miguel.angel.rodriguez.mui...@sergas.es
 Cc: r-help-es r-help-es@r-project.org
 Subject: Re: [R-es] Formulario Web
 Message-ID:
   CAHo_aETBJH2w96WjPBc_V6n_XaLm8_bok__Y10g5vJrriYobbQ@m
 ail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 Estimado Miguel

 Por ejemplo yo mismo podría colocar algo en un servidor VPS, utilizar un
 servicio rest para la ida y venida de información, pero los servicios más
 económicos creo que pueden ser muy limitados, ¿a partir de donde R en un
 VPS da un resultado aceptable? Porque el usuario web necesita rápido algo
 en la pantalla, aunque sea un mensaje de procesando, yo había leído un
 informe sobre cuánto tiempo esperan y a partir de ahí se van a otro sitio o
 comienzan a sentir molestias, no lo recuerdo bien pero los internautas son
 muy ya y ahora. Yo creo que si es un problema, no por la técnica
 informática, sino por la experiencia de usuario (de los posibles clientes), 
 sería
 una lástima que trabaje en R realizando un excelente desarrollo y pierda
 clientes porque estos ven un servicio lento.



Jones Lang LaSalle Arquitectura, SLU
Registration number: B-61888715
Registered Office: Pº de la Castellana, 51 - 5ª ; 28046 Madrid


This e-mail is for the use of the intended recipient(s) only. If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it. If you are not the intended recipient, you must not use, disclose or 
distribute this e-mail without the author's prior permission. We have taken 
precautions to minimise the risk of transmitting software viruses, but we 
advise you to carry out your own virus checks on any attachment to this 
message. We cannot accept liability for any loss or damage caused by software 
viruses. If you are the intended recipient and you do not wish to receive 
similar electronic messages from us in future then please respond to the sender 
to this effect.
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] Las VII Jornadas de Usuarios de R, en Salamanca en noviembre

2015-04-16 Thread Olivier Nuñez
Estupenda pagina Web para unas estupendas jornadas.
Gracias por vuestro trabajo.
Un saludo. Olivier

- Mensaje original -
De: Carlos J. Gil Bellosta gilbello...@gmail.com
Para: r-help-es r-help-es@r-project.org
Enviados: Lunes, 13 de Abril 2015 22:10:52
Asunto: [R-es] Las VII Jornadas de Usuarios de R, en Salamanca en noviembre

Hola, ¿qué tal?

Ya se han anunciado públicamente las VII Jornadas de Usuarios de R.
Tendrán lugar en Salamanca los días 5 y 6 de noviembre de 2015.

Los detalles pueden consultarse en

http://r-es.org/7jornadasR/

En nombre de los comités científico y coordinador y de otros
voluntarios que han colaborado en su arranque, quiero invitaros a
asistir y a participar en ellas.

Como todos los años, habrá presentaciones y talleres. También
actividades sociales e intercambio de ideas. Y nos veremos las caras
algunos de quienes escribimos a menudo por aquí.

Un saludo,

Carlos J. Gil Bellosta
http://www.datanalytics.com

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

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


Re: [R-es] Resumen de R-help-es, Vol 74, Envío 25

2015-04-16 Thread Gilsanz, Jose Luis
Javier, Miguel:

Efectivamente hay maneras infinitamente más eficientes a la hora de montar el 
proyecto con soluciones específicas de web.

Pero en este caso como lo que pretendo, fundamentalmente, es profundizar en lo 
que Javier mismo ha denominado webR por lo que  no contemplo esas soluciones 
especificas (si acaso solo como apoyo a R).
Básicamente se trata de hacerlo todo con R, aun sabiendo desde el principio, 
que seguro que no es la mejor forma de hacerlo (sobre todo en lo referente a 
sencillez y rendimiento).

Llevando el caso al extremo, seria como intentar hacer un procesador de textos 
utilizando Excel, la mayoría diría pero si para eso ya tienes Word y mil 
aplicaciones más adecuadas y mi respuesta seria ya, lo sé, pero es que yo 
quiero hacerlo con Excel aunque no sea ni el mejor, ni el más rápido ni el más 
bonito.



 Message: 3
 Date: Thu, 16 Apr 2015 10:52:12 +
 From: miguel.angel.rodriguez.mui...@sergas.es
 To: javier.ruben.marcu...@gmail.com
 Cc: r-help-es@r-project.org
 Subject: Re: [R-es] Formulario Web
 Message-ID: 552f945c.5050...@sergas.es
 Content-Type: text/plain; charset=UTF-8
 
 Hola Javier.
 
 No veo demasiado problema con el tema del servidor. Las opciones son dos:
 o lo tienes in situ (con lo cual habrás hecho una valoración de qué recursos
 te hacen falta, cómo vas a implementarlo y cómo vas a mantenerlo, como
 con cualquier otro servicio web) o lo implementas en la nube (idem que el
 caso anterior con la salvedad de que hay ciertos aspectos que subcontratas -
 pagas por ellos y te despreocupas-).
 
 Yo soy más partidario de la segunda opción y montar un buen VPS, pero para
 gustos
 
 En el caso concreto del escenario que plantea José Luis (que es el que nos ha
 llevado hasta aquí), la solución pasa por montarlo todo con R (según sus
 especificaciones) y, así, creo que Shiny es una muy buena alternativa.
 
 Un Saludo,
 Miguel.
 
 
 
 El 16/04/2015 a las 12:39, Javier Marcuzzi escribió:
 Estimado Miguel
 
 Es posible lo que dices, pero ¿tienes un servidor para instalar la parte de 
 R?, si
 lo tienes ¿cuántos recursos? Me refiero a lo siguiente, puede ser que su
 trabajo esté excelente, pero los recursos del servidor al procesar R tengan un
 desmedro en la calidad (velocidad) http y de base de datos, creando una
 experiencia mala para el usuario.
 
 Hay alternativas, cada vez hay más web R, desconozco la solución
 recomendable hoy en día, sin embargo creo que hay que tener muy en
 cuenta el servidor, y ese factor puede ser de mucho peso en caso de ser
 deficiente.
 
 Shiny , es conocido, o por lo menos es una opción de moda por decirlo de
 alguna forma, sin embargo creo que podría escribir R desde casi un
 obsoleto cgi-bin. Entiendo que no habría limitantes más que su creatividad.
 
 Javier Marcuzzi
 
 El 16 de abril de 2015, 6:57,
 miguel.angel.rodriguez.mui...@sergas.esmailto:miguel.angel.rodriguez.
 mui...@sergas.es escribió:
 Hola José Luis.
 
 Mi recomendación es que explores Shiny (http://shiny.rstudio.com/), puede
 que sea lo que necesitas.
 
 Un Saludo,
 Miguel Ángel Rodríguez Muíños
 Consellería de Sanidade
 Xunta de Galicia
 
 
 
 
 
 
 Nota: A información contida nesta mensaxe e os seus posibles documentos
 adxuntos é privada e confidencial e está dirixida únicamente ó seu
 destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe,
 por favor elimínea. A distribución ou copia desta mensaxe non está
 autorizada.
 
 Nota: La información contenida en este mensaje y sus posibles documentos
 adjuntos es privada y confidencial y está dirigida únicamente a su
 destinatario/a. Si usted no es el/la destinatario/a original de este mensaje,
 por favor elimínelo. La distribución o copia de este mensaje no está
 autorizada.
 
 See more languages: http://www.sergas.es/aviso_confidencialidad.htm
 
   [[alternative HTML version deleted]]
 
 
 --
 
 Message: 4
 Date: Thu, 16 Apr 2015 09:11:33 -0500
 From: Patricio Fuenmayor Viteri patricio.fuenma...@outlook.com
 To: r-help-es r-help-es@r-project.org,
   jluis.gils...@tasacionesh.com
   jluis.gils...@tasacionesh.com
 Subject: Re: [R-es] Formulario Web
 Message-ID: blu182-w3301d394b9f265508c2ad299...@phx.gbl
 Content-Type: text/plain; charset=UTF-8
 
 Hola.Interesante tu proyecto... existen varias formas de enfocarlo:Supongo
 que lo que quieres hacer es implementar un modelo de calificaci?e clientes
 (scoring), esto lo menciono por lo detallas y por el lugar en donde 
 trabajas.- Si
 es as?lo que necesitas es tan solo programar el modelo
 (y=b0+b1x1+b2x2+...bnxn) que como entenderas es una suma y una
 validaci?on respecto a un intervalo de calificaciones (scoring)... que es muy
 sencillo... y no necesitas un motor de calculo poderoso.- Otra forma es que el
 servidor haga todo el trabajo... Tuve experiencia usando PL/R
 http://www.joeconway.com/plr/ (debes usar Postgres) donde el formulario
 (en PHP) llama al proceso que: guardaba en 

[R] FW: New package apex 1.0.0 released on CRAN

2015-04-16 Thread Jombart, Thibaut

Dear all,

(apologies for multiple posting)

On behalf of the apex development team (E. Paradis, K. Schliep, Z. Kamvar, R. 
Harris and myself), I am happy to announce that apex has been released on CRAN:
http://cran.r-project.org/web/packages/apex/index.html

This package provides tools for reading, storing, handling and analysing 
genetic sequences from multiple genes, and is compatible with both ape and 
phangorn.

For more information on apex, questions, requests, or to join us, check our 
github project at:
https://github.com/thibautjombart/apex

Best regards
Thibaut

==
Dr Thibaut Jombart
MRC Centre for Outbreak Analysis and Modelling
Department of Infectious Disease Epidemiology
Imperial College - School of Public Health
Norfolk Place, London W2 1PG, UK
Tel. : 0044 (0)20 7594 3658
http://sites.google.com/site/thibautjombart/
http://sites.google.com/site/therepiproject/
http://adegenet.r-forge.r-project.org/
Twitter: @thibautjombart


___
R-sig-genetics mailing list
r-sig-genet...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-genetics

__
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] FW: New package apex 1.0.0 released on CRAN

2015-04-16 Thread Bert Gunter
This sounds more appropriate for Bioconductor, if you haven't already
submitted/announced it there.

Cheers,
Bert

On Thursday, April 16, 2015, Jombart, Thibaut t.jomb...@imperial.ac.uk
wrote:


 Dear all,

 (apologies for multiple posting)

 On behalf of the apex development team (E. Paradis, K. Schliep, Z. Kamvar,
 R. Harris and myself), I am happy to announce that apex has been released
 on CRAN:
 http://cran.r-project.org/web/packages/apex/index.html

 This package provides tools for reading, storing, handling and analysing
 genetic sequences from multiple genes, and is compatible with both ape and
 phangorn.

 For more information on apex, questions, requests, or to join us, check
 our github project at:
 https://github.com/thibautjombart/apex

 Best regards
 Thibaut

 ==
 Dr Thibaut Jombart
 MRC Centre for Outbreak Analysis and Modelling
 Department of Infectious Disease Epidemiology
 Imperial College - School of Public Health
 Norfolk Place, London W2 1PG, UK
 Tel. : 0044 (0)20 7594 3658
 thibautjombart http://sites.google.com/site/thibautjombart/
 therepiproject http://sites.google.com/site/therepiproject/
 http://adegenet.r-forge.r-project.org/
 Twitter: @thibautjombart


 ___
 R-sig-genetics mailing list
 r-sig-genet...@r-project.org javascript:;
 https://stat.ethz.ch/mailman/listinfo/r-sig-genetics

 __
 R-help@r-project.org javascript:; 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

Data is not information. Information is not knowledge. And knowledge is
certainly not wisdom.
Clifford Stoll

[[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] Question with uniroot function

2015-04-16 Thread William Dunlap
Use optimize() to find the minimum and feed that value into uniroot().

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Thu, Apr 16, 2015 at 7:47 AM, li li hannah@gmail.com wrote:

 Hi Jeff,
   Thanks for the reply. I am aware that the sign needs to be different at
 the ends of the starting interval.

Another question:

 Is there a way to set the right end point ( (the upper argument in the
 uniroot function below) as the point where the function takes on its
 minimun, for example my function f1 below?

 Thanks very much!



 u1 - -3
 u2 - 4
 pi0 - 0.8

 f1 - function(lambda,z,p1){
 lambda*(p1*exp(u1*z-u1^2/2)+(0.2-p1)*exp(u2*z-u2^2/2))-(1-lambda)*pi0}

  x - seq(-20,20, by=0.1)
 y - numeric(length(x))
 for (i in 1:length(x)){y[i] - f1(x[i],p1=0.15,lambda=0.998)}
 plot(y ~ x, ylim=c(-1,1))
 abline(h=0)


 a - uniroot(f1, lower =-10, upper = 0,
tol = 1e-20,p1=0.15,lambda=0.998)$root





 2015-04-15 22:57 GMT-04:00 Jeff Newmiller jdnew...@dcn.davis.ca.us:

  You really need to read the help page for uniroot. The sign needs to be
  different at the ends of the starting interval. This is a typical
  limitation of numerical root finders.
 
 ---
  Jeff NewmillerThe .   .  Go
 Live...
  DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
  Go...
Live:   OO#.. Dead: OO#..  Playing
  Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
  /Software/Embedded Controllers)   .OO#.   .OO#.
 rocks...1k
 
 ---
  Sent from my phone. Please excuse my brevity.
 
  On April 15, 2015 7:20:04 PM PDT, li li hannah@gmail.com wrote:
  Hi all,
  In the following code, I am trying to use uniroot function to solve for
  the root (a and b in code below) for function f1.
  I am not sure why uniroot function does not give the answer since when
  we
  look the graph, the function does cross 0 twice.
  Any suggestion?
 Thanks.
 Hanna
  
  u1 - -3
  u2 - 4
  pi0 - 0.8
  
  f1 - function(lambda,z,p1){
  lambda*(p1*exp(u1*z-u1^2/2)+(0.2-p1)*exp(u2*z-u2^2/2))-(1-lambda)*pi0}
  
  a - uniroot(f1, lower =-10, upper = 0,
 tol = 1e-20,p1=0.15,lambda=0.998)$root
  
  b - uniroot(f1, lower =0, upper = 10,
 tol = 1e-20,p1=0.15,lambda=0.998)$root
  
  x - seq(-20,20, by=0.1)
  y - numeric(length(x))
  for (i in 1:length(x)){y[i] - f1(x[i],p1=0.15,lambda=0.998)}
  plot(y ~ x, ylim=c(-1,1))
  abline(h=0)
  
 [[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
  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.


[[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] Error when loading shared library - stringini()

2015-04-16 Thread arnaud gaboury
On Thu, Apr 16, 2015 at 3:25 PM, arnaud gaboury arnaud.gabo...@gmail.com
wrote:

 On a Linux 64 bits, R.3.1.2, with tidyr() loaded.

 gabx@hortensia [R] separate(rawStats, 'toto')
 Error in dyn.load(file, DLLpath = DLLpath, ...) :
   unable to load shared object
 '/developement/language/r/library/stringi/libs/stringi.so':
   libicui18n.so.54: cannot open shared object file: No such file or
 directory
 

 When trying to upgrade stringini(), it is not available for 3.1.2


 install_github('Rexamine/stringi')

did the trick


 My box run :icu 55.1-1  :lib32-icu 55.1-1

 If I am right, I need to downgrade to 54 to be able to run separate()
 from tidyr package? Or is there any other way?

 Thank you for hint.


 --

 google.com/+arnaudgabourygabx




-- 

google.com/+arnaudgabourygabx
https://plus.google.com/_/notifications/emlink?emr=05814804238976922326emid=CKiv-v6PvboCFcfoQgod6msAAApath=%2F116159236040461325607%2Fop%2Fudt=1383086841306ub=50

[[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.


[R] problem in the ensemblaBMA package of R

2015-04-16 Thread maaba
hello,

I'm working in ensembleBMA package of R and i need to use the
ensembleBMAgamma0 function to correct my precipitation.
How can i change my training period ?. I have to chose a training period for
4 days which contains a 2 days before the specific day and 2 days after the
specific day. I don't need to chose only the days before my specific day.

Someone have an idea how i can do that ?

Thanks



--
View this message in context: 
http://r.789695.n4.nabble.com/problem-in-the-ensemblaBMA-package-of-R-tp4705946.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Fwd: Using Geographic Information Systems and Remote Sensing to study disease vector habitat

2015-04-16 Thread Giuseppe Amatulli
HI,
Apologies for cross-posting:
This is a good opportunity for start to learn GIS and Statistical Analysis
(R) with open-source software.

*Workshop: **Using Geographic Information Systems and Remote Sensing to
study disease vector habitat*

Biotechonology Research Institute
http://www.kalro.org/Biotechnology_Research_Institute (BRI) in
collaboration with  Yale University (School of Public Helath
http://publichealth.yale.edu/, Institute for Biospehric Studies
http://yibs.yale.edu/ and the Department of Ecology and Evolutionary
Biology http://eeb.yale.edu/) invites applications for a geospatial
analysis workshop to be held on June  *1 - 6,  2015 *at TRC Campus in
Muguga Kenya.

*The workshop will *introduce participants to Geographic Information
Systems (GIS) and satellite-based remote sensing technologies.   Students
will use the provided suite of *open-source software* (GRASS, R, QGIS,
PKTOOLS) to manipulate GIS data and satellite images to create basic
species habitat models with R ( library(hSDM) ) .  There will be a special
focus on identifying and mapping tsetse fly habitat.

Registration info and contact persons at
http://www.funai.edu.ng/call-for-applications
Best
Rigards

-- 
Giuseppe Amatulli, Ph.D.

Department of Ecology and Evolutionary Biology, Yale University.
Jetz Lab, OML Room 405

P.O. Box 208106
New Haven, CT 06520-8106
Teaching: spatial-ecology.net
Work:  http://sbsc.yale.edu/giuseppe-amatulli
http://www.spatial-ecology.net



-- 
Giuseppe Amatulli, Ph.D.

Department of Ecology and Evolutionary Biology, Yale University.
Jetz Lab, OML Room 405

P.O. Box 208106
165 PROSPECT ST
New Haven, CT 06520-8106
Teaching: spatial-ecology.net
Work:  http://sbsc.yale.edu/giuseppe-amatulli
http://www.spatial-ecology.net

[[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.


[R] Error when loading shared library - stringini()

2015-04-16 Thread arnaud gaboury
On a Linux 64 bits, R.3.1.2, with tidyr() loaded.

gabx@hortensia [R] separate(rawStats, 'toto')
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object
'/developement/language/r/library/stringi/libs/stringi.so':
  libicui18n.so.54: cannot open shared object file: No such file or directory


When trying to upgrade stringini(), it is not available for 3.1.2

My box run :icu 55.1-1  :lib32-icu 55.1-1

If I am right, I need to downgrade to 54 to be able to run separate()
from tidyr package? Or is there any other way?

Thank you for hint.


-- 

google.com/+arnaudgabourygabx

__
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] vi[m] editing of past commands in R command line

2015-04-16 Thread paul
When I use bash + readline and ~/.inputrc contains editing-mode vi, I can 
press v to switch to from the command line editing to a full vi session 
editing of a command.  This doesn't seem to happen in R.  Is there a 
configuration setting/file that I can set to get this behaviour?

Furthermore, when using bash, the fc command allows me to edit the history 
of commands, and when I exit the editor, all the remaining (and likely 
modified) commands are submitted to the bash shell as if I typed them at 
the prompt.  Is there a way to get similar functionality in R?

__
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] Obfuscate AES password

2015-04-16 Thread Luca Cerone
Thanks Robert, but is not exactly what I need :)

I am simply trying to find a way to encrypt some data in a way that
doesn't require the user to type any password (if not only the first
time)
but that is secure enough in a multi-user environment.

E.g. I do not want super user to be able to access my data because
they can read the AES key.

Hope this is a bit clearer,

Thanks a lot for your help!

Cheers,
Luca

On Tue, Apr 14, 2015 at 3:15 PM, Robert Baer rb...@atsu.edu wrote:
 I'm not sure I completely understand your authentication needs, but perhaps
 the RCurl package could be of some use to you.

 Rob


 On 4/13/2015 1:26 AM, Luca Cerone wrote:

 Thanks Jeff,
 and OK I'll move next questions on the topic to the devel list :)

 I was hoping there were packages that already dealt with this sort of
 things, that's why I posted my question here in the first place..

 Thanks a lot for helping me with this,

 Cheers,
 Luca

 [[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.


 --


 Robert W. Baer, Ph.D.
 Professor of Physiology
 Kirksville College of Osteopathic Medicine
 A T Still University of Health Sciences
 800 W. Jefferson St
 Kirksville, MO 63501
 rbaer(at)atsu.edu


__
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 help leaves out lines of text

2015-04-16 Thread paul
Duncan Murdoch murdoch.duncan at gmail.com writes:
 The Cygwin release is not supported by us, and is known to be buggy,
 because it doesn't handle line endings properly.

 You'll need to talk to the Cygwin folks if you can't reproduce this
 in one of our releases available from
 cran.r-project.org/bin/windows/base.

Paul paul.domaskis at gmail.com wrote:
 Installing things is always challenging in a locked down
 environment.  I'll post on a cygwin forum.  Thanks.

By the way, if it's just a DOS vs. UNIX line-ending issue, are the
help files stored in such a way that I can simply run them through
unix2dos (or vice-versa), or possibly use the unix tr command to
perform some other kind of conversion?

__
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] (no subject)

2015-04-16 Thread paul
Duncan Murdoch murdoch.duncan at gmail.com writes:
 The Cygwin release is not supported by us, and is known to be buggy,
 because it doesn't handle line endings properly.

 You'll need to talk to the Cygwin folks if you can't reproduce this
 in one of our releases available from
 cran.r-project.org/bin/windows/base.

Installing things is always challenging in a locked down environment.
I'll post on a cygwin forum.  Thanks.

__
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] Extracting xml data to data frames

2015-04-16 Thread John Kane
No attachment : R-help is rather fussy about the files it will accept. You are 
probably okay with .txt .pdf, or png but even .csv is likely to get stripped.  

The best way to supply data is by using dput()  .  Type ?dput for information 
or have a look at  http://adv-r.had.co.nz/Reproducibility.html for some hints.  


John Kane
Kingston ON Canada


 -Original Message-
 From: g.ru...@bham.ac.uk
 Sent: Thu, 16 Apr 2015 17:57:44 +
 To: r-help@r-project.org
 Subject: [R] Extracting xml data to data frames
 
 Hi Rgonauts,
 
 I am trying to parse some xml files of transport data using the
 TransExchange format (in this case bus routing information) and obtain
 some data.frames for onward processing for a GIS related task.  Ideally I
 need them in .csv files.
 
 Each file (an example is attached) contains up to 8 tables of information
 about transport operators and routing information.  I have uploaded an
 example that contains all 8.  In fact I have some hundreds of similar
 files that will need processing. So when I've solved this I will need to
 be able to loop through a bunch of them.
 
 I'm new to handling xml data and to the xml package so I don't really
 know what I'm doing, this is my first stab at using the xml package.
 So far the workflow goes something like this.
 
 #get the file
 doc=xmlTreeParse(cen_18-23-D-y11-2.xml)
 top=xmlRoot(doc)
 
 #look at the names
 top=xmlRoot(doc)
 
 #pick one of them to use, in this case the forth one, 'routes', a table
 of information about this particular bus route. using some code from
 another forum post, I can get a data.frame with the info i need in it.
 OK I need to do some reshaping but I can handle that later
 
 fr4-(top[[4]])
 fr4
 xmlSApply(fr4,function(x) xmlSApply(x,xmlValue))
 df-as.data.frame(xmlSApply(fr4,function(x) xmlSApply(x,xmlValue)))
 df
 
 #this works but when I try it with another table, the fifth one say, that
 captures information about the parts of the journey between stops, it
 falls over.
 
 fr5-(top[[5]])
 fr5
 xmlSApply(fr5,function(x) xmlSApply(x,xmlValue))
 df-as.data.frame(xmlSApply(fr5,function(x) xmlSApply(x,xmlValue)))
 df
 
 Now I guess there is an irregularity in the xml causing this.  I gather
 from other posts I should use Xpath functionality to interrogate this
 section of the data. I've tried reverse engineering some of these
 commands I've seen in solutions to irregular xml problems on other forums
 but not got to what I want. I'm not really up on xml, but I am assuming
 it is something to do with the JourneySectionPattern id= part of
 the file is what is causing the problem?  This looks like there should be
 a field called JouneyPattern ID (only I guess without the space) and then
 the ID code as the actual field contents.
 
 So my question is, is there a way to parse this table correctly and
 output the resulting df as a csv?
 
 All help gratefully recieved.  BTW the link to the searhable r-help
 archives seems to be broken.
 
 GavinR
 
 
 
 
 __
 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.


FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks  orcas on your 
desktop!

__
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] regression of values in one stack with another

2015-04-16 Thread John Wasige
D
​ear community,

This is to kindly request for your help.
 I have an error from regression of values in one stack with another
# s1 and s2 have 720 layers; coefficients[2] is the slope


### script
rstack1 - stack(s1,s2)
s - stack('D:/Correlation/rstack.tif')
fun - function(x) { lm(x[1:360] ~ x[361:720])$coefficients[2] }
x1 - calc(s, fun)

I get the following error:

Error in .calcTest(x[1:5], fun, na.rm, forcefun, forceapply) : cannot
use this function

Many thanks for your help in sloving this problem

John

​

[[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.

[R] Extracting xml data to data frames

2015-04-16 Thread Gavin Rudge
Hi Rgonauts,

I am trying to parse some xml files of transport data using the TransExchange 
format (in this case bus routing information) and obtain some data.frames for 
onward processing for a GIS related task.  Ideally I need them in .csv files.

Each file (an example is attached) contains up to 8 tables of information about 
transport operators and routing information.  I have uploaded an example that 
contains all 8.  In fact I have some hundreds of similar files that will need 
processing. So when I've solved this I will need to be able to loop through a 
bunch of them.

I'm new to handling xml data and to the xml package so I don't really know what 
I'm doing, this is my first stab at using the xml package.
So far the workflow goes something like this.

#get the file
doc=xmlTreeParse(cen_18-23-D-y11-2.xml)
top=xmlRoot(doc)

#look at the names
top=xmlRoot(doc)

#pick one of them to use, in this case the forth one, 'routes', a table of 
information about this particular bus route. using some code from another forum 
post, I can get a data.frame with the info i need in it.  OK I need to do some 
reshaping but I can handle that later

fr4-(top[[4]])
fr4
xmlSApply(fr4,function(x) xmlSApply(x,xmlValue))
df-as.data.frame(xmlSApply(fr4,function(x) xmlSApply(x,xmlValue)))
df

#this works but when I try it with another table, the fifth one say, that 
captures information about the parts of the journey between stops, it falls 
over.

fr5-(top[[5]])
fr5
xmlSApply(fr5,function(x) xmlSApply(x,xmlValue))
df-as.data.frame(xmlSApply(fr5,function(x) xmlSApply(x,xmlValue)))
df

Now I guess there is an irregularity in the xml causing this.  I gather from 
other posts I should use Xpath functionality to interrogate this section of the 
data. I've tried reverse engineering some of these commands I've seen in 
solutions to irregular xml problems on other forums but not got to what I want. 
I'm not really up on xml, but I am assuming it is something to do with the 
JourneySectionPattern id= part of the file is what is causing the 
problem?  This looks like there should be a field called JouneyPattern ID (only 
I guess without the space) and then the ID code as the actual field contents.

So my question is, is there a way to parse this table correctly and output the 
resulting df as a csv?

All help gratefully recieved.  BTW the link to the searhable r-help archives 
seems to be broken. 

GavinR




__
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: Redefine default parameter values for help.start()

2015-04-16 Thread paul
Because of the setup of R in cygwin, help.start() requires the
following parameter values:

help.start(browser=cygstart,remote=R.home())

Is it possible to make these values the default?

I do not want cygstart to be the browser except as a parameter for
help.start().

__
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] Question with uniroot function

2015-04-16 Thread li li
Thank you.



2015-04-16 12:33 GMT-04:00 William Dunlap wdun...@tibco.com:

 Use optimize() to find the minimum and feed that value into uniroot().

  Bill Dunlap
 TIBCO Software
 wdunlap tibco.com

  On Thu, Apr 16, 2015 at 7:47 AM, li li hannah@gmail.com wrote:

  Hi Jeff,
   Thanks for the reply. I am aware that the sign needs to be different at
 the ends of the starting interval.

Another question:

 Is there a way to set the right end point ( (the upper argument in the
 uniroot function below) as the point where the function takes on its
 minimun, for example my function f1 below?

 Thanks very much!



 u1 - -3
 u2 - 4
 pi0 - 0.8

 f1 - function(lambda,z,p1){
 lambda*(p1*exp(u1*z-u1^2/2)+(0.2-p1)*exp(u2*z-u2^2/2))-(1-lambda)*pi0}

  x - seq(-20,20, by=0.1)
 y - numeric(length(x))
 for (i in 1:length(x)){y[i] - f1(x[i],p1=0.15,lambda=0.998)}
 plot(y ~ x, ylim=c(-1,1))
 abline(h=0)


 a - uniroot(f1, lower =-10, upper = 0,
tol = 1e-20,p1=0.15,lambda=0.998)$root





 2015-04-15 22:57 GMT-04:00 Jeff Newmiller jdnew...@dcn.davis.ca.us:

  You really need to read the help page for uniroot. The sign needs to be
  different at the ends of the starting interval. This is a typical
  limitation of numerical root finders.
 
 ---
  Jeff NewmillerThe .   .  Go
 Live...
  DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
  Go...
Live:   OO#.. Dead: OO#..  Playing
  Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
  /Software/Embedded Controllers)   .OO#.   .OO#.
 rocks...1k
 
 ---
  Sent from my phone. Please excuse my brevity.
 
  On April 15, 2015 7:20:04 PM PDT, li li hannah@gmail.com wrote:
  Hi all,
  In the following code, I am trying to use uniroot function to solve for
  the root (a and b in code below) for function f1.
  I am not sure why uniroot function does not give the answer since when
  we
  look the graph, the function does cross 0 twice.
  Any suggestion?
 Thanks.
 Hanna
  
  u1 - -3
  u2 - 4
  pi0 - 0.8
  
  f1 - function(lambda,z,p1){
  lambda*(p1*exp(u1*z-u1^2/2)+(0.2-p1)*exp(u2*z-u2^2/2))-(1-lambda)*pi0}
  
  a - uniroot(f1, lower =-10, upper = 0,
 tol = 1e-20,p1=0.15,lambda=0.998)$root
  
  b - uniroot(f1, lower =0, upper = 10,
 tol = 1e-20,p1=0.15,lambda=0.998)$root
  
  x - seq(-20,20, by=0.1)
  y - numeric(length(x))
  for (i in 1:length(x)){y[i] - f1(x[i],p1=0.15,lambda=0.998)}
  plot(y ~ x, ylim=c(-1,1))
  abline(h=0)
  
 [[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
 http://www.r-project.org/posting-guide.html
  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
 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.