You can use the head function that returns the first or last parts of a vector, matrix, table, data frame or function.
For example:
df <- data.frame(x=rnorm(100), y=rnorm(100))
> head(df,4)
x y
1 -0.1158253 1.6802782
2 -0.8149687 0.7795840
3 0.2422635 0.7132405
4 -1.4250984 -0.5428819
You can also use the index of the rows to print them as follows:
df[row.index, column.index]
For example:
df[1:4,]
x y
1 -0.1158253 1.6802782
2 -0.8149687 0.7795840
3 0.2422635 0.7132405
4 -1.4250984 -0.5428819