Re: [R] problem with nlme, environments, and packages

2015-06-16 Thread Greg Hather
Hi Duncan, I checked the global environment, and it was empty, so I think that rules out the second possibility. I posted a tarball at https://drive.google.com/file/d/0B8hBX90jtuLcaGtOUktqV2V4UUU/view?usp=sharing Thank you for your help! Greg [[alternative HTML version deleted]]

Re: [R] Error in local package install

2015-06-16 Thread Axel Urbiz
Thanks Uwe. Actually, the problem persists in R-3.2.1. If it helps, the .zip file is here: http://win-builder.r-project.org/yC8eUu09w3Ui/ Thank you, Axel. On Mon, Jun 15, 2015 at 5:41 PM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 15.06.2015 22:32, Axel Urbiz wrote: Hello,

Re: [R] Boxplot using a shapefile

2015-06-16 Thread Roger Bivand
Boris Steipe boris.steipe at utoronto.ca writes: Your workflow in principle is: - read the image into an object for which you can obtain values-per-pixel in a 2D structure; - read the shapefile and convert into a polygon; - determine the bounding box of the polygon; - use the inout()

Re: [R] Error in local package install

2015-06-16 Thread Uwe Ligges
On 16.06.2015 15:16, Axel Urbiz wrote: Thanks Uwe. Actually, the problem persists in R-3.2.1. If it helps, the .zip file is here: http://win-builder.r-project.org/yC8eUu09w3Ui/ Works for me, but your error message is: cannot open compressed file 'mypackage/DESCRIPTION' which suggests

Re: [R] problem with nlme, environments, and packages

2015-06-16 Thread Bert Gunter
An aside... Just wanted to point out that: fun - function(x)log(x) can be more simply replaced by: fun - log Functions in R a full first class objects and can be treated as such. In your example, this is still silly of course, but becomes relevant in function calls where you can do things

Re: [R] Error in local package install

2015-06-16 Thread Uwe Ligges
On 16.06.2015 16:33, Axel Urbiz wrote: Thanks again Uwe. I haven't renamed the file, only in the text sent to R-help. Here's the error again I'm getting. Sorry, this s a bit frustrating... No idea. Perhaps the down load failed? Can you open the file using some zip software and extract the

[R] Question about XML package (accurately access one attribute in an multi-attribution node on the web page)

2015-06-16 Thread Humphrey Zhao
Dear Sir/Madam: Thank you for your attention to my question. I have downloaded the source code of some web pages by RCurl, and I am trying to extract the URL from them. In  these web pages, there are many nodes contains the same URL, such like the  followings: a 

Re: [R] Boxplot using a shapefile

2015-06-16 Thread Preethi Balaji
Dear all, Thanks very much for your help! I will keep your suggestions in mind and will get back to you if I get stuck! On Tue, Jun 16, 2015 at 1:28 PM, Roger Bivand roger.biv...@nhh.no wrote: Boris Steipe boris.steipe at utoronto.ca writes: Your workflow in principle is: - read the

Re: [R] problem with nlme, environments, and packages

2015-06-16 Thread Duncan Murdoch
On 16/06/2015 10:34 AM, Greg Hather wrote: Hi Duncan, I checked the global environment, and it was empty, so I think that rules out the second possibility. I posted a tarball at https://drive.google.com/file/d/0B8hBX90jtuLcaGtOUktqV2V4UUU/view?usp=sharing Thank you for your help!

Re: [R] Error in local package install

2015-06-16 Thread Axel Urbiz
Thanks again Uwe. I haven't renamed the file, only in the text sent to R-help. Here's the error again I'm getting. Sorry, this s a bit frustrating... Thanks, Axel Error in read.dcf(file.path(pkgname, DESCRIPTION), c(Package, Type)) : cannot open the connection In addition: Warning messages:

[R] Error working dsm: Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column

2015-06-16 Thread Milagros Antun
Hello, I`m trying to use dsm package, *(library(Distance); library(dsm)*) , following Miller`s Appendix ( http://onlinelibrary.wiley.com/store/10./2041-210X.12105/asset/supinfo/mee312105-sup-0001-AppendixS1.pdf?v=1s=ced953b57365e5eb5753f0ad76dcc02c26918736 ). I work with three dataframes,

[R] reading daily snow depth data

2015-06-16 Thread Alemu Tadesse
Dear All, I was going to read daily snow data for each state and station/city from the following link. I was not able to separate a given state's data from the rest of the contents of the file, read the data to a data frame and save it to file.

Re: [R] model selection

2015-06-16 Thread Bert Gunter
Wrong list! This is about R. Post on a statistics list like stats.stackexchange.com for statistics questions. Cheers, Bert Bert Gunter Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. -- Clifford Stoll On Mon, Jun 15, 2015 at 3:55 PM, bruno cid

[R-es] Error usando el paquete dsm

2015-06-16 Thread Milagros Antun
Hola, intento utilizar el paquete dsm,*(library(Distance); library(dsm)*) , siguiendo el Anexo de Miller ( http://onlinelibrary.wiley.com/store/10./2041-210X.12105/asset/supinfo/mee312105-sup-0001-AppendixS1.pdf?v=1s=ced953b57365e5eb5753f0ad76dcc02c26918736 ). Trabajo con *tres dataframes,

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Clint Bowman
Thanks, Dimitri. Burt is the real wizard here--I'll bet he can conjure up an elegant solution. For me, just reaching a desired endpoint is enoughg. Clint Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu

Re: [R] Error in local package install

2015-06-16 Thread Duncan Murdoch
On 16/06/2015 1:27 PM, Uwe Ligges wrote: On 16.06.2015 16:33, Axel Urbiz wrote: Thanks again Uwe. I haven't renamed the file, only in the text sent to R-help. Here's the error again I'm getting. Sorry, this s a bit frustrating... No idea. Perhaps the down load failed? Can you open the

[R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Dimitri Liakhovitski
Hello! I have a data frame: md - data.frame(a = c(3,5,4,5,3,5), b = c(5,5,5,4,4,1), c = c(1,3,4,3,5,5), device = c(1,1,2,2,3,3)) myvars = c(a, b, c) md[2,3] - NA md[4,1] - NA md I want to count number of 5s in each column - by device. I can do it like this: library(dplyr) group_by(md,

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Clint Bowman
Any problem with colSums(md==5, na.rm=T) Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360)

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Clint Bowman
It would help if I could see beyond my allergy meds. A start could be: colSums(subset(md,md$device==1)==5,na.rm=T) colSums(subset(md,md$device==2)==5,na.rm=T) colSums(subset(md,md$device==3)==5,na.rm=T) Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler

Re: [R] Question about XML package (accurately access one attribute in an multi-attribution node on the web page)

2015-06-16 Thread Boris Steipe
Humphrey - Any correct method requires you to specify _uniquely_ what you are looking for. If the bookmark keyword is necessary and unique, it appears you have a working solution. Or what else where you trying to accomplish? Cheers, Boris On Jun 16, 2015, at 9:01 AM, Humphrey Zhao

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Clint Bowman
May want to add headers but the following provides the device number with each set fo sums: for (dev in (unique(md$device))) {cat(colSums(subset(md,md$device==dev)==5,na.rm=T),dev,\n)} Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET:

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Dimitri Liakhovitski
No problem at all, Clint. I was just trying to figure out of dplyr can do it. On Tue, Jun 16, 2015 at 1:40 PM, Clint Bowman cl...@ecy.wa.gov wrote: Any problem with colSums(md==5, na.rm=T) Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Dimitri Liakhovitski
Thank you, Bert. I'll be honest - I am just learning dplyr and was wondering if one could do it in dplyr. But of course your solution is perfect... On Tue, Jun 16, 2015 at 1:50 PM, Bert Gunter bgunter.4...@gmail.com wrote: Well, dplyr seems a bit of overkill as it's so simple with plain old

Re: [R-es] Regresión logística

2015-06-16 Thread eric
MaLuz, podrias adjuntar los datos o una direccion de donde descargarlos para ejecutar tu codigo y replicar el problema ? justo estoy trabajando en unas regresiones logisticas y quiza podria darte una mano. Saludos, eric. On 16/06/15 05:01, MªLuz Morales wrote: Gracias! El 15 de junio de

Re: [R-es] Problemas al cargar Rcomander en consola de Rstudio

2015-06-16 Thread eric
MaLuz, hasta donde entiendo RStudio y R-commander son entornos de trabajo graficos para R, R-commander no es una libreria (http://www.rcommander.com/), de modo que me parece raro invocarlo desde dentro de R. Segun yo deberias llamar a R-commander tal como llamas a RStudio, como un programa

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Bert Gunter
Well, dplyr seems a bit of overkill as it's so simple with plain old vapply() in base R : dat - data.frame (a=sample(1:5,10,rep=TRUE), +b=sample(3:7,10,rep=TRUE), +g = sample(7:9,10,rep=TRUE)) vapply(dat,function(x)sum(x==5,na.rm=TRUE),1L) a b g 5 4 0

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Dimitri Liakhovitski
Except, of course, Bert, that you forgot that it had to be done by device. Your solution ignores the device. md - data.frame(a = c(3,5,4,5,3,5), b = c(5,5,5,4,4,1), c = c(1,3,4,3,5,5), device = c(1,1,2,2,3,3)) myvars = c(a, b, c) md[2,3] - NA md[4,1] - NA md vapply(md[myvars], function(x)

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Bert Gunter
Yes, indeed. Thanks, David. But if you check, tapply, aggregate(), by(), etc. are all basically wrappers to lapply() .So it's all a question of what syntax one feels most comfortable with. However note that data.table, plyR stuff and perhaps others are different in that they re-implement the

Re: [R-es] Ayuda boxplot ggplot2

2015-06-16 Thread Juan Camilo Lara
Muchas gracias, funcionó correctamente. Att: Juan Camilo Lara C. El 16 de junio de 2015, 15:15, pepeceb pepe...@yahoo.es escribió: Hola, tienes que añadirlle esta instrucciion + ylim (0,60)+ Saludos vplayout - function(x, y) viewport(layout.pos.row = x, layout.pos.col = y)

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread David Winsemius
On Jun 16, 2015, at 11:18 AM, Clint Bowman wrote: Thanks, Dimitri. Burt is the real wizard here--I'll bet he can conjure up an elegant solution. This would be base method: by( md[-4]==5, md[4], colSums) device: 1 a b c 1 2 0 - device:

Re: [R] reading daily snow depth data

2015-06-16 Thread jim holtman
Here is an example of reading in the data. After that it is a data frame and should be able to process it with dplyr/data.table without much trouble: x - readLines( http://www1.ncdc.noaa.gov/pub/data/snowmonitoring/fema/06-2015-dlysndpth.txt ) writeLines(x, '/temp/snow.txt') # save for

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Hadley Wickham
On Tue, Jun 16, 2015 at 12:24 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! I have a data frame: md - data.frame(a = c(3,5,4,5,3,5), b = c(5,5,5,4,4,1), c = c(1,3,4,3,5,5), device = c(1,1,2,2,3,3)) myvars = c(a, b, c) md[2,3] - NA md[4,1] - NA md I want to

[R] mlogit error

2015-06-16 Thread mikebarr
Hello, I am trying to run a mixed logit model (panel form) with the mlogit package. I am running into the following error: Error in random.nb[, sel, drop = F] : subscript out of bounds. I have searched the R Help forum (and online) and see no instances of this error. Below is the coding that I

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread David L Carlson
Not in base, but in stats: aggregate(md[,-4]==5, list(device=md$device), sum, na.rm=TRUE) device a b c 1 1 1 2 0 2 2 0 1 0 3 3 1 0 2 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352

Re: [R] reading daily snow depth data

2015-06-16 Thread Alemu Tadesse
Thank you Jim and Bob. This is really big help for me. Jim, this is your second time to help me out. Best Alemu On Tue, Jun 16, 2015 at 1:50 PM, boB Rudis b...@rudis.net wrote: This look similar to snow data I used last year: https://github.com/hrbrmstr/snowfirst/blob/master/R/snowfirst.R

[R] Polysomnographic data analysis with R?

2015-06-16 Thread Charles Novaes de Santana
Dear all, Do you know if there is any R package or function we can use to analyze polysomnographic data? For example, something that can import an EDF file (or in a different format) and can give some properties of the polysomnographic records like periods of different sleep phases, etc. I

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Dimitri Liakhovitski
Thank you guys - it's a great learning: 'summarise_each' and 'funs' On Tue, Jun 16, 2015 at 3:47 PM, Hadley Wickham h.wick...@gmail.com wrote: On Tue, Jun 16, 2015 at 12:24 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! I have a data frame: md - data.frame(a =

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Dimitri Liakhovitski
Thank you, Clint. That's the thing: it's relatively easy to do it in base, but the resulting code is not THAT simple. I thought dplyr would make it easy... On Tue, Jun 16, 2015 at 2:06 PM, Clint Bowman cl...@ecy.wa.gov wrote: May want to add headers but the following provides the device number

[R-es] Ayuda boxplot ggplot2

2015-06-16 Thread Juan Camilo Lara
Hola a todos Me gustaría saber si me pueden ayudar con lo siguiente. Realicé un Boxplot usando ggplot2 para visualizar el comportamiento de dos variables. Visualmente no se notan las diferencias porque la gráfica de la derecha (parásitos en el abdomen) llega hasta 20 en el eje y. ¿Cómo puedo

Re: [R] dplyr - counting a number of specific values in each column - for all columns at once

2015-06-16 Thread Bert Gunter
... my bad! -- I filed to read carefully. A base syntax version is: dat - data.frame (a=sample(1:5,10,rep=TRUE), b=sample(3:7,10,rep=TRUE), g = sample(7:9,10,rep=TRUE)) dev - sample(1:3,10,rep=TRUE) sapply(dat,function(x)

Re: [R] reading daily snow depth data

2015-06-16 Thread boB Rudis
This look similar to snow data I used last year: https://github.com/hrbrmstr/snowfirst/blob/master/R/snowfirst.R All the data worked pretty well. On Tue, Jun 16, 2015 at 3:21 PM, jim holtman jholt...@gmail.com wrote: Here is an example of reading in the data. After that it is a data frame and

[R] rdde : DDE connections on R

2015-06-16 Thread Juan Manuel Truppia
Hi all, I'm building a new package for DDE connections on R. It's called rdde and lives in https://bitbucket.org/juancentro/rdde. It's in alpha stage, but operational. It has a very simple vignette which explains the main reason you should try rdde vs tcltk2 (the only other option available) :

Re: [R-es] Ayuda boxplot ggplot2

2015-06-16 Thread pepeceb
text/html; charset=iso-8859-1: Unrecognized ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es

Re: [R] problem with nlme, environments, and packages

2015-06-16 Thread Greg Hather
Thank you, Duncan! Your suggestion worked! Greg On Tue, Jun 16, 2015 at 12:20 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 16/06/2015 10:34 AM, Greg Hather wrote: Hi Duncan, I checked the global environment, and it was empty, so I think that rules out the second possibility.

[R] Exporting from R to Excel or .csv

2015-06-16 Thread Kevin Kowitski
Hello,    Does anyone have some insight on how to; or where I can find better information on how to, export multiple data.frames of different dimensions to the same .csv or excel file? -Kevin __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] Exporting from R to Excel or .csv

2015-06-16 Thread Jeff Newmiller
A CSV with multiple data frames would not conform to the standard definition of a CSV file. The XLConnect package can be used to generate Excel workbooks. There are other packages also, but they are mostly either too simplified to allow filling multiple sheets or too finicky for my taste. That

[R] hash::hash(...) assignment clearing

2015-06-16 Thread Murat Tasan
The hash package implements hashmaps which must be cleared prior to removal to free memory, e.g.: x - hash(some_long_list_of_keys_and_values_here) clear(x) rm(x) I first assumed this held for re-assignment, too... e.g. one should: x - hash(some_long_list_of_keys_and_values_here) clear(x)

Re: [R] Missing Values in Table Statement

2015-06-16 Thread Shivi82
HI Petr,There is no reason for holding back the data from dput format. The reason for not supplying is that i tried multiple times but it the output what comes is not really user friendly is what i think.Not sure if i am missing a trick somewhere as i tried both the dput and dget options. Though

Re: [R] Missing Values in Table Statement

2015-06-16 Thread PIKAL Petr
Hi actually output from dput is the most user friendly way of supplying data. try just copy this part below - temp - structure(list(dusik = c(1814L, 2844L, 3121L, 3286L, 3515L, 2478L, 1891L), kyslik = c(5224L, 8632L, 9214L, 9765L, 10428L, 7403L, 5469L), co2 = c(20188L, 32118L, 35299L,

Re: [R-es] Regresión logística

2015-06-16 Thread MªLuz Morales
Gracias! El 15 de junio de 2015, 16:54, Freddy Omar López Quintero freddy.vat...@gmail.com escribió: ​Holap.​ ran out of iterations and failed to converge ​Prueba aumentando el número de iteraciones, con el argumento maxit: ​GLM - bigglm(In.hospital_death ~ GCS + BUN, data = DatosGLM,

Re: [R] problem with nlme, environments, and packages

2015-06-16 Thread Duncan Murdoch
On 15/06/2015 8:32 PM, Greg Hather wrote: Hello R users, I encountered a strange problem while writing a package that uses the nlme function. First, I wrote some code that uses the nlme function, and it ran without errors. However, when I tried to put the code into a package, the nlme