Skip to content
Prev 360419 / 398503 Next

Num to INT

Using Excel to prepare data can have many pitfalls that are Excel-specific and therefore off-topic here. 

Please provide a sample of your data (in CSV?) in the body of your next email along with the R code you used to import it,  and be sure to send in plain text format because HTML email frequently corrupts R code. 

Note that R data frame columns can be stored with distinct modes (e.g. numeric or integer) but the entire column MUST have the same mode. If you are still thinking like an Excel user this might take some getting used to.

You should also be aware that integers can be stored in floating point numbers just fine, though extremely large integers may not be representable in exact form either way. That is, your troubles may not actually be troubles at all, or there is a small chance that you may be asking the impossible.  That is why you have to show  us what you did and what you wanted to obtain to get effective help. 

The output of the sessionInfo function may also help clarify things here. Reading the Posting Guide mentioned below would probably also help you avoid other communication pitfalls.