string <- "lower case"
up <- toupper(string)
up
## [1] "LOWER CASE"
string <- "UPPER CASE"
low <- tolower(string)
low
## [1] "upper case"
LatLong <- c("40.841885, -73.856621",
"40.675026, -73.944855",
"40.726253, -73.806710",
"40.725375, -73.789845",
"40.845456, -73.876555")
Location <- c("Bronx", "Brooklyn",
"Manhattan", "Queens", "Staten Island")
geoData <- data.frame(LatLong, Location)
geoData
## LatLong Location
## 1 40.841885, -73.856621 Bronx
## 2 40 …
text = "Apples and oranges are fruits"
sub("p", "b", text) # replace first instance of letter p with b
## [1] "Abples and oranges are fruits"
gsub("p", "b", text) # replace all instances of …
library(tidytext)
library(dplyr)
text <- "Dplyr provides the ability to process and wrangle data, facilitating convenient data transformations through functions like arrange, select and mutate."
data <- data.frame(count = 5, text)
data$text <- as.character(data$text)
tokenize <- data %>% unnest_tokens(word, text …