Skip to content

Problem with lists #1

@Nallelybp

Description

@Nallelybp

I have tried to replicate the example of the function predict_uvcov and I got the next error

Factoring method for vcov matrix set to 'auto' for mrk
Error: couldn't evaluate grouping factor random[[1]]$id within model frame: try adding grouping factor to data frame explicitly if possible

I attached the code I used

library(BGLR)
library(lme4GS)

datos <- read.csv("C:/BGLR/Examples/Wheat_GrainYield.csv")
y=datos[,2]
fold=2
nfolds=10
sizeFold=floor(length(y)/nfolds)
theFolds <- rep(1:nfolds,sizeFold)
theFolds <- sample(theFolds)
y_trn=y[theFolds!=fold]
y_tst=y[theFolds==fold]
gen = as.character(datos[,1])
gen2 =gen[theFolds!=fold]
X <- read.csv("C:/BGLR/Examples/Wheat_Markers.csv")
Z<-scale(X,center=TRUE,scale=TRUE)
names(y)=gen
names(y_trn)=gen2
G<-tcrossprod(Z)/ncol(Z)
rownames(G)=colnames(G)=gen
aleat=list(mrk=list(K=G,id=names(y_trn)))
out<-lmer_uvcov(y_trn,fixed="1",random=aleat)

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