Skip to content

Instantly share code, notes, and snippets.

@KentaroAOKI
Created June 2, 2015 07:19
Show Gist options
  • Save KentaroAOKI/d0c8c8e7d96eeed25410 to your computer and use it in GitHub Desktop.
Save KentaroAOKI/d0c8c8e7d96eeed25410 to your computer and use it in GitHub Desktop.
url encode for azure ml
# Map 1-based optional input ports to variables
dataset <- maml.mapInputPort(1) # class: data.frame
library(RCurl)
id <- dataset[[1]]
text <- dataset[[2]]
text <- curlEscape(text)
text <- gsub("%20", " ", text, ignore.case = TRUE)
data.set <- as.data.frame(cbind(id,text), stringsAsFactors=FALSE)
# Select data.frame to be sent to the output Dataset port
maml.mapOutputPort("data.set");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment