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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:32:24+00:00 2026-06-13T05:32:24+00:00

I have a ROC.Value data frame that looks like this: Years 1 2 3

  • 0

I have a ROC.Value data frame that looks like this:

Years   1           2   3       4   5
2002    3.000000    NA  0.22    NA      0
2003    2.988000    NA  0.22    NA      0
2004    2.993976    NA  0.22    NA      0
2005    3.071819    NA  0.22    NA      NA
2006    3.314493    NA  0.22    NA      NA
2007    3.526621    NA  0.22    NA      NA
2008    3.583047    NA  0.22    NA      NA
2009    4.109754    NA  0.22    NA      NA
2010    4.085096    NA  0.22    3.00    NA
2011    3.885096    NA  0.22    2.85    NA
2012    3.685096    NA  0.22    2.70    NA
2013    3.485096    NA  0.22    2.55    NA
2014    3.285096    NA  0.22    2.40    NA
2015    3.085096    NA  0.22    2.25    NA
2016    2.885096    NA  0.22    2.10    NA
2017    2.685096    NA  0.22    1.95    NA
2018    2.485096    NA  0.22    1.80    NA
2019    2.285096    NA  0.22    1.65    NA
2020    2.085096    NA  0.22    1.50    NA
2021    1.885096    NA  0.22    1.50    NA

The NA values will be replaced, when i get the correct data.

When i with the following code try and converting it into long format (so i can make a stacked boxplot):

m.ROC.Value = reshape(ROC.Value, 
                  idvar="Years", 
                  direction="long", 
                  varying=list(colnames(ROC.Value[2:6])),
                  timevar="Characteristic"
                  )

I get this error Error in reshapeLong(data, idvar = idvar, timevar = timevar, varying = varying, : subscript out of bounds.

Any suggesting? Everything I tried didn’t work out (gave a new error).

  • 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-13T05:32:25+00:00Added an answer on June 13, 2026 at 5:32 am

    The function reshape is a base function of R, not of reshape2. If you want to use reshape2, use this command:

    melt(as.data.frame(ROC.Value), measure.vars = 2:6)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a xml data like <Items><Item><name>test1</name></Item><Item><name>test2</name></Item></Items> Looks like jaxb cannot unmashall this when defining
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have a javascript string contains html table like this: <div class=nobrtable><table class=at><TBODY><TR><td> FY
have a php code like this,going to convert it in to C#. function isValid($n){
Have a text box which get data for price. If someone enter something like
have written this little class, which generates a UUID every time an object of
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
Have a SQL problem, adding this model all works correctly, the problem is in

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.