# NOT RUN {
jones <- new_projects_author("33: Jones")
as.integer(jones) # 33
jones == 33 # TRUE
jones == 10 # FALSE
jones != 33 # FALSE
jones %in% c(20:40) # TRUE
match(jones, c(31:40)) # 3
# }
# NOT RUN {
# Not run because no authors() table is created within this example code.
jones == "jOnES"
# TRUE, assuming that the authors() table contains an author with an id of 3
# and a last_name beginning with "jones" (not case sensitive).
# }
# NOT RUN {
x <- structure("32: Clinton", class = "dummyclass")
class(c(x)) # Does not retain class
class(c(jones)) # Retains class
# }
Run the code above in your browser using DataCamp Workspace