[R] R 3.5 and RTools

2018-04-30 Thread Brian Davis
Is Rtools 3.4 or 3.5 the recommended version for to go along with R 3.5.0? The reason I ask is our corporate IT upgraded our systems to R 3.5.0 but does not *want* to upgrade Rtools to 3.5 since it is not "frozen". >From the RTools download page this seems like it should work but I 'd like to conf

Re: [R] How to visualise what code is processed within a for loop

2018-04-30 Thread Bert Gunter
"I am working on the following part of building a neural network to try indeed classifying some text." ... and so you are most likely trying to reinvent wheels. There are already many such tools available here: https://cran.r-project.org/web/views/NaturalLanguageProcessing.html Some of these are

Re: [R] How to visualise what code is processed within a for loop

2018-04-30 Thread Luca Meyer
Thank you for both replies Don & Rui, The very issue here is that there is a search that needs to be done within a text field and I agree with Rui later comment that regexpr might indeed be the time consuming piece of code. I might try to optimise this piece of code later on, but for the time bei

Re: [R] How to visualise what code is processed within a for loop

2018-04-30 Thread Rui Barradas
Hello, Another thing to note is that regexpr is likely to take (much) more time than ifelse or as.integer. And the code will therefore not be very optimizable. Rui Barradas On 4/30/2018 4:25 PM, MacQueen, Don wrote: Luca, If speed is important, you might improve performance by making d0 int

Re: [R] How to visualise what code is processed within a for loop

2018-04-30 Thread MacQueen, Don
Luca, If speed is important, you might improve performance by making d0 into a true matrix, rather than a data frame (assuming d0 is indeed a data frame at this point). Although data frames may look like matrices, they aren’t, and they have some overhead that matrices don’t. I don’t think you

Re: [R] How to visualise what code is processed within a for loop

2018-04-30 Thread Luca Meyer
Hi Rui Thank you for your suggestion, I have tested the code suggested by you against that supplied by Don in terms of timing and results are very much aligned: to populate a 5954x899 0/1 matrix on my machine your procedure took 79 secs, while the one with ifelse employed 80 secs, hence unfortuna

Re: [R] Overlay line on a bar plot - multiple axis

2018-04-30 Thread Miluji Sb
Dear Jim and Ron, Thank you very much. Both the solutions are very neat and working. Appreciate all your help. Sincerely, Milu On Mon, Apr 30, 2018 at 12:28 PM, Ron Crump wrote: > Hi Miluji, > > Using Jim's interpretation of your desired graph, > you could do it in ggplot2 using your dat DF b

Re: [R] Overlay line on a bar plot - multiple axis

2018-04-30 Thread Ron Crump
Hi Miluji, Using Jim's interpretation of your desired graph, you could do it in ggplot2 using your dat DF by: ggplot() + geom_bar(data=dat, aes(x=week,y=count,fill=city),stat="identity",position="dodge") + coord_flip() + geom_line(data=dat, aes(x=week, y=mean_tmin)) There would still need