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

Gregg Powell g@@@powe|| @end|ng |rom protonm@||@com
Wed Sep 15 04:01:53 CEST 2021




> 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[!is.integer(VPN_Sheet1$HVA),]

Neither work - Neither throw an error.

class(VPN_Sheet1$HVA)  returns:
[1] "list"

So, the HVA column returns a list.

>
> Data looks like the attached screen grab -
> 

> The ONLY rows I need to delete are the rows where there is a numeric in the HVA column.
> 

> There are some 5000+ rows in the actual data.
> 

> Would be grateful for a solution to this problem.

How to get R to detect whether the value in column 1 is a number so the rows with the number values can be deleted?
> 

> Thanks in advance to any and all willing to help on this problem.
> 

> Gregg Powell
> 

> Sierra Vista, AZ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 509 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20210915/f0da5667/attachment.sig>


More information about the R-help mailing list