Skip to content
Prev 389183 / 398506 Next

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

'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 necessary.

On Tue, Sep 14, 2021 at 11:42 PM Gregg Powell via R-help <
r-help at r-project.org> wrote:

            

  
  
Message-ID: <CAPcHnpQFPY8eJOo5DKG=UaLyS48E9O0B43PGGeKGeorFwf0_EQ@mail.gmail.com>
In-Reply-To: <sE0QX_gzL2sYKaWmX7FuESeIEt_y4VDdE3PHJ1yPNe8Mlm8kQ3Wd8NYLzU9lQCA7iHUNSIqKNcO0M2_nzFq1JdMN26OCj2rZNw7lf-wyE5o=@protonmail.com>