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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:40:16+00:00 2026-05-27T17:40:16+00:00

I have some json data [{a:10, b:123,c:4.5},{a:2,b:5,c:33}] and so on that I read into

  • 0

I have some json data [{a:10, b:123,c:4.5},{a:2,b:5,c:33}] and so on that I read into R via json_data <- fromJSON(paste(json_file, collapse="")) (json_file is the input url). So far so fine.
Now I would like to create vectors from this input which fromJSON has converted into a List of vectors where the vectors have components a,b,c.

Is there a better way than looping over the input list and doing this manually by concatenating the individual vector components on the new target vector(s)?

  • 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-27T17:40:17+00:00Added an answer on May 27, 2026 at 5:40 pm

    If you have a list like this:

    l <- list(c(a=10, b=123, c=4.5),c(a=2,b=5,c=33))
    

    You could just do something like the following:

    df <- data.frame(do.call(rbind, l))
    #    a   b    c
    # 1 10 123  4.5
    # 2  2   5 33.0
    as.list(df)
    # $a
    # [1] 10  2
    # $b
    # [1] 123   5
    # $c
    # [1]  4.5 33.0
    

    (The do.call(rbind, X) construct is handy, allowing you to rbind together the elements of a list of arbitrary length. You can then slice and dice the resulting matrix as you see fit — I just converted it to a data.frame and then to a list to show a couple of possibilities.)

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

Sidebar

Related Questions

I have some JSON data that looks like this: { 910719: { id: 910719,
I have a var that has some JSON data: A = <<{\job\: {\id\: \1\}}>>.
I have some code that requests some JSON from an API. When data is
I have a method to which I want to post some json data, that
I have some JSON data that I get from a server. In my JavaScript,
I have some json formatted data that I parse with JSON.parse. The problem I
I have some problems getting the custom formated JSON data into a dijit.form.FilteringSelect. It
In my project I have a AsyncTask that fetches some JSON data from the
I have some json data existed in a php file that needs to be
I have a c# program that retrieve some JSON data and use Newtonsoft JSON

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.