[R] grepAMModelLib in package AMML not working as expected

Ashim Kapoor ashimkapoor at gmail.com
Thu Mar 8 07:46:41 CET 2018


Dear All,

Here is a minimal working example :

library(AMModels)

mymodels <- amModelLib(description = "Simple AM Model library")

dataset1 <- 1:100
dataset2 <- seq(2,200,2)

model1 <- lm(dataset2~1)
model2 <- lm(dataset2~ dataset1)

m1 <- amModel(model = model1,comment  = "Initial model.")
m2 <- amModel(model = model2,comment  = "Final model.")

mymodels <- insertAMModelLib(model = list(m1=m1,m2=m2),amml = mymodels)


> grepAMModelLib(pattern= "m1",amml = mymodels,search = "model")

Description:
[1] Simple AM Model library

Info:
** no informative metadata **


Models:
  name class package
1   m1    lm      NA

Data:

 --- There are no datasets ---


Here I am searching for all models which have the letter "1".

> grepAMModelLib(pattern= "1",amml = mymodels,search = "model")

Description:
[1] Simple AM Model library

Info:
** no informative metadata **


Models:
  name class package
1   m1    lm      NA
2   m2    lm      NA

Data:

 --- There are no datasets ---
>

The above should return only model m1. Why does the result of grepping
return both m1 and m2 ? Where do I misunderstand ?

Best Regards,
Ashim

	[[alternative HTML version deleted]]



More information about the R-help mailing list