I have a data frame as follows (part of a larger set):
for the column raw$Zipcode
I need to remove the two 00
before the Zipcode number for Swedish zipcodes (preferably through a function). I am very new to R and have found gsub
and strsplit
but can't seem to make it work:
raw2 <- unlist(strsplit(raw$ZipCode, split="00", fixed=TRUE))[2]
The zeroes are characters as other countries in the data set have letters. How can I remove the first two zeroes in all cases of the two first character letters being zeroes in a column?