Extract matrix from specified place in a data fram


Well-Known Member
Hi folks.
Is there a quick way to get a matrix with the data from, say, (2, 5) to (15, 20) in a given data frame?
Cheers, kat


Ambassador to the humans
Are you saying the data in rows 2 to 5 and only columns 15 to 20? If so

mydf[2:5, 15:20]

And if you want it converted to matrix just wrap that in as.matrix