RStudio not showing output in Console when using a variable?

416 views Asked by At

Currently learning RStudio but for some reason my Console isn't outputting my code? Not sure if there was a setting I may have toggled but it seems to only affect me when I have a variable in my code?

For example: when working the ToothGrowth dataset

data("ToothGrowth")
View(ToothGrowth)

This executes and I can view the table of the data in a separate tab.

However, when I try to filter it

data("ToothGrowth")
View(ToothGrowth)

filtered_tg = filter(ToothGrowth, dose=0.5)
View(filtered_tg)

Nothing Returns, a formatted table doesn't open and an empty line is returned in the console window.

This is just one example, even when i try something as simple as

number = 10
number

I would expect, in return;

[1] 10

But console is empty.

Looking for solutions online, I've seen maybe i didn't close a bracket or parenthesis and to include CloseAllConnections() if there was a '+' showing in the console (which there isn't).

Working on rstudio cloud so is there a reset somewhere that I could possibly try?

Thanks for any and all help!

1

There are 1 answers

0
Tirendaz Academy On

I changed the function as follows:

filtered_tg = filter(ToothGrowth, dose=="0.5")
View(filtered_tg)

After running these commands it was viewed as the table of the data in a separate tab

Output