How to write this function gdp$current GDP?

Hello dear peers,
I am learning this amazing app R and I am greatful for help i already received.
Currently I am working with data frame and my variables are written like this:
country
year
current GDP
When I write this function – gdp$country–, it works. But when I write this one --gdp$current GDP-- it doen’t work.
Where is the mistake please.
Thank youin advance for your help

Abdel Aziz Yasser

Hi Abdel,

This happens because you have a space in current GDP, so you need to use `` around it gdb$current GDP. See Practical Advice under Data Import in R for Data Science for more examples.

In future, these forums are meant for questions related to rOpenSci packages and so are not the best place for general R questions like this one. I would recommend joining the Data Science Learning Community and asking your questions there. They have kind mentors and a wonderful community and it’s a great place to learn, especially when you’re just getting started!

Good luck!
Steffi

1 Like