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.2.1.12 tracks/r/exercises/bob/example.R
trackler-2.2.1.11 tracks/r/exercises/bob/example.R
trackler-2.2.1.10 tracks/r/exercises/bob/example.R
trackler-2.2.1.9 tracks/r/exercises/bob/example.R
trackler-2.2.1.8 tracks/r/exercises/bob/example.R
trackler-2.2.1.7 tracks/r/exercises/bob/example.R
trackler-2.2.1.6 tracks/r/exercises/bob/example.R
trackler-2.2.1.5 tracks/r/exercises/bob/example.R
trackler-2.2.1.4 tracks/r/exercises/bob/example.R
trackler-2.2.1.3 tracks/r/exercises/bob/example.R
trackler-2.2.1.2 tracks/r/exercises/bob/example.R
trackler-2.2.1.1 tracks/r/exercises/bob/example.R
trackler-2.2.1.0 tracks/r/exercises/bob/example.R
trackler-2.2.0.6 tracks/r/exercises/bob/example.R
trackler-2.2.0.5 tracks/r/exercises/bob/example.R
trackler-2.2.0.4 tracks/r/exercises/bob/example.R
trackler-2.2.0.3 tracks/r/exercises/bob/example.R
trackler-2.2.0.2 tracks/r/exercises/bob/example.R
trackler-2.2.0.1 tracks/r/exercises/bob/example.R
trackler-2.2.0.0 tracks/r/exercises/bob/example.R