Hi I get this error when I run this line:
new.sdm.dat = data.frame(new.occ, ph, aws, depth, org, c.cov, elev, asp, dup)
Error in data.frame(new.occ, ph, aws, depth, org, c.cov, elev, asp, dup) :
arguments imply differing number of rows: 3168, 5000, 1281
How do I fix it?
Lines of code running up to it:
new.sp <- SpatialPoints(new.occ[1:2])
crs(new.sp) <- CRS('+proj=longlat +datum=WGS84')
new.sp <- spTransform(new.sp, newcrs)
new.sp.cc <-spTransform(new.sp, tempcrs)
new.sp.topo <-spTransform(new.sp, topocrs)
ph <- over(new.sp, soilph)$pHwater
aws <- over(new.sp, soilh20)$AWS025
depth <- over(new.sp, soildep)$Dep2ResLyr
org <- over(new.sp, soilorg)$OrgMatter
c.cov <- raster::extract(canopy, new.sp.cc)
elev <- raster::extract(elev.dat, bg.sp.topo)
asp <- raster::extract(aspect.dat, bg.sp.topo)
sapply(list(new.occ, ph, aws, depth, org, c.cov, elev, asp), length)
new.sdm.dat = data.frame(new.occ, ph, aws, depth, org, c.cov, elev, asp, dup)