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

The Archive Base Latest Questions

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

It makes no sense to me that approx would return a list, since –

  • 0

It makes no sense to me that approx would return a list, since – if I understand it correctly – the two elements of the list that it returns are guaranteed to be numeric and of equal length. Given that, it would seem to make more sense to return an array or a data frame.

I’m writing some functions using approx, and this makes me thing that I don’t fully understand how it works. Is there a situation in which a list is necessary, or better?

  • 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-12T16:21:32+00:00Added an answer on June 12, 2026 at 4:21 pm

    Functions take pairlists as arguments. Generally lists are used to pass arguments to lattice graphics, which was the dominant high-level graphics environment before ggplot and descendants came along. Lists are also used to pass parameters to control arguments in many functions. In this case you would expect the x and y lengths to be the same, so it could be a dataframe, but there is no particular reason to demand such a structure, and the base functions points and lines will accept named lists and properly allocate them to their argument lists.

    (I do not think a matrix could get properly distributed to the x and y arguments of the base plotting routines even of there were row or column names that matched. Matrices are really folded vectors.)

    So I think the answer is that passing lists is most consistent with how functional programming is implemented in R.

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

Sidebar

Related Questions

It makes sense that something like an operating system would be written in C.
I can understand why the assignment operator is right associative. It makes sense that
It now makes sense that the versions aren't right. I know I am using
Does it makes sense that when columns of a datagridview are cleared, all rows
I need to design a page for a web application that makes sense for
So I've tried searching just about everywhere with the terms that makes sense to
Or at least the part of it, that makes sense. More specifically I have
I hope the title makes sense. I have a set of items that I
salesforce plans page says that they charge per user. Well, it makes sense to
I want to make something that makes much sense, but I think its not

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.