read.csv() not case sensitive??

I am running into some peculiarities with using read.csv and I am pretty sure it has something to do with a setting on my computer, I just cannot figure out where/how.

Context: I am currently teaching an intro R class. Here I am, telling my students R is case-sensitive, also for file names. I try to show them an example and sure enough, (on my computer, R 4.0.3) read.csv actually works when I write the file name with different cases!!! What...?

When I go to RStudio Cloud (which is what my students are using), I get the expected behavior - case-sensitivity.

So I am concluding it must be some setting on my computer. I've tested a number of files, in a number of Rprojects, and read.csv is case-insensitive in all cases.
I've gone through my Global Options, checked my .Rprofile (empty) and .Renviron (only holds API keys) - can't find anything at first sight that would cause this behavior. Googling has not given me any results either.

What am I missing?

For file names, I think it depends on the operating system. RStudio cloud runs on Linux. Is your computer a Windows computer? It's safer to use the correct case but Windows lets you be sloppy.

1 Like

Thanks! But I have a Mac...

I'm not a Mac user but it seems Mac file systems are case insensitive based on a quick Google search.

1 Like

And I believe this is the link to documentation for this behaviour:

(See the section: Case-insensitive file systems)


This topic was automatically closed 7 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.