auto insurance
4 insurance
5 auto insurance
6
A.K.
- Original Message -
From: Abraham Mathew
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
----
From: Abraham Mathew
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" values from each string, and also
remove all "|" values from
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
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|quot
4 matches
Mail list logo