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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:52:55+00:00 2026-05-23T12:52:55+00:00

Hello I am analyzing some data and trying to use a package that contains

  • 0

Hello I am analyzing some data and trying to use a package that contains a object that has to be formatted in such a way. I have never seen this type of format and I am not sure how to generate it. When I call the object in R this is the strange object:

> a
     A      B          C            D         E          F 
0.00000000 1.34529412 0.31571429 1.26327103 0.32615385 1.12585586 

Here are some attributes of this object a:

> str(a)
 Named num [1:6] 0 1.345 0.316 1.263 0.326 ...
 - attr(*, "names")= chr [1:6] "" "A" "B" "C" ...

> class(a)
[1] "numeric"

I can write “a” to a .csv format with the standard write.csv command, and it formats it nicely with two columns, one column with the characters, and the other with the numbers. When I try to read it back in R using read.csv it returns it correctly as a data frame with two columns. However, the function that I am trying to use doesn’t like the data frame format and prefers whatever format “a” is in.

So it is possible to take an example data set such as:

> L <- c("A","B","C","D","E","F")
> R <- c(0.00000000,1.34529412,0.31571429,1.26327103,0.32615385,1.12585586 )
> T <- list(L=L,R=R)
> Example <- as.data.frame(T)
> Example
  L     R
1 A 0.00000000
2 B 1.34529412
3 C 0.31571429
4 D 1.26327103
5 E 0.32615385
6 F 1.12585586 

And turn it back into this?

     A      B          C            D         E          F 
0.00000000 1.34529412 0.31571429 1.26327103 0.32615385 1.12585586 

With these attributes?

  > str(a)
     Named num [1:6] 0 1.345 0.316 1.263 0.326 ...
     - attr(*, "names")= chr [1:6] "" "A" "B" "C" ...

    > class(a)
    [1] "numeric"

Thank you for the help!

  • 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-23T12:52:56+00:00Added an answer on May 23, 2026 at 12:52 pm

    I think this is the sort of thing you’re looking for:

    newExample <- Example$R
    names(newExample) <- Example$L
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello there i'm trying to create a form with Zend_Form that will enable my
Hello i am having some problems generating random numbers with C# Now i have
I have a recursive method that reversed a string (HW assignment, has to be
Hello is there a way to use svn command line from eclipse? Within eclipse
hello i have a desktop application that communicate with a wcf service that i
hello all i have one json object like {event1:{title:My birthday,start:12\/27\/2011 10:20 ,end:12\/27\/2011 00:00 },event2:{title:My
Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello can anybody solve this please I'm creating the object in the action class
Hello I am working with a simulator that uses rcS scripts to boot, this

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.