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.113 tracks/r/exercises/bob/example.R
trackler-2.2.1.111 tracks/r/exercises/bob/example.R
trackler-2.2.1.110 tracks/r/exercises/bob/example.R
trackler-2.2.1.109 tracks/r/exercises/bob/example.R
trackler-2.2.1.108 tracks/r/exercises/bob/example.R
trackler-2.2.1.107 tracks/r/exercises/bob/example.R
trackler-2.2.1.106 tracks/r/exercises/bob/example.R
trackler-2.2.1.105 tracks/r/exercises/bob/example.R
trackler-2.2.1.104 tracks/r/exercises/bob/example.R
trackler-2.2.1.103 tracks/r/exercises/bob/example.R
trackler-2.2.1.102 tracks/r/exercises/bob/example.R
trackler-2.2.1.101 tracks/r/exercises/bob/example.R
trackler-2.2.1.100 tracks/r/exercises/bob/example.R
trackler-2.2.1.99 tracks/r/exercises/bob/example.R
trackler-2.2.1.98 tracks/r/exercises/bob/example.R
trackler-2.2.1.97 tracks/r/exercises/bob/example.R
trackler-2.2.1.96 tracks/r/exercises/bob/example.R
trackler-2.2.1.95 tracks/r/exercises/bob/example.R
trackler-2.2.1.94 tracks/r/exercises/bob/example.R
trackler-2.2.1.93 tracks/r/exercises/bob/example.R