Skip to content
Prev 169457 / 398506 Next

how to separate char and num within a variable

Thx a lot! It works



----- Original Message ----
From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no>
To: Bill Hyman <billhyman1 at yahoo.com>
Cc: R help <R-help at stat.math.ethz.ch>
Sent: Thursday, February 5, 2009 3:38:34 PM
Subject: Re: [R] how to separate char and num within a variable
Bill Hyman wrote:
if strings is your vector of strings, this should do (assuming the
format is stable across all entries):

strsplit(strings, split=':|-')

vQ