Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spatSample as.df=FALSE returns data.frame instead of matrix #982

Closed
ailich opened this issue Jan 20, 2023 · 1 comment
Closed

spatSample as.df=FALSE returns data.frame instead of matrix #982

ailich opened this issue Jan 20, 2023 · 1 comment

Comments

@ailich
Copy link
Contributor

ailich commented Jan 20, 2023

In spatSample setting as.df=FALSE should return a martix but instead returns a data.frame.

library(terra)
#> Warning: package 'terra' was built under R version 4.2.2
#> terra 1.6.51
r<- rast(volcano)

samp<- spatSample(r, size=10, as.df=FALSE)
#> Warning: [is.lonlat] assuming lon/lat crs
class(samp)
#> [1] "data.frame"

Created on 2023-01-20 with reprex v2.0.2

@rhijmans
Copy link
Member

Thanks. I now see

class(samp)
[1] "matrix" "array" 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants