I am an new Rstudio user and I have a strange problem with running datasets: I was able to easily import my dataset, but whenever I try to run it, it just doesn't work. When I start typing the name of the dataset a list opens for me to select it, and after I select and run it, a line with the name of the dataset (in blue) appears in the console, so it looks like something is happening, but the dataset itself doesn't appear and I can't work with it. I've tried datasets such as iris and mtcars, and the exact same thing happens there too. However, strangely enough I am able to run iris3 without any issues.
This is how I ran sample datasets:
mtcars
df <- dplyr::starwars
df
iris3
iris
I've tried updating Rstudtio, uninstalling and re-installing, restarting the program &computer, and still- the only dataset I can successfully run is iris3.
Any ideas on why my Rstudio is being so selective?
Hey, thanks for replying! Yes, I've been entering the data set name in the console and then running it.
After reading your response I tried running the following:
data("iris")
data("mtcars")
head(mtcars)
I got the same result as before- nothing appears for neither of the commands. Once I run the command, a space appears underneath the chunk (where the data set should appear) but it's empty.
By using the word "chunk", you give me the impression you are not entering the commands in the console but in the scripts (might not be the official term) area. The console is at the lower left, unless you have changed the layout, and there is a prompt to the left of every command. The prompt is probably >.
You can use the menu View -> Panes to manipulate the pane layout.
By the way, you can run commands in the script area using CTRL + Enter
Yes, I am entering the commands in the scripts and not the console. Whenever I run a command in the scripts, it pops up in the console too in blue, but does not actually pull up my data set (or any other data set other then iris3 for that matter).
I've also tried running the commands in the console now, using CTRL+ENTER, like you suggested. Unfortunately I had no luck with that either, it's not working..
Sure, here is a screenshot after I tried to run many commands on a few different data sets. Again, the only one that produced some kind of output was when I used iris3
I can see in your screen shot that df, iris, and Suicideonline17_full_1_ are loaded. This is at the upper right in the Environment tab. mtcars is also available as a Promise, which is a fancy way to say that it is available but has not been called for yet.
In the console, at the lower left, you should be able to enter
Thanks, that actually works both in the console and in the script window. Still, whenever I try using Dplyr commands for example (such as select, mutate, etc.), they only work in the console and not in the script. Any idea how I can fix that? The reason I have RStudio and not R is because I find working with the script window a lot more convenient than the console.