I am trying to use the GAMens package for a ‘one dimensional dataset’ (one predictor and one response) for a very simple artificial dataset:
library(GAMens)
trainingdata <- read.table("D:/data.txt", header = TRUE, sep="\t")
trainingdata.GAMrsm <- GAMens(class~., trainingdata, 1, autoform=TRUE, iter=10, rsm=FALSE)
Unfortunately I get:
Error in [.data.frame(data, , as.character(formula[[2]])) :
undefined columns selected
Maybe I am missing something but is it should be possible to get this to work for the one dimensional case (‘dimensions’ greater one work fine). Thanks.
EDIT:
This is how the artificial data is generated:
n.site <- 150
X1<- sort(runif(n = n.site, min = -1, max =1))
xb <- 0.0 + 3.0*X1
occ.prob <- 1/(1+exp(-xb))
true.presence <- rbinom(n = n.site, size = 1, prob = occ.prob)
data <- data.frame(X1, true.presence)
write.matrix(data, file = "data.txt", sep = "\t")
Alternatively you can download the data here:
The issue is solved in a new version of the package. Please download version 1.1.2 of the GAMens package via the CRAN repository.
Best regards