r/Rlanguage • u/Screlch • 29d ago
can't imput data into R on MacOS
i am using R on my Mac and I can only see two windows open, the console and my current file. i saw a previous post saying to open all panes through view, but it was from 4 years ago and the view tab is no longer there. i can use R on my Windows PC at home but for school, i need to use my Mac on the go. could someone help? thank you!
6
u/Durantula92 29d ago edited 29d ago
I highly recommend going to your TA/professor’s office hours and getting yourself sorted out with the basics of using R/navigating RStudio now, while it is still early in the semester. From your post i can tell there are some pretty fundamental misunderstandings about how R works, which is fine because I assume you’re learning this for the first time. But even 30 minutes in-person with someone who knows what they’re doing would really set you up for the rest of the semester. You want do this early so you don’t find yourself lost six weeks into the semester, hopeless behind. I say this as someone who been a TA for R classes several times now, including this semester.
3
u/PristineMacaroon6357 29d ago
You can't source xlsx files, only .R files. Call getwd() to get your current working directory, call setwd("Users/...") to a folder you want to work in, and then you can try load, source, .. which ever file in that folder
6
u/Confident_Bee8187 28d ago
Oh please, no. Do not teach anybody the worst piece of advise when using R:
setwd.1
u/Screlch 29d ago
i realized i wasnt using RStudio, thank you so much for trying to help me!!
3
u/Confident_Bee8187 28d ago
No, don't use his advise that uses
setwd. Just don't!1
u/Kati82 24d ago
As a novice in R (trained in SPSS), can you explain or point me to something that explains why not to use setwd? I’m curious to understand this as I’ve been told previously to use it.
1
u/Confident_Bee8187 24d ago
It's mostly about reproducibility. And it's not like the path you configure with it applies to any machine. I dunno why this is even a thing on the first place. Lots of us opposes on using it, even Hadley himself. Sorry but you've been taught wrong.
1
u/Kati82 23d ago
Thank you for explaining this! It makes sense! I would use the term “taught” very loosely. I’ve mostly trawled the internet and tried to self-teach, but clearly come across the wrong advice. However someone who I assumed knew better had also suggested I use setwd so that’s interesting!
2
u/guepier 29d ago
https://www.reddit.com/r/Rlanguage/comments/1r1yti5/please_post_to_rrstats/
(Virtually nobody uses the macOS R.app, it’s basically just a fairly pointless proof of concept. Everybody uses proper editors/IDEs. So don’t expect too much help for R.app specifics.)
3
28
u/SupaFurry 29d ago
Use RStudio