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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:31:38+00:00 2026-06-09T00:31:38+00:00

On loading a yaml file with values such as 25.0, the .0 is ignored

  • 0

On loading a yaml file with values such as 25.0, the .0 is ignored and what I get is 25. Is it possible to force yaml to consider the value as it is without manipulating the data? I have tried enclosing the values in single/double quotes, but that does not work.

[Edit]: I am using the yaml parser package for R programming language. The data type returned is double. If I set the value to 25.2, I get back the same value. How can I force YAML/R to read the the information in YAML as it is.

  • 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-09T00:31:39+00:00Added an answer on June 9, 2026 at 12:31 am

    Your problem is that the parser recognises that these are floating point numbers and in R there is no difference between 25.0 and 25. Try this for example:

    identical(25.0, 25)

    25.0 and 25 are just two different representations of the same floating point number. If you want to retain the form in which the data is supplied you will have to read them in as strings (which you can later convert to numeric if you need to perform calculations). You can do this with a handler:

    yaml.load("25.0", handlers=list("float#fix"=function(x) as.character(x)))

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

Sidebar

Related Questions

Loading process image file different between VS 2005 and VS 2010 We have a
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
I am loading a YAML file in Rails 3.0.9 like this: APP_CONFIG = YAML.load(File.read(File.expand_path('../app.yml',
How can I specify a directory for dumping/loading my db to yaml? rake db:data:dump_dir
C# - Loading image from file resource in different assembly I have a PNG
On loading the page I want to pass a value to my javascript function
while loading getfptex(got it from CTAN) batch file ,when i'm extracting this batch file
When loading data into Core Data, my child objects aren't getting the parent ID
I´m loading data from MySQL DB into Java application. How to define column type?
When loading a page, I have the following in my controller: request.setAttribute(myAtt, Testing); I

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.