Suppose I create a dataframe (just to make it simple):
testframe <- data.frame( a = c(1,2,3,4), b = c(5,6,7,8))
So I have two variables (columns) and four cases (rows).
If I select some of the BEGINNING WITH THE FIRST rows, I get some subset of the data frame, for example:
testframe2 <- testframe[1:2,]
But if I do the same with the NOT BEGINNING WITH THE FIRST ROW row, I get another column containing the row numbers of the original frame.
testframe3 <- testframe[3:4,]
leads to:
ab 3 3 7 4 4 8
What can I do to prevent the new row.names variable? I know that I can delete it later, but perhaps it can be avoided from the very beginning.
Thank you for your help!
source share