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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:45:11+00:00 2026-06-15T22:45:11+00:00

As a simple, concrete example: #’ Inverse Value Matching #’ #’ Complement of \code{%in%}.

  • 0

As a simple, concrete example:

#' Inverse Value Matching
#' 
#' Complement of \code{%in%}. Returns the elements of \code{x} that are
#' not in \code{y}.
#' @usage x %nin% y
#' @param x a vector
#' @param y a vector
#' @export
"%nin%" <- function(x, y) {
  return( !(x %in% y) )
}

However, when I attempt to build a package the function seems to be ignored and no documentation is generated.

There seems to be a one-line blurb about binary infix functions at http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Documenting-functions, but I am having a hard time parsing it, and what it would imply for Roxygen documentation.

  • 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-15T22:45:12+00:00Added an answer on June 15, 2026 at 10:45 pm

    You need to escape the %s in the usage section. Also, I think you may need to specify an rdname

    #' Inverse Value Matching
    #' 
    #' Complement of \code{%in%}. Returns the elements of \code{x} that are
    #' not in \code{y}.
    #' @usage x \%nin\% y
    #' @param x a vector
    #' @param y a vector
    #' @export
    #' @rdname nin
    "%nin%" <- function(x, y) {
      return( !(x %in% y) )
    }
    

    Here is a function I have in a personal package. I don’t think I’ve ever actually used the function, but roxygenize does create a help file and the package passes R CMD check.

    #' percent in
    #' 
    #' calculate the percentage of elements of \code{table} that are in \code{x}
    #' 
    #' @param x vector or NULL: the values to be matched
    #' @param table vector or NULL: the values to be matched against
    #' @return percentage of elements of \code{x} that are in \code{table}
    #' @author gsee
    #' @usage x \%pctin\% table
    #' @examples
    #' letters[1:10] %pctin% letters[1:3] # 30% of the second arg ar in the first
    #' @export
    #' @rdname PctIn
    "%pctin%" <- function(x, table) length(x[x %in% table])/length(x)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been searching the web for a concrete and simple example of binding
I want to create a simple Ninject provider that returns Moq'd instances instead of
I can't seem to find a simple concrete example of how to receive an
Can someone please derive a concrete example from the following: http://www.urdalen.com/blog/?p=210 ..that shows how
I'm trying to adapt some code from a simple app that uses Raphael to
I have a very simple query that is not much more complicated than: select
Simple question: Is there a class or interface that encapulates the getting of a
Simple question - How do I convert a string that has been through parseInt
I have an array of objects... for a concrete example, let's call the array
This is something that should be very simple. I just want to read numbers

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.