Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@petermreid
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petermreid/3183e16d56555cc38f53 to your computer and use it in GitHub Desktop.
Save petermreid/3183e16d56555cc38f53 to your computer and use it in GitHub Desktop.
Titanic Age Group
# Map 1-based optional input ports to variables
dataset1 <- maml.mapInputPort(1) # class: data.frame
# Sample operation
dataset1$AgeGroup <- ifelse(dataset1$Age < 16, "Young", ifelse(dataset1$Age > 60, "Old", "Middle"))
# Select data.frame to be sent to the output Dataset port
maml.mapOutputPort("dataset1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment