Created
June 2, 2015 07:19
-
-
Save KentaroAOKI/d0c8c8e7d96eeed25410 to your computer and use it in GitHub Desktop.
url encode for azure ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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