Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in plotPed() function #30

Open
KimBruijns opened this issue Jun 2, 2022 · 2 comments
Open

Error in plotPed() function #30

KimBruijns opened this issue Jun 2, 2022 · 2 comments

Comments

@KimBruijns
Copy link

KimBruijns commented Jun 2, 2022

Hi!

When running this code:
mbsub <- pedigfinal[pedigfinal$famid %in% 7:10, ]
mbsub<-rename(mbsub, "family"="famid", "id"="Indiv", "father"="Sire", "mother"="Dam", "sex"="Sex")
mbped <- mbsub[, c("family", "id", "father", "mother", "sex")]
fad <- FAData(pedigree = mbped)
plotPed(fad, family = "9")

The function plotPed() from package::FamAgg is not working (the rest works and creates an FAData object) and returns this error:
"Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘plotPed’ for signature ‘"character" ".

I thought it might be because of masked objects but specifying the package to use does not help.

Thank you for your help!

@jorainer
Copy link
Member

Dear Kim,

really sorry for the very late reply. Was on holidays and am now on a conference. I'll have a look into this soon.

@jorainer
Copy link
Member

Can you please verify that fad is indeed a FAData? I.e. report here the output of class(fad)? And maybe also of class(mbped)?

Finally, maybe it's because family 9 consists only of a single member and subsetting drops from a two-dimensional data structure to a character. Can you maybe also provide this information:

sum(mbped[, "family"] == "9")

My guess would be that during subsetting to family 9 somehow the dimensions (or the FAData object) gets lost. I also assume that plotPed works for other families?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants