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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:08:37+00:00 2026-06-06T06:08:37+00:00

We are trying to put 730 zero values in front of an 365 X

  • 0

We are trying to put 730 zero values in front of an 365 X 1 vector with values.
I cut out this vector from another matrix. Thus, the row index numbers are now no more helpful and confusing e.g. the vector with the values starts with 50.
If I create another vector or array with the zero values and then use rbind to bind it before the vector with the values it will produce strange values due to mixed up row index numbers and handle it as a 3d element.

Thanks for any ideas how to achieve that or how to reset the row index numbers.
best Fabian!

Example:
This is my vector with values

 pred_mean_temp
 366     -3.0538333
 367     -2.8492875
 368     -3.1645825
 369     -3.5301074
 370     -1.2463058
 371     -1.7036682
 372     -2.0127239
 373     -2.9040319
 ....

I want to add a zero vector with 730 rows in front of it.
So it should look like this:

 1        0
 2        0
  ....
 731     -3.0538333   
 732     -2.8492875
 733     -3.1645825
  .... 
  • 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-06T06:08:40+00:00Added an answer on June 6, 2026 at 6:08 am

    Something like this?

    # create a vector
    a <- rnorm(730)
    # add the 0
    a <- c(rep(0,730), a)
    

    Then you could make a matrix:

    m <- cbind(1:length(a), a)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to put data from this JSON object (from Google Books API) into
I'm trying to put together this layout... ... but I'm having issues with the
I'm trying to put the diff script into my website, from Paul Butler's website
I am trying to put a cool little image like this For my split
I am trying to put a table between rows of another table . But
I'm trying to put in place a basic streaming system from the browser. The
Trying to put my head around how to model the notion of default values
I am trying to put some distributed caching into play, I'm using this indeXus.Net
I am trying to put an opacity button onto an image. This is my
I'm trying to put data into from : [comments] => Array ( [count] =>

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.