Re: [R] Suggestions for scatter plot of many data

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, William Michels wrote: Hello, In addition to Duncan Mackay's excellent suggestion, I would recommend Bert Gunter's "stripless" package, for high-density Trellis-type conditioning plots. See the vignette for examples, and try out the code for "earthquake" and "barley" plots

Re: [R] Scripting a repeating work flow

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, David Winsemius wrote: https://markmail.org/search/?q=list%3Aorg.r-project.r-help+script+process+multiple+csv+files https://stackoverflow.com/questions/11433432/importing-multiple-csv-files-into-r

Re: [R] Suggestions for scatter plot of many data

2018-07-19 Thread William Michels via R-help
Hello, In addition to Duncan Mackay's excellent suggestion, I would recommend Bert Gunter's "stripless" package, for high-density Trellis-type conditioning plots. See the vignette for examples, and try out the code for "earthquake" and "barley" plots from the reference manual.

Re: [R] Scripting a repeating work flow

2018-07-19 Thread David Winsemius
> On Jul 19, 2018, at 3:04 PM, Rich Shepard wrote: > > I have 30 data files that all need to be read into R, formatted, and have > scatter plots prepared. This process can be done in a short script. I would > like to generalize the script so that variables (such as data file names) > can be

[R] Scripting a repeating work flow

2018-07-19 Thread Rich Shepard
I have 30 data files that all need to be read into R, formatted, and have scatter plots prepared. This process can be done in a short script. I would like to generalize the script so that variables (such as data file names) can be read from another file and all files processed sequentially,

[R] Solved: RE: xtable does not print out units of a variable

2018-07-19 Thread Shawn Way
Jeff, John, Thanks for pointing out the information. I found that the following works: New function for deparsing the data: deparse_unit_latex <- function(x,frac=TRUE,xtable.frac=FALSE) { stopifnot(inherits(x, "units")) u = units(x) tn = table(u$numerator) nm1 = names(tn)

Re: [R] Read in data table, change columns from factors [RESOLVED]

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, David Winsemius wrote: You can use format to only display the time portion of a datetime object. format( Sys.time(), "%H:%M") [1] "13:57" You can append the current date to a "time-only" character value and as.POSIXct will do that for you: as.POSIXct("00:00",

Re: [R] Read in data table, change columns from factors [RESOLVED]

2018-07-19 Thread David Winsemius
> On Jul 19, 2018, at 1:21 PM, Rich Shepard wrote: > > On Thu, 19 Jul 2018, David Winsemius wrote: > >> I took the code that I offered earlier and replaced allyears with wy2018: > >> date timeelev myDate myTime >> 1 2017-10-01 00:00 290.298 2017-10-01 2017-10-01

Re: [R] Read in data table, change columns from factors [RESOLVED]

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, David Winsemius wrote: I took the code that I offered earlier and replaced allyears with wy2018: date timeelev myDate myTime 1 2017-10-01 00:00 290.298 2017-10-01 2017-10-01 00:00:00 2 2017-10-01 00:30 290.301 2017-10-01 2017-10-01 00:30:00 3

Re: [R] Read in data table, change columns from factors

2018-07-19 Thread David Winsemius
> On Jul 19, 2018, at 12:33 PM, Rich Shepard wrote: > > On Thu, 19 Jul 2018, Rich Shepard wrote: > >> I have the date and elev columns converted from factors to date and >> numeric, respectively, but still have not learned how to convert the time. > > With this dataframe structure, > >

Re: [R] Read in data table, change columns from factors

2018-07-19 Thread David Winsemius
> On Jul 19, 2018, at 10:02 AM, Rich Shepard wrote: > > On Thu, 19 Jul 2018, Rich Shepard wrote: > >> Since then I reformatted the file to two fields: date-time and elevation. >> If anyone wants a copy send me a message off the list and I'll respond with >> the modified file attached. > >

Re: [R] Read in data table, change columns from factors

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, Rich Shepard wrote: I have the date and elev columns converted from factors to date and numeric, respectively, but still have not learned how to convert the time. With this dataframe structure, str(wy2018) 'data.frame': 12592 obs. of 3 variables: $ date: Date,

Re: [R] Suggestions for scatter plot of many data

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, Berry, Charles wrote: So roughly 5000 observations of latitiude, longitude, elevation(?), and amount. Maybe something dynamic like Hans Rosling does: https://towardsdatascience.com/how-to-build-animated-charts-like-hans-rosling-doing-it-all-in-r-570efc6ba382 possibly

Re: [R] Suggestions for scatter plot of many data

2018-07-19 Thread Berry, Charles
> On Jul 18, 2018, at 1:55 PM, Rich Shepard wrote: > > I have daily precipitation data for 58 locations from 2005-01-01 through > 2018-06-18. So roughly 5000 observations of latitiude, longitude, elevation(?), and amount. Maybe something dynamic like Hans Rosling does:

Re: [R] Read in data table, change columns from factors

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, Rich Shepard wrote: Since then I reformatted the file to two fields: date-time and elevation. If anyone wants a copy send me a message off the list and I'll respond with the modified file attached. This is a mistake. The file needs commas separating each field. I

Re: [R] Read in data table, change columns from factors

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, Rich Shepard wrote: I put a zipped data file at this URL: Since then I reformatted the file to two fields: date-time and elevation. If anyone wants a copy send me a message off the list

Re: [R] Suggestions for scatter plot of many data

2018-07-19 Thread Rich Shepard
On Thu, 19 Jul 2018, Duncan Mackay wrote: Try something like this ... Duncan, That's impressive and well beyond anything I've done in the past. I'll study it to fully understand it and make it work for me. I have put over 60 panels on an A4 page. Space is a premium - you can reduce

Re: [R] xtable does not print out units of a variable

2018-07-19 Thread Marc Schwartz via R-help
Hi, Just to throw in an alternative possibility, you may want to look at Frank's Hmisc package on CRAN: https://cran.r-project.org/web/packages/Hmisc/index.html and note the label(), latex() and units() functions therein. They may or may not work for what you are looking to do here. As

Re: [R] Suggestions for scatter plot of many data

2018-07-19 Thread Duncan Mackay
Hi Rich Try something like this set.seed(1) xy <- data.frame(x = rnorm(108), y = rnorm(108), gp = rep(1:9, ea = 12)) xyplot(y~x|gp, xy, as.table = TRUE, strip = F, strip.left = F, layout = c(3,3), par.settings= list(layout.heights =

Re: [R] Read in data table, change columns from factors

2018-07-19 Thread Rich Shepard
On Wed, 18 Jul 2018, Rich Shepard wrote: If you would suggest how many would be an acceptably large number I'll be happy to put that on a 'cloud' sharing site and provide the URL to it. I put a zipped data file at this URL:

Re: [R] xtable does not print out units of a variable

2018-07-19 Thread John Kane via R-help
 I wonder if the problem may be that xtable is not designed to deal with an object of class "object" > dat1 <- data.frame(  x=c(as_units(12,"ft"))) > str(dat1) 'data.frame':    1 obs. of  1 variable:  $ x:Object of class units:  atomic  12   ..- attr(*, "units")=List of 2   .. ..$ numerator  :

Re: [R] xtable does not print out units of a variable

2018-07-19 Thread Shawn Way
Thank you for the example you posted. I'll try to make a go of it from there. I understand and actually use columns with consistent information, however, it's the reporting of the variables and their units that is the crux of the situation. The units package is extremely useful in automatic

Re: [R] Help with knitr pkg

2018-07-19 Thread Bill Poling
Hi Rainer: Thank you I will have a look at the link you provide. As I mentioned, “#opts_chunk$set(fig.path = "c:/WHP/Appeals/OutputPDFs/EX V1.pdf") <--I don't even understand what this does, poached it from one of the google sites I have been reviewing and tried to make it work?” Hopefully

Re: [R] Help with knitr pkg

2018-07-19 Thread Thierry Onkelinx
Dear Bill, It seems like you are looking at the wrong help files. The code in the tutorial uses the package::function() syntax. So knitr::kable() translates into use the function kable() from the knitr package. The help file you are looking for is ?kable (when knitr is loaded) or ?knitr::kable

Re: [R-es] Secuencia fija de números por grupo

2018-07-19 Thread Marcelino de la Cruz Rot
Hola, suponiendo que tu data.frame se llama "midf" y tu variable (factor) se llama "grupo", una posible solución sería esta: midf$seq<-unlist(sapply(table(midf$grupo), function(x) seq(1,x, by=1))) midf Que guardaría la secuencia dentro de midf en una nueva variable llamada "seq" Saludos,

Re: [R] Help with knitr pkg

2018-07-19 Thread Rainer Hurling
Hi Bill, Am 18.07.18 um 18:33 schrieb Bill Poling: Hi, I worked through this excellent tutorial: #Elegant regression results tables and plots in R: the finalfit package https://www.r-bloggers.com/elegant-regression-results-tables-and-plots-in-r-the-finalfit-package/ Now I am applying it to

Re: [R-es] Secuencia fija de números por grupo

2018-07-19 Thread Isidro Hidalgo Arellano
Hola, Rubén: ¿Los datos de grupo están ordenados, o puedes tenerlos "revueltos"? Quiero decir con revueltos que primero tengas una "A", luego una "C", luego otra "A", etc. Un saludo Isidro Hidalgo Arellano Observatorio del Mercado de Trabajo Consejería de Economía, Empresas y Empleo

[R-es] Secuencia fija de números por grupo

2018-07-19 Thread Rubén Coca
Hola, a partir de un data frame quiero crear una columna que aplique una secuencia numérica fija (1 a 12) por cada grupo de una de las variables. Si el grupo tiene más de 12 elementos, el contador tendría que reiniciarse a 1 en la fila 13, y así sucesivamente. El resultado deseado sería algo así:

Re: [R] Zoo changing time-zone when I merge 2 zoo time series

2018-07-19 Thread Enrico Schumann
On Mon, 09 Jul 2018, Christofer Bogaso writes: > Hi, > > Below is my code : > > library(zoo) > Dat1 = structure(c(17890, 17770.01, 17600, 17593, 17630.01), index = > structure(c(1512664740, > 1512664800, 1512664860, 1512664920, 1512664980), class = c("POSIXct", > "POSIXt"), tzone =