Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-11 Thread Rui Barradas
Hello, For what I understood of the problem, this might be what you want. library(dplyr) library(stringr) coreWordsPat <- paste0("\\b", coreWords, "\\b") coreWordsPat <- paste(coreWordsPat, collapse = "|") left_join( df %>% mutate(Core = +str_detect(Utterance, coreWordsPat)) %>%

[R] with replace na with 0?

2021-06-11 Thread Enrico Gabrielli
Hello I almost got through the problem in post "aggregation of irregular interval time-series" I just don't understand how to fix that when I try '' with(datatable,ifelse(is.na(x),y,x)) '' if y is na replaces me with 0 and not with na Thank you -- Perito agrario Enrico Gabrielli Tessera n. 633

[R] question re: tidycensus

2021-06-11 Thread Milton O Faison
Hi, all, I'm having a new (for me) problem with tidycensus. When I attempt to pull data at the zcta level using get_acs, I get "GEOMETRYCOLLECTION EMPTY" in the geometry column. It does not happen when I pull data at the census tract level. This is also a fairly new problem, because I was

Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-11 Thread Bert Gunter
Note that your specification is ambiguous. "all done" is not a single word -- it's a phrase. So what do you want to do if: 1) "all" and/or "done" are also among your core words? 2) "I'm all done" is another of your core phrases. The existence of phrases in your core list allows such conflicts

Re: [R] with replace na with 0?

2021-06-11 Thread Jiefei Wang
Hi, I did not follow your previous post but your code looks confusing to me with(datatable,ifelse(is.na(x),y,x)) Why do you have 'x' in the first place if all you want is to do the operation on y? It's like you want to count how many apples you have but your eyes are looking at peaches. Please

Re: [R] with replace na with 0?

2021-06-11 Thread Bert Gunter
reprex? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Jun 11, 2021 at 7:23 AM Enrico Gabrielli < enricogabrielli76.per...@gmail.com> wrote: > Hello > I

Re: [R] question re: tidycensus

2021-06-11 Thread Bert Gunter
Have you read the posting guide, linked below, which says: "For questions about functions in standard packages distributed with R (see the FAQ Add-on packages in R ), ask questions on R-help. If the question relates to a

Re: [R] question re: tidycensus

2021-06-11 Thread Milton O Faison
The problem is resolved. o M. Omar Faison, Ph.D. Associate Professor, Biology Associate Vice President, Research, Economic Development, and Graduate Studies Virginia State University Petersburg, VA 23806 (804) 524-6793 http://twitter.com/omarfaison At VSU, we are proudly committed to providing a

[R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-11 Thread Debbie Hahs-Vaughn
I am working with utterances, statements spoken by children. From each utterance, if one or more words in the statement match a predefined list of multiple 'core' words (probably 300 words), then I want to input '1' into 'Core' (and if none, then input '0' into 'Core'). If there are one or

Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-11 Thread Debbie Hahs-Vaughn
Thank you for noting this. The utterance has to match the exact phrase (e.g., "all done") for it to constitute a match in the utterance. From: Bert Gunter Sent: Friday, June 11, 2021 2:42 PM To: Debbie Hahs-Vaughn Cc: r-help@R-project.org Subject: Re: [R]

Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-11 Thread Debbie Hahs-Vaughn
Yes, wonderful! This seems to work beautifully. Thank you so much! From: Rui Barradas Sent: Friday, June 11, 2021 2:03 PM To: Debbie Hahs-Vaughn ; r-help@R-project.org Subject: Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the

Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-11 Thread Bert Gunter
First, if Rui's solution works for you, I recommend that you stop reading and discard this email. Why bother wasting time with stuff you don't need?! If it doesn't work or if you would like another approach -- perhaps as a check -- then read on. Warning: I am a dinosaur and just use base R

Re: [R] with replace na with 0?

2021-06-11 Thread Rolf Turner
On Fri, 11 Jun 2021 16:15:06 +0200 Enrico Gabrielli wrote: > Hello > I almost got through the problem in post "aggregation of irregular > interval time-series" > I just don't understand how to fix that when I try > '' > with(datatable,ifelse(is.na(x),y,x)) > '' > if y is na > replaces me with

Re: [R] Comments on "Introduction to R"

2021-06-11 Thread Jim Lemon
Hi Abdullah, A good job of proof reading, something too often neglected in documentation. Jim On Fri, Jun 11, 2021 at 4:51 PM Abdullah Khasawneh wrote: > > Dear all, > > I have recently finished reading "Introduction to R" and enjoyed it and > benefited from it immensely. Thank you very much

[R] Comments on "Introduction to R"

2021-06-11 Thread Abdullah Khasawneh
Dear all, I have recently finished reading "Introduction to R" and enjoyed it and benefited from it immensely. Thank you very much for your efforts. I feel the word "corrections" is a bit presumptuous, so below are a few suggestions I have regarding the text. Please let me know if I am

Re: [R-es] Posible fuga de datos y malware

2021-06-11 Thread miguel.angel.rodriguez.muinos
Hola Jorge. Soy el administrador (uno de ellos) de la lista de R-help-es. Por favor reenvíame el email (por privado) para realizar unas comprobaciones. Te confirmo que al resto de usuarios de la lista no nos están llegando correos sospechosos procedentes de tu dirección (para que te quedes