I am trying to find the best way to use this pedigree class without using library pedigreemm first.
p1 <- new("pedigree", sire = as.integer(c(NA,NA,1, 1,4,5)), dam = as.integer(c(NA,NA,2,NA,3,2)), label = as.character(1:6)) Error in getClass(Class, where = topenv(parent.frame())) :
“pedigree” is not a defined class
To be clear, I am trying to do something like base::mean(). However, as the new() function do not belong to the pedigreemm package seems to be not that straightforward. Thus, I can't just do pedigreemm::new(). It is important to highlight that the code works just fine if I load the pedigreemm package first, but I need a way to run without loading it first. Any ideas?
@importClassesFrom pedigreemm pedigreeif usingroxygen2? If the class is defined in another package, then I think the only option available is to import the class.package::functionis always prefered. As an example: if you intend to useggplot2functions in a package, then callingggplot2::functionwill make the code long and hard to read as you end up using many functions together (i.e.aes,ggplot,geom_*,scale_*, etc). While you could import those functions and have a shorter and more legible code.