Skip to content

deprecated knnest throws error w/o ref to kNN #34

@nks1974

Description

@nks1974

knnest throws error in is.data.frame(x) : argument y is missing with no default

Suggestion: change error to 'Deprecated, use kNN instead'

xdata <- preprocessx(x = mlb[,c('Height','Age')] , kmax = 20, xval = F )
kout <- knnest(y = mlb[,'Weight'], xdata = xdata, k = 20)
Error in is.data.frame(x) : argument "y" is missing, with no default

copy paste:

kout <- knnest(y = mlb[,5], xdata = xdata, k = 20)
Error in is.data.frame(x) : argument "y" is missing, with no default
traceback()
7: is.data.frame(x)
6: colMeans(y[nearIdxs, , drop = FALSE])
5: nearf(x[i, ], nearxy[[i]])
4: FUN(X[[i]], ...)
3: lapply(X = X, FUN = FUN, ...)
2: sapply(1:nrow(x), function(i) nearf(x[i, ], nearxy[[i]]))
1: knnest(y = mlb[, 5], xdata = xdata, k = 20)
sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base

other attached packages:
[1] regtools_1.6.0 dummies_1.5.6 data.table_1.14.0 freqparcoord_1.0.1 mvtnorm_1.1-1 FNN_1.1.3
[7] GGally_2.1.1 ggplot2_3.3.3 nvimcom_0.9-113

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions