Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8627247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:13:45+00:00 2026-06-12T08:13:45+00:00

I am creating an R package. The package defines several reference classes. There is

  • 0

I am creating an R package. The package defines several reference classes. There is a dependency between the classes because one is the base class and the others are subclasses. Due to this dependency, the package files must be loaded in a certain order: the base class first, then the subclasses. With just my luck, however, R is loading the subclasses first and complaining that the base class is not defined.

How can I force the package’s source files to be executed in a particular order?

My current, kludge “solution” is to put all class definitions into one source file, with the base class defined first. Talk about ugly. There’s gotta be a better way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:13:46+00:00Added an answer on June 12, 2026 at 8:13 am

    I think the Collate: field does that for S4 classes and may help here too. From the Writing R Extensions manual, Section 1.1.1

    An ‘Collate’ field can be used for controlling the collation order
    for the R code files in a package when these are processed for package
    installation. The default is to collate according to the ‘C’ locale.
    If present, the collate specification must list all R code files in
    the package (taking possible OS-specific subdirectories into account,
    see “Package subdirectories”) as a whitespace separated list of
    file paths relative to the ‘R’ subdirectory. Paths containing white
    space or quotes need to be quoted. An OS-specific collation field
    (‘Collate.unix’ or ‘Collate.windows’) will be used instead of
    ‘Collate’.

    And for example the XML package has

    Collate: AAA.R DTD.R DTDClasses.R DTDRef.R SAXMethods.S XMLClasses.R
            applyDOM.R assignChild.R catalog.R createNode.R dynSupports.R
            error.R flatTree.R nodeAccessors.R parseDTD.R schema.S
            summary.R tangle.R toString.S tree.R version.R xmlErrorEnums.R
            xmlEventHandler.R xmlEventParse.R xmlHandler.R
            xmlInternalSource.R xmlOutputDOM.R xmlNodes.R xmlOutputBuffer.R
            xmlTree.R xmlTreeParse.R htmlParse.R hashTree.R zzz.R
            supports.R parser.R libxmlFeatures.R xmlString.R saveXML.R
            namespaces.R readHTMLTable.R reflection.R xmlToDataFrame.R
            bitList.R compare.R encoding.R fixNS.R xmlRoot.R serialize.R
            xmlMemoryMgmt.R keyValueDB.R solrDocs.R XMLRErrorInfo.R
            xincludes.R namespaceHandlers.R tangle1.R
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a well maintained package available in Python for creating and validating HTML
I'm creating several visual objects in loop: ... Package packet; // a visual packet
I am creating package using cmake I am having following structure bin/ bin1 lib/
Folks, We have been using OpenXml APIs found in System.IO.Packaging for creating a package
I am creating an azure package using Visual Studio (right click on azure project
I'm creating an msi package with WiX 3.5 (VS2010) and everything is fine, except
I am creating a custom Survey package which has questions module , answers module
I'm creating a Visual Studio 2010 extension using a Package template, not an Add-in.
I have checked on debian site for creating a package. But, it is not
I am creating two classes which define the general structure of objects, and many

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.