Sha256: 29c5fb12e6f157f1d9b0d55e63e201b5cdf75737823fe25836d6d3b10838eddb

Contents?: true

Size: 556 Bytes

Versions: 136

Compression:

Stored size: 556 Bytes

Contents

space_age <- function(seconds,planet) {
  earth_year <- 31557600 # number of seconds
  conversion <- list(mercury = 0.2408467 * earth_year,
                     venus = 0.61519726 * earth_year,
                     earth = 1 * earth_year,
                     mars = 1.8808158 * earth_year,
                     jupiter = 11.862615 * earth_year,
                     saturn = 29.447498 * earth_year,
                     uranus = 84.016846 * earth_year,
                     neptune = 164.79132 * earth_year)
  round(seconds / conversion[planet][[1]],2)
}

Version data entries

136 entries across 136 versions & 1 rubygems

Version Path
trackler-2.1.0.21 tracks/r/exercises/space-age/example.R
trackler-2.1.0.20 tracks/r/exercises/space-age/example.R
trackler-2.1.0.19 tracks/r/exercises/space-age/example.R
trackler-2.1.0.18 tracks/r/exercises/space-age/example.R
trackler-2.1.0.17 tracks/r/exercises/space-age/example.R
trackler-2.1.0.16 tracks/r/exercises/space-age/example.R
trackler-2.1.0.15 tracks/r/exercises/space-age/example.R
trackler-2.1.0.14 tracks/r/exercises/space-age/example.R
trackler-2.1.0.13 tracks/r/exercises/space-age/example.R
trackler-2.1.0.12 tracks/r/exercises/space-age/example.R
trackler-2.1.0.11 tracks/r/exercises/space-age/example.R
trackler-2.1.0.10 tracks/r/exercises/space-age/example.R
trackler-2.1.0.9 tracks/r/exercises/space-age/example.R
trackler-2.1.0.8 tracks/r/exercises/space-age/example.R
trackler-2.1.0.7 tracks/r/exercises/space-age/example.R
trackler-2.1.0.6 tracks/r/exercises/space-age/example.R
trackler-2.1.0.5 tracks/r/exercises/space-age/example.R
trackler-2.1.0.4 tracks/r/exercises/space-age/example.R
trackler-2.1.0.3 tracks/r/exercises/space-age/example.R
trackler-2.1.0.2 tracks/r/exercises/space-age/example.R