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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:25:58+00:00 2026-06-07T12:25:58+00:00

I am importing a csv that has a single column which contains very long

  • 0

I am importing a csv that has a single column which contains very long integers (for example: 2121020101132507598)

a<-read.csv(‘temp.csv’,as.is=T)

When I import these integers as strings they come through correctly, but when imported as integers the last few digits are changed. I have no idea what is going on…

1 “4031320121153001444” 4031320121153001472
2 “4113020071082679601” 4113020071082679808
3 “4073020091116779570” 4073020091116779520
4 “2081720101128577687” 2081720101128577792
5 “4041720081087539887” 4041720081087539712
6 “4011120071074301496” 4011120071074301440
7 “4021520051054304372” 4021520051054304256
8 “4082520061068996911” 4082520061068997120
9 “4082620101129165548” 4082620101129165312

  • 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-07T12:26:01+00:00Added an answer on June 7, 2026 at 12:26 pm

    As others have noted, you can’t represent integers that large. But R isn’t reading those values into integers, it’s reading them into double precision numerics.

    Double precision can only represent numbers to ~16 places accurately, which is why you see your numbers rounded after 16 places. See the gmp, Rmpfr, and int64 packages for potential solutions. Though I don’t see a function to read from a file in any of them, maybe you could cook something up by looking at their sources.

    UPDATE:
    Here’s how you can get your file into an int64 object:

    # This assumes your numbers are the only column in the file
    # Read them in however, just ensure they're read in as character
    a <- scan("temp.csv", what="")
    ia <- as.int64(a)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently importing a CSV file which has a column that is all
I'm importing data from a CSV that contains approx 350 columns. This CSV import
I'm trying to read into R a csv file that contains information on political
I have a CSV file that has 2999 rows but on importing it to
I am importing a csv file which has a lot of invoice data. This
I'm importing a csv file that consists of a crosstab with column names in
I am importing data from csv file, sometimes there are column headers and some
I have a 4-column CSV file. I want to sort the lines, such that,
So I have my CSV file that I am importing to create new AD
I have a data.frame in R which has been constructed off the Example 1-3

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.