Aan de slagGa gratis aan de slag

R version

One of the relatively easy optimizations available is to use an up-to-date version of R. In general, R is very conservative, so upgrading doesn't break existing code. However, a new version will often provide free speed boosts for key functions.

The version command returns a list that contains (among other things) the major and minor version of R currently being used.

Deze oefening maakt deel uit van de cursus

Writing Efficient R Code

Cursus bekijken

Oefeninstructies

  • Print the version details of R using version. (It's not a function.)
  • Use dollar indexing ($) to extract the major component of version and assign it to the variable major.
  • Likewise, extract the minor component and assign it to the variable minor.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Print the R version details using version
___

# Assign the variable major to the major component
major <- ___

# Assign the variable minor to the minor component
minor <- ___
Code bewerken en uitvoeren