Sha256: a6a17c98948d5dbed25b67821cc606cc403c8f8dd034a7d96f15025076bcd380

Contents?: true

Size: 414 Bytes

Versions: 153

Compression:

Stored size: 414 Bytes

Contents

bob <- function(input) {
  # function bob takes a character input and responds
  # with a couple different sentences

  # strip white space
  input <- gsub("[[:space:]]", "", input)

  if (input == "") {
    return("Fine. Be that way!")
  }
  if (toupper(input) == input && tolower(input) != input) {
    return("Whoa, chill out!")
  }
  if (endsWith(input, "?")) {
    return("Sure.")
  }
  return("Whatever.")
}

Version data entries

153 entries across 153 versions & 1 rubygems

Version Path
trackler-2.1.0.34 tracks/r/exercises/bob/example.R
trackler-2.1.0.33 tracks/r/exercises/bob/example.R
trackler-2.1.0.32 tracks/r/exercises/bob/example.R
trackler-2.1.0.31 tracks/r/exercises/bob/example.R
trackler-2.1.0.30 tracks/r/exercises/bob/example.R
trackler-2.1.0.29 tracks/r/exercises/bob/example.R
trackler-2.1.0.28 tracks/r/exercises/bob/example.R
trackler-2.1.0.27 tracks/r/exercises/bob/example.R
trackler-2.1.0.26 tracks/r/exercises/bob/example.R
trackler-2.1.0.25 tracks/r/exercises/bob/example.R
trackler-2.1.0.24 tracks/r/exercises/bob/example.R
trackler-2.1.0.23 tracks/r/exercises/bob/example.R
trackler-2.1.0.22 tracks/r/exercises/bob/example.R