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 8172271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:43:55+00:00 2026-06-06T21:43:55+00:00

I have a function in R that looks somewhat like this: setMethod(‘[‘, signature(x=stack),definition=function(x,i,j,drop){ new(‘class’,

  • 0

I have a function in R that looks somewhat like this:

setMethod('[', signature(x="stack"),definition=function(x,i,j,drop){
  new('class', as(x, "SpatialPointsDataFrame")[i,]) })

I use it to get a single element out of a stacked object. For the package I’m building I need a .Rd file to document the function. I stored it as [.Rd but somehow the R CMD check does not see this. It returns:

Undocumented S4 methods:  generic '[' and siglist 'MoveStack,ANY,ANY'

The [.Rd file starts with these lines:

\name{[}    
\alias{[}
\alias{[,stack,ANY,ANY-method}    
\docType{methods}    
\title{Returns an object from a stack}    
\description{Returning a single object}    
\usage{
  \S4method{\[}{stack,ANY,ANY}(x,i,y,drop)
}

Any idea how I make R CMD check aware of this file?

  • 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-06T21:43:57+00:00Added an answer on June 6, 2026 at 9:43 pm

    If you look at the source code of the sp package, for example SpatialPolygons-class.Rd, the Methods section:

    \section{Methods}{
    Methods defined with class "SpatialPolygons" in the signature:
      \describe{
        \item{[}{\code{signature(obj = "SpatialPolygons")}: select subset of (sets of) polygons; NAs are not permitted in the row index}
        \item{plot}{\code{signature(x = "SpatialPolygons", y = "missing")}: 
        plot polygons in SpatialPolygons object}
        \item{summary}{\code{signature(object = "SpatialPolygons")}: summarize object}
        \item{rbind}{\code{signature(object = "SpatialPolygons")}: rbind-like method}
      }
    }
    

    method for [ is defined.

    Name and class of the file are

    \name{SpatialPolygons-class}
    \alias{[,SpatialPolygons-method}
    

    If you look at the help page for ?SpatialPolygons you should see

    > Methods
    > 
    > Methods defined with class "SpatialPolygons" in the signature:
    > 
    > [ signature(obj = "SpatialPolygons"): select subset of (sets of)
    > polygons; NAs are not permitted in the row index
    > 
    

    So I would venture a guess that if you specify a proper (ASCII named) file name, give it an alias as in the above example, you should be fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that looks somewhat like this: function(domObj) { var currentObj =
I have a function that looks like this: class SomeClass { // ... };
i have a function that looks like this. function startChatSession($items) { foreach ($test as
I have a JavaScript function that looks like this: function recalculateWhatIfCurrentRate(aEle, aChangedLabel, recordID, yearEndCurrentRate)
I have a constexpr function that looks something like this: constexpr int foo(int bar)
I have code that looks like this: var baseClass = function() { // CODE
I have some code that looks like this: var MyObject = function () {
I have a script that looks like this #!/bin/bash function something() { echo hello
Inside my .aspx I have some JSON code that looks like this: function someFunctionName()
Here is the situation. I have some javascript that looks like this: function onSubmit()

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.