Re:Why do we use R rather than Excel?
by temp8964 on Sunday July 11, 2021 @09:57AM
(#27800834)
Actually when you use R functions to import CSV files, they also guess data types and make some conversions by default. The difference is that in R you can turn them off if you want to. But in Excel there are automatic changes you can't turn off.
[ Parent
| on HN ]
You can set the data type to "text" when importing CSVs, that turns most things off.
If you try reading an Excel file via SSIS you are out of luck. You can't turn of the auto guessing feature.
Most, but not all. That is the entire point: Excel is never safe in any configuration.
Not sure about that. It is my understanding that Excel only tries to guess the type of an input if it has not been explicitly specified by the user.
The problem with "things that look like dates being interpreted as dates" comes from not specifying that a column has type "text".
Even if you do specify a column as a text excel WILL assume that it contains dates sometimes.
Happened to me multiple times, even when i set each cell as a text.
Seems like copypasting a tab separated values resets the cells to their default state.
Re:Why do we use R rather than Excel?
by crazygringo on Sunday July 11, 2021 @10:23AM
(#27801061)
If "not all", can you provide an example of what gets converted if you specify text?
Just want to know to avoid future gotchas.
I'm not sure, have to try it out but text fields can be delineated by starting with a single quote ('), that might be a special case. It might not be though, I don't have Excel open to check. Pretty much everything is left alone if you specify "text" at the import stage though. (This is using the text import wizard, or text-to-columns)