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.32 tracks/r/exercises/bob/example.R
trackler-2.2.1.31 tracks/r/exercises/bob/example.R
trackler-2.2.1.30 tracks/r/exercises/bob/example.R
trackler-2.2.1.29 tracks/r/exercises/bob/example.R
trackler-2.2.1.28 tracks/r/exercises/bob/example.R
trackler-2.2.1.27 tracks/r/exercises/bob/example.R
trackler-2.2.1.26 tracks/r/exercises/bob/example.R
trackler-2.2.1.25 tracks/r/exercises/bob/example.R
trackler-2.2.1.24 tracks/r/exercises/bob/example.R
trackler-2.2.1.23 tracks/r/exercises/bob/example.R
trackler-2.2.1.22 tracks/r/exercises/bob/example.R
trackler-2.2.1.21 tracks/r/exercises/bob/example.R
trackler-2.2.1.20 tracks/r/exercises/bob/example.R
trackler-2.2.1.19 tracks/r/exercises/bob/example.R
trackler-2.2.1.18 tracks/r/exercises/bob/example.R
trackler-2.2.1.17 tracks/r/exercises/bob/example.R
trackler-2.2.1.16 tracks/r/exercises/bob/example.R
trackler-2.2.1.15 tracks/r/exercises/bob/example.R
trackler-2.2.1.14 tracks/r/exercises/bob/example.R
trackler-2.2.1.13 tracks/r/exercises/bob/example.R