Please go through section 1.2 of the ModernDive online text called “How do I code in R?”. This should take about 15 minutes.
You may get overwhelmed by all the terminology on that page… don’t worry! You can simply bookmark that page for future reference. But it does cover the coding basics very well!