Column of data is imported incorrectly

Hello All,

I have a question regarding how / why a column of data is imported in the incorrect format.

Below I have an example of how the column of data (ID) is imported into R.


What I need is for the column show the full character amount of 17 characters instead of 2.10042E+17.

All the help is greatly appreciated and below you will find a small DF to use in potentially helping me with this endeavor.

names <- c("Alice", "Bob", "Carol")
ages <- c(18,21,19)
ID <- c("7324406373", "2.10042E+17", "3.00001E+13")
df <- data.frame(names, ages, ID)

Thank you!

If this column is just used as the text for an ID, it is probably best to import the number as characters. How are you importing the data? In the read.csv() function, for example, you can use the colClasses argument to set a column to be character.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.