This set of exercises will help you to help you improve your skills with character functions in R. Most of the exercises are related with text mining, a statistical technique that analyses text using statistics. If you find them interesting I would suggest checking the library tm, this includes functions designed for this task. There […]

## Character Functions Advanced (Solutions)

Below are the solutions to these exercises on character functions. #Run before the first exercise if (!’tm’ %in% installed.packages()) install.packages(‘tm’) library(tm) txt <- system.file(“texts”, “txt”, package = “tm”) ovid <- VCorpus(DirSource(txt, encoding = “UTF-8”), readerControl = list(language = “lat”)) TEXT <- lapply(ovid[1:5], as.character) TEXT1 <- TEXT[[4]] OVID <- c(data.frame(text=unlist(TEXT), stringsAsFactors = F))$text #################### # # […]

## Protected: Character Functions (Intermediate)

There is no excerpt because this is a protected post.

## Character Functions (Intermediate) Solutions

Below are the solutions to these exercises on character functions. #################### # # # Exercise 1 # # # #################### cat(‘Hello world!\nI\’m ready to start.’) ## Hello world! ## I’m ready to start. #################### # # # Exercise 2 # # # #################### states <- rownames(USArrests) (States <- tolower(states)) ## [1] “alabama” “alaska” “arizona” “arkansas” […]

## Protected: Character Functions

There is no excerpt because this is a protected post.

## Protected: Character Functions – solutions

There is no excerpt because this is a protected post.

## Basic Operations Exercises

This set of exercises will help you to learn and test your skill with basic arithmetical operations and logic functions. Before proceeding, it might be helpful to look over the help pages for the **, %/%, %%, and the logical operators such as !=, ==, >=, isTRUE . Answers to the exercises are available here. […]

## Basic Operations Solutions

Below are the solutions to these exercises on Basic operation. #################### # # # Exercise 1 # # # #################### S <- 100 i1 <- 0.1 i2 <- 0.09 n <- 2 simple <- S*(1 + i1*n) compound <- S*(1 + i2)**n #################### # # # Exercise 2 # # # #################### simple>compound ## [1] […]

## Advanced Base Graphics Exercises

Being able to visualize information through plots is essential for a statistic analysis. A simple and clean graph can explain much more than words. In this set of exercises you will test and learn advanced graphic arguments. Before you start check the documentation for the following functions: plot, points, abline, title, legend ,par (including all the arguments), mfrow and layout For […]

## Advanced Base Graphics Solutions

Below are the solutions to these exercises on Advanced base graphics. #################### # # # Exercise 1 # # # #################### data(cars) plot(cars) plot(cars, lab=c(20,10,6)) #################### # # # Exercise 2 # # # #################### plot(cars, lab=c(20,10,6), cex.axis=.6) #################### # # # Exercise 3 # # # #################### plot(cars, lab=c(20,10,6), cex.axis=.6, las=1) points(x=c(230,26), y=c(60,61), col=”red”) […]