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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:26:17+00:00 2026-06-09T07:26:17+00:00

When I perform: rep(1:4, rep(4,4)) I get 1 1 1 1 2 2 2

  • 0

When I perform:

rep(1:4, rep(4,4))

I get

1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 

which is expected. But then when I try to fix the length to 16(which is the length of the output) as follows:

rep(1:4, rep(4,4), length.out = 16)

I get

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

which is weird. I think both of these commands should perform the same function. Can someone please help?

Thanks!

  • 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-09T07:26:18+00:00Added an answer on June 9, 2026 at 7:26 am

    From ?rep

    ‘length.out’ may be given in place of ‘times’, in which case ‘x’
    is repeated as many times as is necessary to create a vector of
    this length. If both are given, ‘length.out’ takes priority and
    ‘times’ is ignored.

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

Sidebar

Related Questions

When I perform a jackrabbit (version 2.2.9) search and I call get row.getValue(rep:excerpt()) the
I want to perform an jquery request to php and then I want php
I want to perform the method which has a few arguments. Is there any
I perform calculations using a double as follows: int minutes; double seconds; double DecMinutes;
I am trying to perform a query which is composed of two $or 's:
I perform action mvn eclipse:eclipse to convert from maven project to eclipse, but it
How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT
I perform a query on a table Installation to get a list of Ids
i need to perform an operation (in this case DATEDIFF()) on 2 dates. But
Hi were trying to perform a mysql select which isnt going to plan and

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.