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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:53:32+00:00 2026-05-23T06:53:32+00:00

I am trying to make yaml format file from R. I know there is

  • 0

I am trying to make yaml format file from R. I know there is a package for such a job, but its example is so simple and my object is a bit more tricky !!

so I would like to make something like the following but I don’t know how should I shape it as R object (dataframe?!):

tree:
  format: newick
  translate: ./My_example-1.translation
  file: ./Xtol_example-1.tree
tracks:
  - class: colorstrip
    source: ./My_example-1.catdomain

    rel_height: 0.6
    title: Catalytic domain
  - class: colorstrip
    source: ./My_example-1.kingdom
    rel_height: 0.6
    title: Itsname
  - class: colorstrip
    source: ./My_example-1.temp
  • 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-23T06:53:32+00:00Added an answer on May 23, 2026 at 6:53 am

    My short advice – don’t use yaml with R.

    (Editor’s note: It appears that the problems documented here have since been fixed–see the comments.)

    Issue 1

    The yaml package in R seems to be unusable but the real issue seems to be with R. But then again, I hadn’t bothered with yaml till I saw this question, so may be there are gaps in my understanding of the whole issue.

    To successfully create the yaml in question, at some point, we’ll have to have a vector of lists which is not a list (for tracks). I think there is no way to do that in R. As soon as we add elements to a vector which are lists, the vector turns into a list. I guess a vector can only take elements of a fixed size (hence simplified operations, hence good performance and hence the abundance of advice to vectorize).

    For simple atomic types like numeric, integer etc, I suppose the R interpreter already knows about their size (which is fixed). But if the element is a list, then that luxury is lost, and the vector is converted into a list so that it may deal with the varying sizes of the elements (lists).

    Hence, there can not be a vector of lists which is not a list, and we have serious problems transforming data to and from yaml in R.

    Issue 2

    The R yaml package is poorly documented, and I can’t figure out how does it solve the issue. I guessed that it might have used a convention to get around it. So what I tried to do was this (and this approach would also have solved your problem) – import the yaml as an R object and then try to convert that R object into yaml.

    library("yaml")
    z <- yaml.load(
    "tree:
      format: newick
      translate: ./My_example-1.translation
      file: ./Xtol_example-1.tree
    tracks:
      - class: colorstrip
        source: ./My_example-1.catdomain
    
        rel_height: 0.6
        title: Catalytic domain
      - class: colorstrip
        source: ./My_example-1.kingdom
        rel_height: 0.6
        title: Itsname
      - class: colorstrip
        source: ./My_example-1.temp")
    names(z)
    names(z$tracks)
    y <- as.yaml(z)
    

    as you would see, it doesn’t work. I think you can save yourself a lot of pain by not trying to use yaml with R. You could consider using XML or something like that.

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

Sidebar

Related Questions

im trying make one replace in string from a array but this dont work
I am trying to load data from a YAML file where some fields contain
I'm trying make some stuff in jQuery using ASP.NET. But the ID from runat=server
Trying to make a generic PL/SQL procedure to export data in specific XML format,
I'm trying make my first python app. I want make simple email sender form.
Trying to make a simple toggle menu, and I can't seem to hide/show the
Trying to make this simple applet - the first part just creates a simple
I am trying to make a simple application using Google App Engine. Below is
I am trying make such application which speak automatically when the image loaded it
I'm trying make a simple control, with a some path in it. And binding

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.