Re: [R] Removing display of R row names from list.

2015-07-29 Thread John Kane
Beats me. You can print a single data frame with print(dat1, rownames = FALSE) but it is not clear to me how to do it within a function. I am sure someone who actually know what they are doing will be along in a moment. Sorry not to have been of more help. John Kane Kingston ON Canada

Re: [R] Imbalanced random forest

2015-07-29 Thread Max Kuhn
This might help: http://bit.ly/1MUP0Lj On Wed, Jul 29, 2015 at 11:00 AM, jpara3 j.para.fernan...@hotmail.com wrote: ¿How can i set up a study with random forest where the response is highly imbalanced? - Guided Tours Basque Country Guided tours in the three capitals of the Basque

Re: [R] indices of mismatch element in two vector with missing values

2015-07-29 Thread baccts
Thank you everyone for taking the time to reply. Thanks Martin and Hervé for your solutions. Now I just need to remember to check for NA match. -- View this message in context: http://r.789695.n4.nabble.com/indices-of-mismatch-element-in-two-vector-with-missing-values-tp4710497p4710518.html

Re: [R] Removing display of R row names from list.

2015-07-29 Thread Bert Gunter
1. Please post in plain text, not HTML. 2. Please do your homework. Data frames (the class of the result of dcast) **always** have row names. ?data.frame for details. 3. Read up on S3 methods if you have not done so already (any good R tutorial will tell you about them, including the Intro to R

Re: [R] How to simulate informative censoring in a Cox PH model?

2015-07-29 Thread Greg Snow
As models become more complex it becomes harder to distinguish different parts and their effects. Even for a straight forward linear regression model if X1 and X2 are correlated with each other then it becomes difficult to distinguish between the effects of X1^2, X2^2, and X1*X2. In your case

[R] PythonInR. Python script in R with parameters required. Download satellite images from NASA

2015-07-29 Thread Magi Franquesa
Hello, I'm trying to execute a python script within R (3.2.1 x 64) with the PythonInR package. I would like to download an order of satellite images from Nasa using a python script ( http://landsat.usgs.gov/documents/espa_bulk_downloader_v1.0.0.zip) but I have no success. I first run the

Re: [R] Removing display of R row names from list.

2015-07-29 Thread Frederic Ntirenganya
Here is a small example. it is not the real data I am working on but this can help #Chick weight example names(ChickWeight) - tolower(names(ChickWeight)) chick_m - melt(ChickWeight, id=2:4, na.rm=TRUE) class(chick_m) test = function(data){ i = 1 table = list() table [[i]] - dcast(chick_m,

Re: [R] vectorized sub, gsub, grep, etc.

2015-07-29 Thread Bert Gunter
There is confusion here. apply() family functions are **NOT** vectorization -- they ARE loops (at the interpreter level), just done in functionalized form. Please read background material (John Chambers's books, MASS, or numerous others) to improve your understanding and avoid posting erroneous

Re: [R] Removing display of R row names from list.

2015-07-29 Thread Bert Gunter
Is this what you mean? z - data.frame(a=1:3,b=letters[1:3],row.names=letters[1:3]) zlist - list(one=z,too =z) for(i in 1:2){print(zlist[[i]],row.names=FALSE); cat(\n)} a b 1 a 2 b 3 c a b 1 a 2 b 3 c ... which could obviously be within a function. Cheers, Bert Bert Gunter Data is

[R] Opposite color in R

2015-07-29 Thread Atte Tenkanen
Hi, Nope. My point is that color pairs red-green, yellow-violet and blue-orange are physically on the opposite sides of the wheel. I'm not 100% satisfied with this circle, because three of greens and reds are so near each other. But this is the best solution thus far :-) The number of colors,

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Hidden Markov Model
No, I'm not confused. I just posted on R help website. I don't know how to use the email client to do anything which you are speaking of. If you would like the posts to be made in an alternative way, then you will need to provide clear direction. Sending someone to a help page which doesn't

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Hidden Markov Model
Alright, I think I understand what you guys are talking about. It is still not clear the relationship between R-help and Nabble since you guys haven't actually answered that. Again, the best way to provide proper advice is to actually quote to portion of the website you are sending people to,

[R] Rearrange Data Frame

2015-07-29 Thread Stella Xu
My question is about how to select and rearrange the data to a new data frame Here is an example: Samples counts time A 10 3 A 12 4 A 11 3 B 12 4 B 10 5 C

Re: [R] Mixed Date Formats

2015-07-29 Thread Sarah Goslee
On Wed, Jul 29, 2015 at 2:45 PM, farnoosh sheikhi via R-help r-help@r-project.org wrote: Hi Arun, Hope all is well with you. I have a data with a column for date.The date format is mixed. There are date values with Month/Day/Year format and values with Day/Month/Year format.I don't know how

[R] Mixed Date Formats

2015-07-29 Thread farnoosh sheikhi via R-help
 Hi Arun, Hope all is well with you. I have a data with a column for date.The date format is mixed. There are date values with Month/Day/Year format and values with Day/Month/Year format.I don't know how to unify it.I really appreciate your help.Thanks. [[alternative HTML version

Re: [R] Mixed Date Formats

2015-07-29 Thread Sarah Goslee
I'm assuming you actually want the date column to be character, not factor: SampleData - structure(list(id = 1:7, value = c(5813L, 8706L, 4049L, 5877L, 1375L, 2223L, 3423L), date = c(19-Dec-11, 07-Dec-11, 06/05/11, 05/12/11, 31/12/2011, 10/19/2011, 01/22/2011)), .Names = c(id, value, date),

Re: [R] Mixed Date Formats

2015-07-29 Thread farnoosh sheikhi via R-help
Hi Sarah, Thanks for getting back to me.Here is an example of my data:SampleData - structure(list(id = 1:7, value = c(5813L, 8706L, 4049L, 5877L,                                              1375L, 2223L, 3423L), date = structure(c(4L, 3L, 2L, 1L, 7L,                                            

Re: [R] Rearrange Data Frame

2015-07-29 Thread Sarah Goslee
Hi Stella, On Wed, Jul 29, 2015 at 1:14 PM, Stella Xu stella...@hli.ubc.ca wrote: My question is about how to select and rearrange the data to a new data frame Here is an example: Samples counts time A 10 3 A 12 4 A 11

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread David Winsemius
On Jul 29, 2015, at 1:02 PM, Hidden Markov Model wrote: Alright, I think I understand what you guys are talking about. It is still not clear the relationship between R-help and Nabble since you guys haven't actually answered that. Nabble's relationship to Rhelp? Nabble is an ongoing

Re: [R] vectorized sub, gsub, grep, etc.

2015-07-29 Thread Adam Erickson
Further refining the vectorized (within a loop) exact string match function, I get times below 0.9 seconds while maintaining error checking. This is accomplished by removing which() and replacing 1:length() with seq_along(). sub2 - function(pattern, replacement, x) { len- length(x) y

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Jeff Newmiller
Since there IS NO R-help website that you can post on, you are definitely being confused by the Nabble website. This is a MAILING list that you interact with by sending emails to r-help@r-project.org, not a website forum. The trouble with Nabble is that it does confuse users, and breaks the

[R-es] Duda ' raster package '

2015-07-29 Thread Marcos Bermejo
Hola, Tengo una matriz ' elev.rad.mx ' que tiene tres columnas: 1� columna: coordenada x del punto geogr�fico. 2� columna: coordenada y del punto geogr�fico. 3� columna: valores de un radar en el punto geogr�fico (x,y). Quiero convertir esta matriz a un objeto raster. Para ello, pongo la

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Hidden Markov Model
Hi John, Great thanks for the examples! I am not sure what you are referring to when you say a post from Nabble - I posted this directly on R-help. I actually never heard of Nabble. Stacked Bar charts are great for when you have a lot of moving parts and need to be able to zero in on one of

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Jeff Newmiller
Then why do your messages contain the Nabble footer: View this message in context: http://r.789695.n4.nabble.com/Daily-Category-Revenue-Stacked-Bar-Chart-in-ggplot2-tp4710431p4710540.html Sent from the R help mailing list archive at Nabble.com. I think you are confused. You should be looking

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Berend Hasselman
On 29-07-2015, at 20:37, Hidden Markov Model huss...@touchofmodern.com wrote: No, I'm not confused. I just posted on R help website. The R help website is NOT on Nabble. You posted from Nabble as can be seen from your message. It can also be seen in what the internet browser displays. It

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Hidden Markov Model
Alright thanks for clarifying. That's all a bit esoteric. Quite different from basics off computer use. None of the documentation anyone mentioned actually contains any of this. If Nabble is so bad, then why does anyone use it? It doesn't make sense. You should probably write a wiki going forward

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Bert Gunter
Below. Bert Gunter Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. -- Clifford Stoll On Wed, Jul 29, 2015 at 3:43 PM, Hidden Markov Model huss...@touchofmodern.com wrote: Alright thanks for clarifying. That's all a bit esoteric. Quite different

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread Hidden Markov Model
Alright kids, I think we should close this topic since we appear to be getting further and further off-topic. -- View this message in context: http://r.789695.n4.nabble.com/Daily-Category-Revenue-Stacked-Bar-Chart-in-ggplot2-tp4710431p4710563.html Sent from the R help mailing list archive at

[R] dplyr help

2015-07-29 Thread Jon BR
Hello, I've recently discovered the helpful dplyr package. I'm using the 'aggregate' function as such: bevs - data.frame(cbind(name = c(Bill, Mary), drink = c(coffee, tea, cocoa, water), cost = seq(1:8), sex = c(male,female))); bevs$cost - seq(1:8) bevs name drink costsex 1 Bill

Re: [R] dplyr help

2015-07-29 Thread Jon BR
Hi Brian, Thanks for the suggestion, although the command is throwing an error as such: bevs %% group_by(name, sex, drink) %% summarise( cost = sum(cost)) %% select(name, drink, cost, sex) Error: unexpected input in bevs %% group_by(name, sex, drink) %% summarise( Your syntax is new to me

[R] Vignette using knitr, devtools, and R markdown

2015-07-29 Thread Glenn Schultz
Hi All, I am writing a Vignette with Knitr using devtools ... actually quite awesome.   However, I would like to create a table of contents.  I have read the knitr and r markdown instructions on TOC and I can create a TOC in a markdown document but I cannot translate the command to a vignette -

Re: [R] dplyr help

2015-07-29 Thread Jon BR
David, I do appreciate your help, if not the dose of contempt. I hope you feel OK. Thanks for the tips, -Jonathan On Wed, Jul 29, 2015 at 11:14 PM, David Winsemius dwinsem...@comcast.net wrote: On Jul 29, 2015, at 7:37 PM, Jon BR wrote: Hello, I've recently discovered the helpful

Re: [R] dplyr help

2015-07-29 Thread Brian Kreeger
​dplyr solution: bevs %% group_by(name, sex, drink) %% summarise(​cost = sum(cost)) %% select(name, drink, cost, sex) The last select statement puts the output in the column order you wanted in your result. I hope this helps. Brian On Wed, Jul 29, 2015 at 9:37 PM, Jon BR jonsle...@gmail.com

Re: [R] Mixed Date Formats

2015-07-29 Thread Duncan Mackay
Hi I wonder if it is easier to convert the dates to character format and then reformat using gsub or the like str(SampleData) SampleData$date - as.character(SampleData$date) str(SampleData) as.Date( ifelse(nchar(SampleData[,date]) == 9, as.Date(SampleData[,date], format = %d-%b-%y),

Re: [R] dplyr help

2015-07-29 Thread David Winsemius
On Jul 29, 2015, at 7:37 PM, Jon BR wrote: Hello, I've recently discovered the helpful dplyr package. I'm using the 'aggregate' function as such: The `aggregate` function is part of base-R: bevs - data.frame(cbind(name = c(Bill, Mary), drink = c(coffee, tea, cocoa, water), cost =

Re: [R] Element-by-element division

2015-07-29 Thread peter dalgaard
On 28 Jul 2015, at 15:53 , Sarah Goslee sarah.gos...@gmail.com wrote: Sure, there are lots of ways to do everything in R. But mixing in apply muddles the issue, since apply() and sweep() use different logic to determine MARGIN. Actually, apply() and sweep() were designed together and use

Re: [R] indices of mismatch element in two vector with missing values

2015-07-29 Thread Martin Maechler
Hervé Pagès hpa...@fredhutch.org on Tue, 28 Jul 2015 23:07:14 -0700 writes: On 07/28/2015 09:58 PM, Peter Alspach wrote: One way seq(test1)[-which(test1==test2)] One question is whether 2 NAs should be considered to match or not. The OP doesn't tell but

Re: [R] indices of mismatch element in two vector with missing values

2015-07-29 Thread Hervé Pagès
On 07/28/2015 09:58 PM, Peter Alspach wrote: One way seq(test1)[-which(test1==test2)] One question is whether 2 NAs should be considered to match or not. The OP doesn't tell but I guess he wants them to match: test1 - c(1, 2, NA, 4, NA, 6) test2 - c(1, 2, 3, NA, NA, 66)

Re: [R] Reading data with two rows of variable names using read.zoo

2015-07-29 Thread SW Kim
Thanks, Dan. Your codes work fine. But I have tens of countries UK, JP, BR, US..., each of which has ten columns a1, a2, ..., a10 of data. So a little more automation is needed. I have been trying to make a list of each country's data and use sapply thing to get UK JP 2009 Q2

Re: [R-es] Método S3 paquete

2015-07-29 Thread Guillermo.Vinue
Hola Rubén, Muchas gracias. Un saludo, Guillermo Hola a ambos, Otra referencia que puede ser de interés es: http://r-pkgs.had.co.nz y también http://adv-r.had.co.nz (las dos de Hadley Wickham...) Un saludo, Rubén. El 27/07/2015 a las 10:46, guillermo.vi...@uv.es

Re: [R] Stop tkbind

2015-07-29 Thread jpara3
Not any ideas? Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Stop-tkbind-tp4710476p4710514.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R-es] Método S3 paquete

2015-07-29 Thread rubenfcasal
Hola a ambos, Otra referencia que puede ser de interés es: http://r-pkgs.had.co.nz y también http://adv-r.had.co.nz (las dos de Hadley Wickham...) Un saludo, Rubén. El 27/07/2015 a las 10:46, guillermo.vi...@uv.es escribió: Hola Carlos, Muchas gracias por el enlace, me ha sido de

[R] Removing display of R row names from list.

2015-07-29 Thread Frederic Ntirenganya
Dear All, Is there a way to not include the row names when creating the list? Thanks! Regards, Frederic. Frederic Ntirenganya Maseno University, African Maths Initiative, Kenya. Mobile:(+254)718492836 Email: fr...@aims.ac.za https://sites.google.com/a/aims.ac.za/fredo/ [[alternative

Re: [R] How to read CSV from web?

2015-07-29 Thread jpara3
data-read.csv(https://raw.githubusercontent.com/sjkiss/Survey/master/mlogit.out.csv,header=T,sep=,;) -- View this message in context: http://r.789695.n4.nabble.com/How-to-read-CSV-from-web-tp4710502p4710513.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Stop tkbind

2015-07-29 Thread jpara3
The solution is to create a new tkbind function that has not argument tkbind(img,button-1,) -- View this message in context: http://r.789695.n4.nabble.com/Stop-tkbind-tp4710476p4710517.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] help_ReverseGeocoding

2015-07-29 Thread shreya ghosh
Thank you for your suggestion. Is there any open source api that won't rate-limit it? On Tue, Jul 28, 2015 at 9:38 PM, boB Rudis b...@rudis.net wrote: You should use ggmap::revgeocode (it calls google's api) and google will rate-limit you. There are also packages to use HERE maps geo/revgeo

[R] Imbalanced random forest

2015-07-29 Thread jpara3
¿How can i set up a study with random forest where the response is highly imbalanced? - Guided Tours Basque Country Guided tours in the three capitals of the Basque Country: Bilbao, Vitoria-Gasteiz and San Sebastian, as well as in their provinces. Available languages. Travel planners

Re: [R] Daily Category Revenue-Stacked Bar Chart in ggplot2

2015-07-29 Thread John Kane
First http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and http://adv-r.had.co.nz/Reproducibility.html Second. It is very annoying to have posts come in from Nabble. Very few R-help readers use it and the total context of some post to R-help is usually

Re: [R] Removing display of R row names from list.

2015-07-29 Thread John Kane
HI Frederic, Can you supply a small example of the problem? John Kane Kingston ON Canada -Original Message- From: ntfr...@gmail.com Sent: Wed, 29 Jul 2015 14:15:58 +0300 To: r-help@r-project.org Subject: [R] Removing display of R row names from list. Dear All, Is there a way

Re: [R] R load error

2015-07-29 Thread John Kane
Try restarting R-Studio. I have found that every once in a while it seems to do something squirrelly but I have never isolated the problem enough to do a report. Otherwise,perhaps run R in a terminal and see if it will load the data from there to check if the file is actually okay. John Kane

Re: [R] VIF threshold implying multicollinearity

2015-07-29 Thread John Kane
Quite, but apparently not a boisterous one? John Kane Kingston ON Canada -Original Message- From: cfly...@ncsu.edu Sent: Mon, 27 Jul 2015 14:35:06 -0400 To: jrkrid...@inbox.com Subject: Re: [R] VIF threshold implying multicollinearity No actually it is a quiet good paper! :) On Mon,