[R] strsplit (regex)

From: stephen sefick <ssefick_at_gmail.com>
Date: Tue, 11 Nov 2008 14:33:26 -0500


#how do I break these up into first two letters (RM), number, and then the last part
#is there an easily accessible regex tutorial on the internet?

v = (structure(1:122, .Label = c("RM215Temp", "RM215SpCond", "RM215DO.Conc",
"RM215Depth", "RM215pH", "RM215ORP", "RM215Turbidity.", "RM215Battery",
"RM215DO.", "SCTemp", "SCSpCond", "SCDO.Conc", "SCDepth", "SCpH",
"SCORP", "SCTurbidity.", "SCBattery", "SCDO.", "RM202Temp", "RM202SpCond",
"RM202DO.Conc", "RM202Depth", "RM202pH", "RM202ORP", "RM202Turbidity",
"RM202Battery", "RM202DO.", "RM198Temp", "RM198SpCond", "RM198DO.Conc",
"RM198Depth", "RM198pH", "RM198ORP", "RM198Turbidity.", "RM198Battery",
"RM198DO.", "HCTemp", "HCSpCond", "HCDO.Conc", "HCDepth", "HCpH",
"HCORP", "HCTurbidity.", "HCBattery", "HCDO.", "RM190Temp", "RM190SpCond",
"RM190DO.Conc", "RM190Depth", "RM190pH", "RM190ORP", "RM190Turbidity.",
"RM190Battery", "RM190DO.", "BCTemp", "BCSpCond", "BCDO.Conc",
"BCDepth", "BCpH", "BCORP", "BCTurbidity.", "BCBattery", "BCDO.",
"RM185Temp", "RM185SpCond", "RM185DO.Conc", "RM185Depth", "RM185pH",
"RM185ORP", "RM185Turbidity.", "RM185Battery", "RM185DO.", "RM179Temp",
"RM179SpCond", "RM179DO.Conc", "RM179Depth", "RM179pH", "RM179ORP",
"RM179Turbidity.", "RM179Battery", "RM179DO.", "RM148Temp", "RM148SpCond",
"RM148DO.Conc", "RM148Depth", "RM148pH", "RM148ORP", "RM148Turbidity.",
"RM148Battery", "RM148DO.", "RM119Temp", "RM119SpCond", "RM119DO.Conc",
"RM119Depth", "RM119pH", "RM119ORP", "RM119Turbidity.", "RM119Battery",
"RM119DO.", "RM61Temp", "RM61SpCond", "RM61DO.Conc", "RM61Depth",
"RM61pH", "RM61ORP", "RM61Turbidity.", "RM61Battery", "RM61DO.",
"NSBL.Dflow", "RM148flow", "RM119flow", "RM61flow", "RM190heat",
"RM185heat", "RM148heat", "RM119heat", "RM61heat", "RM190DOmass",
"RM185DOmass", "RM148DOmass", "RM119DOmass", "RM61DOmass"), class = "factor"))

thanks

-- 
Stephen Sefick
Research Scientist
Southeastern Natural Sciences Academy

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

								-K. Mullis

______________________________________________
R-help_at_r-project.org 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.
Received on Tue 11 Nov 2008 - 19:35:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 12 Nov 2008 - 07:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive