ot;,"C"),function(x)
paste0(levels(nCourse),x)),stringsAsFactors=FALSE),c("B","P","C"))
head(res)
# B P C
#1 2AB 2AP 2AC
#2 2BB 2BP 2BC
#3 2CB 2CP 2CC
#4 7AB 7AP 7AC
#5 7BB 7BP 7BC
#6 7CB 7CP 7CC
A.K.
- Original Message -
From: Robert Lynch
To: R hel
Hello,
Try the following.
gsub("^0+", "", as.character(nCourse))
Hope this helps,
Rui Barradas
Em 01-09-2013 21:41, Robert Lynch escreveu:
I have a variable that is course #
nCourse <-
as.factor(c("002A","002B","002C","007A","007B","007C","101","118A","118B","118C"))
And I would like to ge
I have a variable that is course #
nCourse <-
as.factor(c("002A","002B","002C","007A","007B","007C","101","118A","118B","118C"))
And I would like to get rid of the leading zeros, and have the following
set
("2A","2B","2C","7A","7B","7C","101","118A","118B","118C") to paste()
together with the depa
3 matches
Mail list logo