I am working with a data set that has a column with values that I would like to transform.
The problem that I have right now is that my data looks like:
- Site Count
- 1 1 35
- 1 10 38
- 1 2 56
- 1 3 23
- 1 4 25
- 1 5 45
- …….
I would like to remove the 1 that is present in all the sites and just leave it 1, 2, 3, 4, 5… 10.
I tried to transform it using as.number but it gives me the site 1.10 as the second value so it is not right.
An example dataset:
To get rid of the
1bit:Here I use
subto substitute the1by an empty string. The transformation to numeric then works: