Re: [R] Printing matrix/table in a procedure

2019-05-15 Thread Steven Yen
Great! Thanks. On 5/15/2019 7:00 PM, Rui Barradas wrote: > Hello, > > What's wrong with > > test <- function(x){ >   table <- matrix(x, nrow = 4) >   cat("\nTable:\n") >   print(table) >   invisible(list(table = table)) > } > > > Hope this helps, > > Rui Barradas > > Às 10:33 de 15/05/19, Steven Y

Re: [R] converting zipcodes to latitude/longitude

2019-05-15 Thread Jim Lemon
Hi Nicola, Good to learn that you solved the problem. Shape files are usually a set of polygons for the named areas. I did some work with the "rgdal" package a while ago and it wasn't very difficult. There might be better methods now, so posting to R-SIG-geo is a good idea. Jim On Thu, May 16, 2

Re: [R] how to separate string from numbers in a large txt file

2019-05-15 Thread David Winsemius
On 5/15/19 4:07 PM, Michael Boulineau wrote: I have a wild and crazy text file, the head of which looks like this: 2016-07-01 02:50:35 hey 2016-07-01 02:51:26 waiting for plane to Edinburgh 2016-07-01 02:51:45 thinking about my boo 2016-07-01 02:52:07 nothing crappy has happened, not reall

[R] how to separate string from numbers in a large txt file

2019-05-15 Thread Michael Boulineau
I have a wild and crazy text file, the head of which looks like this: 2016-07-01 02:50:35 hey 2016-07-01 02:51:26 waiting for plane to Edinburgh 2016-07-01 02:51:45 thinking about my boo 2016-07-01 02:52:07 nothing crappy has happened, not really 2016-07-01 02:52:20 plane went by pretty fast,

Re: [R] converting zipcodes to latitude/longitude

2019-05-15 Thread Nicola Ruggiero
Hi Jim, I ended up collaborating with someone, and, on the basis of looking at your code (we did take it into consideration and talk about it), we came up with this: library(stringr) numextract <- function(string){ str_extract(string, "\\-*\\d+\\,*\\d*") } myDataSet$zip<-numextract(myDataSet

Re: [R] Different predictions with forecast::auto.arima()

2019-05-15 Thread Michael Howell
Thank you very much for your advice. On Tue, May 14, 2019 at 11:01 PM Abby Spurdle wrote: > > This is definitely a statistics question still so not on topic here... > as changing the data is exactly the kind of thing that can have this > effect. > > I'm sorry. > I disagree. > This is a question

Re: [R] How to publish a new package on CRAN

2019-05-15 Thread Bert Gunter
This appears to be off topic here, but, when expanded, might make a nice post on the R-bloggers site. Cheers, Bert On Wed, May 15, 2019 at 6:10 AM J C Nash wrote: > In reading the original post, I could not help but get a feeling that the > writers were > going through an exercise in learning h

Re: [R] How to publish a new package on CRAN

2019-05-15 Thread J C Nash
In reading the original post, I could not help but get a feeling that the writers were going through an exercise in learning how to put a package on CRAN. Having organized "Navigating the R Package Universe" at UseR!2017, where Spencer Graves, Julia Silge and I pointed out the difficulties for u

Re: [R] Printing matrix/table in a procedure

2019-05-15 Thread Rui Barradas
Hello, What's wrong with test <- function(x){ table <- matrix(x, nrow = 4) cat("\nTable:\n") print(table) invisible(list(table = table)) } Hope this helps, Rui Barradas Às 10:33 de 15/05/19, Steven Yen escreveu: Dear All, I would like to get a matrix (table) printed in a procedure,

[R] Printing matrix/table in a procedure

2019-05-15 Thread Steven Yen
Dear All, I would like to get a matrix (table) printed in a procedure, as attempted below. Please help. Thanks. test<-function(x){   table<-matrix(x,nrow=4)   cat("\nTable:\n",table) invisible(list(table=table)) } x<-1:20 test(x) -- st...@ntu.edu.tw (S.T. Yen) [[alternative HTML v

[R] Iterating dates over multiple ids

2019-05-15 Thread Graeme Davidson
Hi all, I want to create a df that repeats the dates over ids. Previously I tried expand.grid but this created every possible iteration of dates and ids, when all I want is the start and end dates repeated for each month. In other words 01/03/19 with an end date of 28/02/19 would be unsuitable