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

  • Home
  • SEARCH
  • 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 6579561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:54:52+00:00 2026-05-25T15:54:52+00:00

Can somebody point me to some reading on some algorithm that given a set

  • 0

Can somebody point me to some reading on some algorithm that given a set n, will place it’s elements in a bigger set m, evenly spaced (as much as possible). I plan to interpolate for the remaining values.

so I have a set of 3 elements which contains

    1 ,5 ,6 

and I want to distribute it in a dataframe of 10 slots as evely as possible with the 1st and last elements being 1st and last accordingly in the new set:

    1 [] [] [] 5 [] [] [] [] 6

Thanks in advance.

PS. I am trying to achieve this with R

  • 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-25T15:54:53+00:00Added an answer on May 25, 2026 at 3:54 pm

    I think you should use the term “vector” which, in R anyway, has the notion of positions and length which are needed for this problem. (Mathematical sets are unordered, so have no positional interpretation and R does have set operators and functions.)

    # Make up an empty vector:
    vec <- vector("numeric", length=10)
    # create a vector of items to place
     items <- c(1,5,6)
    #Put the first one in the first empty "slot" and the last in the last/
     vec[1] <- items[1]
     vec[length(vec)] <- items[length(items)]
    #Now find a positions for the remaining element(s)
     seq(1,length(vec), by=length(vec)/(length(items)-1))[-c(1,length(items))]
    #[1] 6
    # And place them (or it in this case) ....
      vec[ seq(1,length(vec), by=length(vec)/(length(items)-1))[
                            -c(1,length(items))] ] <- 
                                  items[ -c(1,length(items)) ] 
     vec
    # [1] 1 0 0 0 0 5 0 0 0 6
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can somebody point me to a resource that explains how to go about having
Can somebody point me to a good site/book/article about multithreading with .net? I didn't
Can somebody point me in the right direction for this. I've found lots of
Can somebody point me to a ASP.NET MVC 2 sample with following features (most
I am looking for some reference code implementing a SSMS 2008 plugin. Can somebody
Can somebody point me to a good tutorial or sample project where MVP pattern
Can somebody point me to a good tutorial or sample project where MVP pattern
I'm just wondering if somebody can point me in the right direction for creating
Can somebody suggest a good free tool for analyzing .Net memory dumps other than
Can somebody remember what was the command to create an empty file in MSDOS

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.