Given two columns of type character in a dataframe of the form:
col1 col2
31* 66
0 0*
102* 66
71* 80
31 2*
66 31*
47 38*
How do I generate the following dataframe? Ie. col1 contains row item
with "*" and col2 contains row member without "*"
col1 col2
31 66
0 0
102 66
71 80
2 31
31 66
38 47
Partial ideas thus far....
grep("*",col1,fixed=T)
as.numeric(gsub("*","",col1))
Thanks. --Dale
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.