Relative Content

Tag Archive for rstringfunction

R function to identify and remove “>” in column of characters and convert everything to integers

I have a column of data with mostly integers, but some of the values exceeded my measurement capabilities and are prefaced by >, making those values characters. I have python code that identifies and removes those, and converts everything to int. I am working on writing a similar script in R to do more advanced statistics, but I am not good enough at R to translate this function. Do I even need to do it as a function in R, or can I do it as a vector operation? My python code is displayed below.

R function to identify and remove “>” in column of characters and convert everything to integers

I have a column of data with mostly integers, but some of the values exceeded my measurement capabilities and are prefaced by >, making those values characters. I have python code that identifies and removes those, and converts everything to int. I am working on writing a similar script in R to do more advanced statistics, but I am not good enough at R to translate this function. Do I even need to do it as a function in R, or can I do it as a vector operation? My python code is displayed below.