[R] Need help with renaming sub-directories and its files after attribute vales from a shapefile

2016-09-14 Thread P Mads
Hello, Keep in mind I am VERY new to using R... What I am trying to do is package hundreds of files into a new sub-directory. I was able to accomplish this with the code below. HOWEVER, I have come to find that instead of merely having to name the new sub-directory after the 7-digit numeric prefix

Re: [R] Time format lagging issue

2016-09-14 Thread Bhaskar Mitra
Thanks for all your feedbacks. This is helpful. My apologies for any inconvenience due to asterisks. Thanks, Bhaskar On Wed, Aug 31, 2016 at 6:09 PM, William Dunlap wrote: > That > tmp1 - 30*60 > can also be done as > tmp1 - as.difftime(30, units="mins") > so you don't

[R] Data Visualisation, Predictive Modelling Courses: Syd/Melb/Canb/Adel in September

2016-09-14 Thread Kris Angelovski
Hi, SolutionMetrics is presenting Data Visualisation and Data Science/Predictive Modelling courses in Sydney, Melbourne, Canberra and Adelaide. Data Visualisation (1 Day) Introduction to Data Analysis and Graphics - Histograms, Box Plots, Bar Charts, Scatter Plots; Changing symbols, colours,

Re: [R] Creating dataframe with subtotals by all fields and totals of subtotals

2016-09-14 Thread David Winsemius
> On Sep 14, 2016, at 12:33 PM, Peter Lomas wrote: > > Hello R-Helpers, > > I'm trying to to create a subtotal category for each column in a > dataset, and totals of subtotals, resulting in one data frame. I > figure I could do this by a whack of aggregate() and

Re: [R] NaN Log-lik value in EM algorithm (fitting Gamma mixture model)

2016-09-14 Thread Duncan Murdoch
On 14/09/2016 4:46 PM, Aanchal Sharma wrote: Hi, I am trying to fit Gamma mixture model to my data (residual values obtained after fitting Generalized linear Model) using gammamixEM. It is part of the script which does it for multiple datasets in loop. The code is running fine for some datasets

[R] NaN Log-lik value in EM algorithm (fitting Gamma mixture model)

2016-09-14 Thread Aanchal Sharma
Hi, I am trying to fit Gamma mixture model to my data (residual values obtained after fitting Generalized linear Model) using gammamixEM. It is part of the script which does it for multiple datasets in loop. The code is running fine for some datasets but it terminates for some giving following

Re: [R] Cross-classified multilevel binary logistic regression model with random effects at level 2

2016-09-14 Thread MACDOUGALL Margaret
Thank you for this valued advice, David, in response to which I have sent a very similar message to the list you recommend. I would also welcome suggestions from members of the r-help@r-project list, where appropriate. Best wishes Margaret -- The University of Edinburgh is a charitable

[R] Creating dataframe with subtotals by all fields and totals of subtotals

2016-09-14 Thread Peter Lomas
Hello R-Helpers, I'm trying to to create a subtotal category for each column in a dataset, and totals of subtotals, resulting in one data frame. I figure I could do this by a whack of aggregate() and rbind(), but I'm hoping there is a simpler way. Below is a sample dataset. Underneath I create

Re: [R] why data.frame, mutate package and not lists

2016-09-14 Thread Duncan Murdoch
On 14/09/2016 2:40 PM, jeremiah rounds wrote: "If you want to add variable to data.frame you have to use attach, detach. Right?" Not quite. Use it like a list to add a variable to a data.frame e.g. df = list() df$var1 = 1:10 df = as.data.frame(df) df$var2 = 1:10 df[["var3"]] = 1:10 df df =

Re: [R] Maximum # of DLLs reached, or, how to clean up after yourself?

2016-09-14 Thread Henrik Bengtsson
As Jeff says, I think the common use case is to run/rerun in fresh R sessions. But, yes, if you'd like to have each script clean up after itself, then you need to check with pkgs0 <- loadedNamespaces() to see what packages are loaded when the script starts (not just attached) and then unload the

Re: [R] why data.frame, mutate package and not lists

2016-09-14 Thread jeremiah rounds
There is also this syntax for adding variables df[, "var5"] = 1:10 and the syntax sugar for row-oriented storage: df[1:5,] On Wed, Sep 14, 2016 at 11:40 AM, jeremiah rounds wrote: > "If you want to add variable to data.frame you have to use attach, detach. > Right?" >

Re: [R] why data.frame, mutate package and not lists

2016-09-14 Thread jeremiah rounds
"If you want to add variable to data.frame you have to use attach, detach. Right?" Not quite. Use it like a list to add a variable to a data.frame e.g. df = list() df$var1 = 1:10 df = as.data.frame(df) df$var2 = 1:10 df[["var3"]] = 1:10 df df = as.list(df) df$var4 = 1:10 as.data.frame(df)

Re: [R] why data.frame, mutate package and not lists

2016-09-14 Thread Alaios via R-help
thanks for all the answers. I think also ggplot2 requires data.frames.If you want to add variable to data.frame you have to use attach, detach. Right?Any more links that discuss thoe two different approaches?Alex On Wednesday, September 14, 2016 5:34 PM, Bert Gunter

Re: [R] gsub: replacing slashes in a string

2016-09-14 Thread Joe Ceradini
Thanks Jim! Joe On Wed, Sep 14, 2016 at 11:06 AM, jim holtman wrote: > try this: > > > gsub("", "/", test) > [1] "8/24/2016" "8/24/2016" "6/16/2016" "6/16/2016" > > > > > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what

Re: [R] gsub: replacing slashes in a string

2016-09-14 Thread jim holtman
try this: > gsub("", "/", test) [1] "8/24/2016" "8/24/2016" "6/16/2016" "6/16/2016" Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Sep 14, 2016 at 12:25 PM, Joe Ceradini

Re: [R] gsub: replacing slashes in a string

2016-09-14 Thread Joe Ceradini
Wow. Thanks David and Rui. I thought I needed to "escape" the replacement slash as well, which is why I had "//" rather than "/". I swear I had tried all the slash combos, but missed the obvious one. Much easier than I made it out to be. Thanks! Joe On Wed, Sep 14, 2016 at 10:59 AM, David L

Re: [R] gsub: replacing slashes in a string

2016-09-14 Thread David L Carlson
Is this what you want? > (test2 <- gsub("\\", "/", test, fixed = TRUE)) [1] "8/24/2016" "8/24/2016" "6/16/2016" "6/16/2016" > nchar(test2) [1] 9 9 9 9 > write.csv(test2) "","x" "1","8/24/2016" "2","8/24/2016" "3","6/16/2016" "4","6/16/2016" - David L Carlson

Re: [R] gsub: replacing slashes in a string

2016-09-14 Thread ruipbarradas
Hello, I failing to understand the problem, isn't the following what you want? (test2 <- gsub("\\", "/", test, fixed = TRUE)) [1] "8/24/2016" "8/24/2016" "6/16/2016" "6/16/2016" Hope this helps, Rui Barradas Citando Joe Ceradini : Hi all, There are many R help

Re: [R-es] de pdf a csv

2016-09-14 Thread ignacio holzinger
Saludos. Te iba a decir lo mismo que Eric. Esas tablas "mal formadas" donde se fusionan celdas son difíciles de manejar en "piloto automático". Casi siempre hay que hacer manualidades. De entre las soluciones que te han aportado esta última es la que suelo utilizar. Suerte. El 14 sept. 2016

Re: [R-es] de pdf a csv

2016-09-14 Thread eric
Hola Jose, con frecuencia tengo que extraer datos de tablas en articulos en PDF tambien, lo que hago es lo siguiente, que no es todo lo automatico que uno quisiera pero al menos no tengo que copiar los datos uno a uno: 1. en linux existe la herramienta pdftotext, que cuando la usas con la

[R] gsub: replacing slashes in a string

2016-09-14 Thread Joe Ceradini
Hi all, There are many R help posts out there dealing with slashes in gsub. I understand slashes are "escape characters" and thus need to be treated differently, and display differently in R. However, I'm still stuck on find-replace problem, and would appreciate any tips. Thanks! GOAL: replace

Re: [R] why data.frame, mutate package and not lists

2016-09-14 Thread Bert Gunter
This is partially a matter of subjectve opinion, and so pointless; but I would point out that data frames are the canonical structure for a great many of R's modeling and graphics functions, e.g. lm, xyplot, etc. As for mutate() etc., that's about UI's and user friendliness, and imho my ho is

Re: [R] why data.frame, mutate package and not lists

2016-09-14 Thread Marc Schwartz
> On Sep 14, 2016, at 8:01 AM, Alaios via R-help wrote: > > Hi all,I have seen data.frames and operations from the mutate package getting > really popular. In the last years I have been using extensively lists, is > there any reason to not use lists and use other data

Re: [R] Cross-classified multilevel binary logistic regression model with random effects at level 2

2016-09-14 Thread David Winsemius
> On Sep 14, 2016, at 6:05 AM, MACDOUGALL Margaret > wrote: > > Hello > > I am not a seasoned R user and am therefore keen to identify a book chapter > that can provide structured advice on setting up the type of model I am > interested in using R. I would like

Re: [R] Drill down reports in R

2016-09-14 Thread Manohar Reddy
Hi , It would be great if someone can share the links how to generate the drill down reports/tables using combination of “R & Javascript/Ajax/some other packages”. Note : I tried with *shinytree* package but it’s not met my requirement. Manu. On Tue, Sep 13, 2016 at 11:02 PM, Greg

[R] why data.frame, mutate package and not lists

2016-09-14 Thread Alaios via R-help
Hi all,I have seen data.frames and operations from the mutate package getting really popular. In the last years I have been using extensively lists, is there any reason to not use lists and use other data types for data manipulation and storage? Any article that describe their differences? I

Re: [R] Upgrade R 3.2 to 3.3 using tar.gz file on Ubuntu 16.04

2016-09-14 Thread Alain Guillet
Dear Luigi, You have to modify the /etc/apt/source.list file in order to add a new depot to get a new R version. Everything is explained on the page https://cran.r-project.org/bin/linux/ubuntu/ . Alain On 13/09/16 15:00, Luigi Marongiu wrote: Dear all, I am working on Linux Ubuntu 16.04

Re: [R] Arules Package: Rules subset with 'empty' left hand side (lhs)

2016-09-14 Thread Michael Hahsler
Hi all, There is no item with the label "". > itemLabels(rules) [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" arules::subset(rules, subset=lhs %pin% "") should return an empty set or throw an error---I will fix that in the next release of arules. To get the rules with 0 elements in

[R] Cross-classified multilevel binary logistic regression model with random effects at level 2

2016-09-14 Thread MACDOUGALL Margaret
Hello I am not a seasoned R user and am therefore keen to identify a book chapter that can provide structured advice on setting up the type of model I am interested in using R. I would like to run a cross-classified multilevel binary logistic regression model. The model contains two level 2

Re: [R] Maximum # of DLLs reached, or, how to clean up after yourself?

2016-09-14 Thread Jeff Newmiller
I never detach packages. I rarely load more than 6 or 7 packages directly before restarting R. I frequently re-run my scripts in new R sessions to confirm reproducibility. -- Sent from my phone. Please excuse my brevity. On September 14, 2016 1:49:55 AM PDT, Alexander Shenkin

Re: [R-es] de pdf a csv

2016-09-14 Thread Mauricio Monsalvo
Hola. Esta entrada también puede ser útil, al menos como ejemplo: https://gist.github.com/sdgilley/15ebf67c5b01d12224f4b103c7065625 y tiene el archivo .pdf que utiliza para descargar, así que puede seguirse el código completo. También está basada en pdftools Saludos El 12 de septiembre de 2016,

Re: [R-es] Saltar filas no numericas al importar csv

2016-09-14 Thread javier.ruben.marcuzzi
Estimado Intente con: Números <- as.numeric(data.frame$dondeEstanLosNumeros) Javier Rubén Marcuzzi De: Jesús Para Fernández [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org

Re: [R] How to read a grib2 file

2016-09-14 Thread Michael Sumner
On Wed, 14 Sep 2016 at 00:49 Debasish Pai Mazumder wrote: > Hi Mike, > Thanks again. I am using Mac OS > > Here is the required info > > > sessionInfo() > R version 3.2.4 (2016-03-10) > Platform: x86_64-apple-darwin13.4.0 (64-bit) > Running under: OS X 10.11.6 (El Capitan) > >

[R] Course: Data exploration, regression, GLM & GAM with introduction to R

2016-09-14 Thread Highland Statistics Ltd
We would like to announce the following statistics course: Course: Data exploration, regression, GLM & GAM with introduction to R Where: Lisbon, Portugal When: 13-17 February 2017 Course website: http://www.highstat.com/statscourse.htm Course flyer:

Re: [R] Linear Regressions with constraint coefficients

2016-09-14 Thread Aleksandrovic, Aljosa (Pfaeffikon)
Hi all, I'm using nnls() to run multi-factor regressions with a non-negativity constraint on all the coefficients. It works well, but unfortunately the nnls() function only returns the parameter estimates, the residual sum-of-squares, the residuals (that is response minus fitted values) and

Re: [R] Maximum # of DLLs reached, or, how to clean up after yourself?

2016-09-14 Thread Alexander Shenkin
Hi Henrik, Thanks for your reply. I didn't realize that floating DLLs were an issue (good to know). My query is actually a bit more basic. I'm actually wondering how folks manage their loading and unloading of packages when calling scripts within scripts. Quick example: Script1:

Re: [R-es] t-test y distribución de variables

2016-09-14 Thread Olivier Nuñez
Entiendo que quieres regularizar tus datos agregandolos. El test de Shapiro rechaza la normalidad de una uniforme > set.seed(1234) > d=runif(100, min = 2, max = 4) > shapiro.test(d) Shapiro-Wilk normality test data: d W = 0.94504, p-value = 0.0003966 Pero acepta la normalidad de

Re: [R] gene name problem in Excel, and an R analogue

2016-09-14 Thread Jeff Newmiller
What, like the colClasses argument? Darn that ellipsis and its consequent deferred documentation... but it _is_ mentioned in passing in ?read.fwf. -- Sent from my phone. Please excuse my brevity. On September 13, 2016 10:54:44 PM PDT, Erich Neuwirth wrote: >Since

Re: [R] Upgrade R 3.2 to 3.3 using tar.gz file on Ubuntu 16.04

2016-09-14 Thread Jeff Newmiller
No, the default Ubuntu version is behind but that link tells how to properly install the current version using the packaging system, which makes it more easily maintained than a custom compile would be. (Thanks, Dirk, Michael and Vincent!) Anyway, still OT here. -- Sent from my phone. Please

Re: [R] Upgrade R 3.2 to 3.3 using tar.gz file on Ubuntu 16.04

2016-09-14 Thread Loris Bennett
Jeff Newmiller writes: > For this query I would rather recommend [1] as reference, though > Marc's suggestion to switch mailing lists is best. > > [1] https://cran.r-project.org/bin/linux/ubuntu/ But doesn't this merely describe how to install the version of R packaged

[R] gene name problem in Excel, and an R analogue

2016-09-14 Thread Erich Neuwirth
Since many people commenting on the gene name problem in Excel essentially tell us This could never have happened with R I want to show you a somewhat related issue: ff1 <- tempfile() cat(file = ff1, "12345", "1E002", sep = "\n") xdf1 <- read.fwf(ff1, widths = 5, stringsAsFactors=FALSE) ff2 <-