Skip to main content
2 of 4
added 139 characters in body
Sven Hohenstein
  • 2.5k
  • 3
  • 14
  • 26

R, versions 2 and 3, 16 bytes

exists("cite")+2

This command returns 2 for R 2.x.x and 3 for R 3.x.x. The function cite was added in R version 3.0.0. Therefore, the command exists("cite") returns FALSE for R 2.x.x and TRUE for R 3.x.x.

R, all versions (1, 2, and 3), 33 bytes

exists("cite")+exists("eapply")+1

The function eapply was introduced in R 2.0.0.

Sven Hohenstein
  • 2.5k
  • 3
  • 14
  • 26