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]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.