@@ -1690,7 +1690,7 @@ specifySpecies$set('private', 'addData', function(dataList, responseCounts, resp
1690
1690
naCovs <- names(naRows )[sapply(naRows , length ) > 0 ] # identify covs with missing data
1691
1691
for (cov in naCovs ){ # fill missing values for rows/covs using nearest neighbour
1692
1692
fullGeomCovs [naRows [[cov ]], cov ] <-
1693
- nearestValue(st_coordinates(fullGeom [naRows [[cov ]],])[,c(" X" ," Y" )],
1693
+ nearestValue(matrix ( st_coordinates(fullGeom [naRows [[cov ]],])[,c(" X" ," Y" )], ncol = 2 ) ,
1694
1694
get(' spatialcovariates' , envir = private $ spatcovsEnv )[cov ])
1695
1695
# out <- inlabru::bru_fill_missing(where = fullGeom[naRows[[cov]],],
1696
1696
# data = get('spatialcovariates',
@@ -1741,7 +1741,7 @@ specifySpecies$set('private', 'addData', function(dataList, responseCounts, resp
1741
1741
naCovs <- names(naRows )[sapply(naRows , length ) > 0 ] # identify covs with missing data
1742
1742
for (cov in naCovs ){ # fill missing values for rows/covs using nearest neighbour
1743
1743
meshCovs [naRows [[cov ]], cov ] <-
1744
- nearestValue(st_coordinates(private $ IPS [naRows [[cov ]],])[,c(" X" ," Y" )],
1744
+ nearestValue(matrix ( st_coordinates(private $ IPS [naRows [[cov ]],])[,c(" X" ," Y" )], ncol = 2 ) ,
1745
1745
get(' spatialcovariates' , envir = private $ spatcovsEnv )[cov ])
1746
1746
}
1747
1747
0 commit comments