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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:53:22+00:00 2026-05-27T22:53:22+00:00

>>> [(x*y) for (x,y) in zip(range(3), (1,11,111))] [0, 11, 222] Not like this >

  • 0
>>> [(x*y) for (x,y) in zip(range(3), (1,11,111))]
[0, 11, 222]                                             

Not like this

> data.frame(0:2,c(1,11,111))
  X0.2 c.1..11..111.
1    0             1
2    1            11
3    2           111
> data.frame(0:2,c(1,11,111))->a
> a[1]*a[2]
  X0.2
1    0
2   11
3  222

but something like this

lapply(a, function(x)
{   ...how can I access here the parameters of x? 
    (not using x[1] or x[2])
}
  • 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-05-27T22:53:22+00:00Added an answer on May 27, 2026 at 10:53 pm

    For the general pattern, perhaps

    Map(`*`, 0:2, c(1, 11, 111))
    

    or

    unlist(Map(`*`, 0:2, c(1, 11, 111)))
    

    or more explicitly

    Map(function(x, y) x*y, 0:2, c(1, 11, 111))
    

    (I like Map better than Steve’s mapply because it does not simplify by default, is shorter to type, and plays well with the other functional functions documented on its man page, e.g., Reduce, Filter, and Negate).

    An earlier answer for the particular question, since removed, was just 0:2 * c(1, 11, 111), which would be much more efficient.

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

Sidebar

Related Questions

If I do something like this: from zipfile import ZipFile zip = ZipFile(archive, a)
I need to zip a set of blobs available in data store. These can
I have a data set that is generated by a Zip Code range search:
I would like to write a JavaScript function that validates a zip code, by
Let me start with this: I can't zip it or anything similar. What I'm
I want zip up a folder structured like so: temp/folder1/file1 temp/folder2/file2 temp/file3 and maintain
Given a function zipdistance(zipfrom,zipto) which calculates the distance (in miles) between two zip codes
I've been using (Ubuntu's) file-roller to compress a range of files, e.g. .gz, .zip,
I have a function that takes in a zip code and assigns it a
var a = Observable.Range(0, 10); var b = Observable.Range(5, 10); var zip = a.Zip(b,

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.