Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-15 Thread Gregg Powell via R-help
gt;From: R-help On Behalf Of Avi Gross via R-help > >Sent: Wednesday, September 15, 2021 1:23 AM > >To: R-help@r-project.org > >Subject: Re: \[R\] How to remove all rows that have a numeric in the first > >(or any) column > > > >You are correct, Gregg, I am aware

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Jeff Newmiller
> > >-Original Message- >From: R-help On Behalf Of Avi Gross via R-help >Sent: Wednesday, September 15, 2021 1:23 AM >To: R-help@r-project.org >Subject: Re: [R] How to remove all rows that have a numeric in the first (or >any) column > >You are correct, Gregg, I a

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Avi Gross via R-help
handle them become better or at least better understood. -Original Message- From: R-help On Behalf Of Avi Gross via R-help Sent: Wednesday, September 15, 2021 1:23 AM To: R-help@r-project.org Subject: Re: [R] How to remove all rows that have a numeric in the first (or any) column You are

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Avi Gross via R-help
Of course, the temporary columns for alphazoid and betazoid can trivially be removed. From: Andrew Simmons Sent: Wednesday, September 15, 2021 12:44 AM To: Avi Gross Cc: Gregg Powell via R-help Subject: Re: [R] How to remove all rows that have a numeric in the first (or any) colum

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Andrew Simmons
> tibble [2 x 2] (S3: tbl_df/tbl/data.frame) > $ alpha: int [1:2] 1 4 > $ beta :List of 2 > ..$ : chr "Hello" > ..$ : chr "bye" > > So if you try variations on your code motivated by what I show, good luck. > I am sure there are many better ways but I repe

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Avi Gross via R-help
2021 11:54 PM To: Gregg Powell Cc: Gregg Powell via R-help Subject: Re: [R] How to remove all rows that have a numeric in the first (or any) column You cannot apply vectorized operators to list columns... you have to use a map function like sapply or purrr::map_lgl to obtain a logical vector by r

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Avi Gross via R-help
:54 PM To: Gregg Powell Cc: Gregg Powell via R-help Subject: Re: [R] How to remove all rows that have a numeric in the first (or any) column You cannot apply vectorized operators to list columns... you have to use a map function like sapply or purrr::map_lgl to obtain a logical vector by r

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Jeff Newmiller
You cannot apply vectorized operators to list columns... you have to use a map function like sapply or purrr::map_lgl to obtain a logical vector by running the function once for each list element: sapply( VPN_Sheet1$HVA, is.numeric ) On September 14, 2021 8:38:35 PM PDT, Gregg Powell wrote: >

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Andrew Simmons
'is.numeric' is a function that returns whether its input is a numeric vector. It looks like what you want to do is VPN_Sheet1 <- VPN_Sheet1[!vapply(VPN_Sheet1$HVA, "is.numeric", NA), ] instead of VPN_Sheet1 <- VPN_Sheet1[!is.numeric(VPN_Sheet1$HVA), ] I hope this helps, and see ?vapply if nece

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Rolf Turner
On Wed, 15 Sep 2021 02:01:53 + Gregg Powell via R-help wrote: > > Stuck on this problem - How does one remove all rows in a dataframe > > that have a numeric in the first (or any) column? > > > > > Seems straight forward - but I'm having trouble. > > > > > I've attempted to used: > >

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Gregg Powell via R-help
Here is the output: > str(VPN_Sheet1$HVA) List of 2174 $ : chr "Email: f...@fff.com" $ : num 1 $ : chr "Eloisa Libas" $ : chr "Percival Esquejo" $ : chr "Louchelle Singh" $ : num 2 $ : chr "Charisse Anne Tabarno, RN" $ : chr "Sol Amor Mucoy" $ : chr "Josan Moira Paler" $ : num 3

Re: [R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Jeff Newmiller
An atomic column of data by design has exactly one mode, so if _any_ values are non-numeric then the entire column will be non-numeric. What does str(VPN_Sheet1$HVA) tell you? It is likely either a factor or character data. On September 14, 2021 7:01:53 PM PDT, Gregg Powell via R-help wrote:

[R] How to remove all rows that have a numeric in the first (or any) column

2021-09-14 Thread Gregg Powell via R-help
> Stuck on this problem - How does one remove all rows in a dataframe that have > a numeric in the first (or any) column? > > Seems straight forward - but I'm having trouble. > I've attempted to used: VPN_Sheet1 <- VPN_Sheet1[!is.numeric(VPN_Sheet1$HVA),] and VPN_Sheet1 <- VPN_Sheet1[!i