Re: [R] regexp mystery

2018-10-16 Thread PIKAL Petr
Hi Thanks a lot for your insightful answer. I will need to study it in detail, gregexpr and regexpr seems to be quite handy for what I need. Cheers Petr > -Original Message- > From: Ivan Krylov > Sent: Tuesday, October 16, 2018 11:08 AM > To: PIKAL Petr > Cc: r-help@r-project.org >

[R] regexp mystery

2018-10-16 Thread PIKAL Petr
Dear all I have text file with lines like this. > dput(x[9]) "PYedehYev: 300 sZáva~í: 2.160 kg" > dput(x[11]) "et odYezko: 3 \fas odYezku: 15 s" I am able to extract some numbers but others give me headache. gsub("^.*[^:] (\\d+.\\d+).*$", "\\1", x[9])

[R] Fw: inconsistency in pbmclapply...

2018-10-16 Thread akshay kulkarni
dear members, however, "ts must have more than one observation" error is only found for the first entry of LYG1 ( LYG1[[20]], LYG1[[200]], LYG1[[1000]]..etc are all well defined! From: R-help on behalf of akshay kulkarni

Re: [R] regexp mystery

2018-10-16 Thread Ivan Krylov
On Tue, 16 Oct 2018 08:36:27 + PIKAL Petr wrote: > > dput(x[11]) > "et odYezko: 3 \fas odYezku: 15 s" > gsub("^.*: (\\d+).*$", "\\1", x[11]) > works for 3 This regular expression only matches one space between the colon and the number, but you have more than one of

[R] DNAbin

2018-10-16 Thread Alfredo Cortell
Dear all, Is it possible to convert a data frame with variables (columns) and the number of persons for each variable at a given time at the day (rows) to DNAbin object type, so that I can calculate Tajima's divergence? I've been trying, but I just can't find the way. Thank you very much, V1

Re: [R] Unlisting a nested dataset

2018-10-16 Thread Ista Zahn
Hi Nate, You've made it pretty difficult to answer your question. Please see https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and follow some of the suggestions you find there to make it easier on those who want to help you. Best, Ista On Mon, Oct 15, 2018

Re: [R] GLM Model Summary

2018-10-16 Thread Duncan Murdoch
On 16/10/2018 12:33 PM, Neslin, Scott A. wrote: R-Help: We are working with your GLM R package. The Summary(Model) now gets printed by the program as one object and we want to put the coefficient columns into Excel. We took an initial stab at this by counting the number of characters

Re: [R] GLM Model Summary

2018-10-16 Thread Amit Mittal
You can just use 'slotNames(modelname) This will return sub objects for which names can be extracted Eg slotNames(modelname) [1] "mfit" "model" names(modelname@mfit) names(modelname@model) Will return all objects within the model including coed car R cover vcov as applicable and you can store

Re: [R] Unlisting a nested dataset

2018-10-16 Thread Nathan Parsons
Ista - I provided data, code, and the error being returned as per reproducible r protocol. I did not include packages, however. unnest_tokens is from the TidyText package, map/map_chr are from purrr, and everything else is from tidyverse(dplyr/tidyr/etc.) Not sure what else I can provide to

Re: [R] GLM Model Summary

2018-10-16 Thread Peter Langfelder
The coefficients are best obtained as summary(Model)$coefficients. This is a matrix can than be saved as a csv file and opened in excel or other spreadsheet software. HTH, Peter On Tue, Oct 16, 2018 at 9:44 AM Neslin, Scott A. wrote: > > R-Help: > > We are working with your GLM R package. The

Re: [R] year and week to date - before 1/1 and after 12/31

2018-10-16 Thread Jeff Newmiller
Er, my mistake, you are using %U not %W... but now I am really confused, because the first Sunday is trivial with %U/%u. Can you clarify what your actual upstream input is? Is it an invalid date string as you say below, or is it year number? On October 16, 2018 10:22:10 AM PDT, Jeff Newmiller

Re: [R] DNAbin

2018-10-16 Thread David Winsemius
> On Oct 16, 2018, at 7:55 AM, Alfredo Cortell > wrote: > > Hola, buenos dias. > > Escribo porque me gustaría saber si puedo convertir un data frame que > consiste en variables (indicadas por columnas) y en filas (el número de > personas que tienen cada variable en determinada hora del dia.)

Re: [R] year and week to date - before 1/1 and after 12/31

2018-10-16 Thread Jeff Newmiller
If the date in your character representation does not exist then there is no requirement for a POSIX function to give any reliable answer... including NA. Using 00 as the week number won't always work. The first week/weekday combination that is guaranteed to exist by POSIX is 1/1 (first

[R] GLM Model Summary

2018-10-16 Thread Neslin, Scott A.
R-Help: We are working with your GLM R package. The Summary(Model) now gets printed by the program as one object and we want to put the coefficient columns into Excel. We took an initial stab at this by counting the number of characters occupied by each column. But we have now learned that

Re: [R] GLM Model Summary

2018-10-16 Thread Marc Schwartz via R-help
> On Oct 16, 2018, at 12:33 PM, Neslin, Scott A. > wrote: > > R-Help: > > We are working with your GLM R package. The Summary(Model) now gets printed > by the program as one object and we want to put the coefficient columns into > Excel. We took an initial stab at this by counting the

Re: [R] Matching multiple search criteria (Unlisting a nested dataset, take 2)

2018-10-16 Thread Bert Gunter
The problem wasn't the data tibbles. You posted in html -- which you were explictly warned against -- and that corrupted your text (e.g. some quotes became "smart quotes", which cannot be properly cut and pasted into R). Bert On Tue, Oct 16, 2018 at 2:47 PM Nathan Parsons wrote: > Argh! Here

Re: [R] year and week to date - before 1/1 and after 12/31

2018-10-16 Thread peter salzman
hi, thanks for replying, it has taken some time to understand i have year+week and i need to find the 1st day and the last day of that week i can decide when week starts for example these 3 examples: df <- data.frame(id = 1:3, year = c(2018, 2018, 2018), week=c(0,1,52)) ## now run for all 3

[R] Matching multiple search criteria (Unlisting a nested dataset, take 2)

2018-10-16 Thread Nathan Parsons
Thanks all for your patience. Here’s a second go that is perhaps more explicative of what it is I am trying to accomplish (and hopefully in plain text form)... I’m using the following packages: tidyverse, purrr, tidytext I have a number of tweets in the following form: th <-

Re: [R] Matching multiple search criteria (Unlisting a nested dataset, take 2)

2018-10-16 Thread Bert Gunter
OK, as no one else has offered a solution, I'll take a whack at it. Caveats: This is a brute force attempt using R's basic regular expression engine. It is inelegant and barely tested, so likely to be at best incomplete and buggy, and at worst, incorrect. But maybe Nathan or someone else on the

Re: [R] Finding unique terms

2018-10-16 Thread roslinazairimah zakaria
Yes you are right, I want the sum. I wll change the formula accordingly. On Fri, Oct 12, 2018 at 10:36 AM Jeff Newmiller wrote: > You said "add up"... so you did not mean to say that? Denes computed the > mean... > > On October 11, 2018 3:56:23 PM PDT, roslinazairimah zakaria < >

Re: [R] year and week to date - before 1/1 and after 12/31

2018-10-16 Thread peter salzman
it is simpler than i thought first day of given week is the last day minus 6days in other words: d1 = as.Date('2018 00 Sat',format="%Y %U %a") - 6 d2 = as.Date('2018 00 Sun',format="%Y %U %a") are the same as long both are not NA therefore to get the one that is not NA one can do max(

Re: [R] Fw: inconsistency in pbmclapply...

2018-10-16 Thread Bert Gunter
As I think you hve been told before, most attachments don't make it through the mail server. Use ?dput instead to include data. Also, post in plain text, not html. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka

Re: [R] Unlisting a nested dataset

2018-10-16 Thread Jeff Newmiller
> >Not sure what else I can provide to make this more clear. You can address this deficiency of awareness by using the reprex package to generate the example+errors you are concerned about. Combined with the use of dput described in the link Ista provided (or use of example data from your

Re: [R] Matching multiple search criteria (Unlisting a nested dataset, take 2)

2018-10-16 Thread Nathan Parsons
Argh! Here are those two example datasets as data frames (not tibbles). Sorry again. This apparently is just not my day. th <- structure(list(status_id = c("x1047841705729306624", "x1046966595610927105", "x1047094786610552832", "x1046988542818308097", "x1046934493553221632",

[R] year and week to date - before 1/1 and after 12/31

2018-10-16 Thread peter salzman
hi, to turn year and week into the date one can do the following: as.Date('2018 05 Sun', "%Y %W %a") however, when we want the Sunday (1st day of week) of the 1st week of 2018 we get NA because 1/1/2018 was on Monday as.Date('2018 00 Mon',format="%Y %U %a") ## 2018-01-01 as.Date('2018 00

[R] DNAbin

2018-10-16 Thread Alfredo Cortell
Hola, buenos dias. Escribo porque me gustaría saber si puedo convertir un data frame que consiste en variables (indicadas por columnas) y en filas (el número de personas que tienen cada variable en determinada hora del dia.) en un tipo de objeto DNAbin para poder calcular la divergencia de

[R-es] 1. Incluir decimales en gráfico Likert (Francisco Javier Ibáñez López)

2018-10-16 Thread Belén Cillero Jiménez
Saludos, -- próxima parte Se ha borrado un adjunto en formato HTML... URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20181016/40c2d208/attachment.html> próxima parte A non-text attachment was scrubbed... Name: pieFJIL.png Ty

[R-es] Comprobar los nombres de columnas entre varios dataframes

2018-10-16 Thread miriam . alzate
Buenas tardes, Quiero aplicar la función rbind y necesito tener los mismos nombres de columnas. Como tengo unas 195 variables en cada dataframe, necesito hacerlo de una forma rápida. Tengo 9 bases de datos y tengo que fusionar todas. ¿Como puedo comprobar que los nombres de las variables son los

Re: [R-es] Comprobar los nombres de columnas entre varios dataframes

2018-10-16 Thread Carlos Ortega
Una forma (no optimizada) es esta. Creo unos nombres de columnas artificiales (10 nombres de personas) y compruebo que elementos hay comunes cogiendo parejas de esas variables. Cada variable son los nombres de las columnas de cada una de tus bases de datos. Puedo hacer un bucle comparándolas dos

Re: [R-es] Problema de memoria de R

2018-10-16 Thread Juan Abasolo
Quizá sea una tontería, porque está fundamentado más en ocurrencia que otra cosa: ¿No estarás usando RStudio? Y en tal caso, ¿intentaste con la consola R a pelo? Recuerdo que alguna vez alguna bióloga me explicó lo malo que le resultaba RStudio para matrices grandes, que para las dimensiones de

[R-es] Problema de memoria de R

2018-10-16 Thread SARA SUAREZ ZAPATA via R-help-es
Buenas tardes, Solicito por favor ayuda con este error: Error: OutOfMemoryError (Java): Java heap space Estoy trabajando con matrices de grandes dimensiones y el programa no logra completarse porque dice le falta memoria. Gracias [unnamed] Sara Suarez Zapata Estudiante en práctica -

Re: [R-es] Problema de memoria de R

2018-10-16 Thread Carlos Ortega
Hola, Ese problema está asociado a un paquete que usa Java, si no das más detalles de qué paquete usas, función y tipo de cálculo que estás haciendo... complicado imaginar tantas cosas. Gracias, Carlos Ortega www.qualityexcellence.es El mar., 16 oct. 2018 a las 21:00, SARA SUAREZ ZAPATA via

[R-es] help

2018-10-16 Thread SARA SUAREZ ZAPATA via R-help-es
Buenas tardes, Solicito por favor ayuda con este error: Error: OutOfMemoryError (Java): Java heap space Estoy trabajando con matrices de grandes dimensiones y el programa no logra completarse porque dice le falta memoria. Gracias [unnamed] Sara Suarez Zapata Estudiante en práctica -

Re: [R-es] Resumen de R-help-es, Vol 116, Envío 24

2018-10-16 Thread Rubén Coca
; > > Correo: sara.sua...@epm.com.co > > > > www.epm.com.co > > <http://www.epm.com.co/site/portals/Manuales/Firma_Correo/www.epm.com.co > > > > > > > > > > > > > > > > > > > > > > > > > > > &

Re: [R-es] Incluir decimales en gráfico Likert

2018-10-16 Thread Carlos Ortega
Hola, Pues es un pequeño problema que ya existía incluso en el ejemplo que acompaña al paquete (línea de "Fiction"). [image: image.png] Y no he visto ningún parámetro en la función que tiene el paquete para el control de ciertos elementos "likert.options()" para corregir esto. Una forma de