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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:21:12+00:00 2026-06-16T07:21:12+00:00

Many R packages allow functions that take expressions as arguments. Some, however, go a

  • 0

Many R packages allow functions that take expressions as arguments. Some, however, go a step further. For example, the plyr package by @hadley boldly defines a function named .:

> .
function (..., .env = parent.frame()) 
{
    structure(as.list(match.call()[-1]), env = .env, class = "quoted")
}
<environment: namespace:plyr>

In my environment, ?'.' produces “No help found for topic in any package.” On the surface, it looks like .() provides a mechanism for delayed evaluation that automatically captures the surrounding environment:

> x <- c(1,2,3)
> dot <- .(x + 10)
> dot
List of 1
 $ x + 10: language x + 10
 - attr(*, "env")=<environment: R_GlobalEnv> 
 - attr(*, "class")= chr "quoted"
> dot[[1]]
x + 10
> eval(dot[[1]])
[1] 11 12 13

Is that all that’s going on? I understand the purpose of the env attribute but why is class = "quoted" important?

With all the different mechanisms R has to define expressions as well as delay and force evaluation, what are some of the benefits and costs of using the pattern of .() when passing expressions?

  • 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-16T07:21:14+00:00Added an answer on June 16, 2026 at 7:21 am

    From ?'.'

    Details

    Similar tricks can be performed with substitute, but when functions can be called in multiple ways it becomes increasingly tricky to ensure that the values are extracted from the correct frame. Substitute tricks also make it difficult to program against the functions that use them, while the quoted class provides as.quoted.character to convert strings to the appropriate data structure.

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

Sidebar

Related Questions

Are there any good packages for colour palettes in R that can handle many
I am looking for a Java tool/package/library that will allow me to force-kill a
I have a project with many packages and classes. It is obvious that it
I have a project that runs on Debian and uses many packages provided from
Okay, I am writing a function that will allow many different types of bullets
Often in R, there are a dozen functions scattered across as many packages--all of
I am hoping to get some help solving a problem that I'm sure many
How Debian manage conflicts on packages names? As example, when there is many packages
I have some huge NetBeans projects with many packages, sub-packages, sub-sub-packages .etc, and it
I see many Java packages have api, impl and bundle jars (name-api.jar, name-impl.jar, name-bundle.jar).

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.