insurance
6
A.K.
- Original Message -
From: Abraham Mathew abmathe...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Thursday, July 19, 2012 3:21 PM
Subject: [R] Removing values from a string
So I have the following data frame and I want to know how I can remove all
NA
So I have the following data frame and I want to know how I can remove all
NA values from each string, and also
remove all | values from the START of the string. So they should
something like auto|insurance or auto|insurance|quote
one = data.frame(keyword=c(|auto, NA|auto|insurance|quote,
There are a couple of ambiguities in your request, but this should get
you started:
one$keyword - gsub(NA\\|, , one$keyword)
one$keyword - gsub(^\\|, , one$keyword)
one
keyword
1 auto
2 auto|insurance|quote
3 auto|insurance
4insurance
5
] Removing values from a string
So I have the following data frame and I want to know how I can remove all
NA values from each string, and also
remove all | values from the START of the string. So they should
something like auto|insurance or auto|insurance|quote
one = data.frame(keyword=c(|auto, NA
4 matches
Mail list logo