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.72 tracks/r/exercises/bob/example.R
trackler-2.2.1.71 tracks/r/exercises/bob/example.R
trackler-2.2.1.70 tracks/r/exercises/bob/example.R
trackler-2.2.1.69 tracks/r/exercises/bob/example.R
trackler-2.2.1.68 tracks/r/exercises/bob/example.R
trackler-2.2.1.67 tracks/r/exercises/bob/example.R
trackler-2.2.1.66 tracks/r/exercises/bob/example.R
trackler-2.2.1.65 tracks/r/exercises/bob/example.R
trackler-2.2.1.64 tracks/r/exercises/bob/example.R
trackler-2.2.1.63 tracks/r/exercises/bob/example.R
trackler-2.2.1.62 tracks/r/exercises/bob/example.R
trackler-2.2.1.61 tracks/r/exercises/bob/example.R
trackler-2.2.1.60 tracks/r/exercises/bob/example.R
trackler-2.2.1.59 tracks/r/exercises/bob/example.R
trackler-2.2.1.58 tracks/r/exercises/bob/example.R
trackler-2.2.1.57 tracks/r/exercises/bob/example.R
trackler-2.2.1.56 tracks/r/exercises/bob/example.R
trackler-2.2.1.55 tracks/r/exercises/bob/example.R
trackler-2.2.1.54 tracks/r/exercises/bob/example.R
trackler-2.2.1.53 tracks/r/exercises/bob/example.R