In this capstone we will be applying data science in the area of natural language processing. We’ll describe the major features of the training data with our exploratory data analysis and present how to create the predictive model.
## Download libraries
## Step 1: Download the dataset and unzip folder
## Check if directory already exists?
capstonedatasetlink <- "https://d396qusza40orc.cloudfront.net/dsscapstone/dataset/Coursera-SwiftKey.zip"
projectfolderpath <- "./projectData"
zipname <- "SwiftKey.zip"
zippath <- paste0(projectfolderpath, "/", zipname)
datasetfolder <- "final"
if(!file.exists(projectfolderpath)){
dir.create(projectfolderpath)
}
## Check if zip has already been downloaded in projectData directory?
if(!file.exists(zippath)){
download.file(capstonedatasetlink,destfile=zippath,mode = "wb")
}
## Check if zip has already been unzipped?
if(!file.exists(datasetfolder)){
unzip(zipfile=zippath,exdir=projectfolderpath)
}
This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Cmd+Shift+Enter.
plot(cars)
Add a new chunk by clicking the Insert Chunk button on the toolbar or by pressing Cmd+Option+I.
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Cmd+Shift+K to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.