I have the following to create a data frame. My problem is that the data frame row names display as [1,],[2,],[3,],[4,], etc instead of just 1,2,3,4,etc (see below for outputs). Why and how can I fix this to just have my row names show as usual (incremented number).
Code:
df <- data.frame(id=c("id"),nobs=c("nobs"))
df <- cbind(id,nobs)
df
id and nobs are two vectors with 5 numeric values each...
Current output:
id nobs
[1,] 2 3653
[2,] 4 3653
[3,] 8 1462
[4,] 10 1097
[5,] 12 732
Desired output:
id nobs
1 2 3653
2 4 3653
3 8 1462
4 10 1097
5 12 732