I have a column vector composed of characters like these : "2L.70660", "2L.80704" and "X.92727". I want to split this single vector at the "." into two new columns "2L", "2L" and "70660", "80704", and "92727". I'm not really sure the best way to do this? Thanks.
Asked
Active
Viewed 575 times
1 Answers
1
Using v
in the Note at the end use read.table
. No packages are used.
read.table(text = v, sep = ".", as.is = TRUE)
giving this data.frame:
V1 V2
1 2L 70660
2 2L 80704
3 X 92727
Note
The input in reproducible form:
v <- c("2L.70660", "2L.80704", "X.92727")

G. Grothendieck
- 254,981
- 17
- 203
- 341