Skip to content

Instantly share code, notes, and snippets.

@Robinlovelace
Created May 11, 2015 15:55
Show Gist options
  • Save Robinlovelace/56a32cdd7718db1ae48d to your computer and use it in GitHub Desktop.
Save Robinlovelace/56a32cdd7718db1ae48d to your computer and use it in GitHub Desktop.
Create an object to be assigned to the class 'bike' in R
# Create a class for bicycle data
wheelsize <- 559 # 26" wheel size, definited by 'bead seat diameter' (BSD)
size <- 21 * 25.4 # top tube length, inches converted to mm
top_tube_length <- 530 # top tobe length
x <- list(ws = wheelsize, s = size, ttl = top_tube_length)
class(x) <- "bike"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment