## R Programming Arithmetic %/% Operator

```v <- c( 2,5.5,6)
t <- c(8, 3, 4)
print(v%/%t)```

## R Programming Arithmetic %% Operator

```v <- c( 2,5.5,6)
t <- c(8, 3, 4)
print(v%%t)```

## R Programming Arithmetic Divide Operator

```v <- c( 2,5.5,6)
t <- c(8, 3, 4)
print(v/t)```

## R Programming Arithmetic Divide Operator

```v <- c( 2,5.5,6)
t <- c(8, 3, 4)
print(v/t)```

## R Programming Group Bar Chart and Stacked Bar Chart

```# Create the input vectors.
colors = c("green","orange","brown")
months <- c("Mar","Apr","May","Jun","Jul")
regions <- c("East","West","North")

# Create the matrix of the values.
Values <- matrix(c(2,9,3,11,9,4,8,7,3,12,5,2,8,10,11), nrow = 3, ncol = 5, byrow = TRUE)

# Give the chart file a name
png(file = "barchart_stacked.png")

# Create the bar chart
barplot(Values, main = "total revenue", names.arg = months, xlab = "month", ylab = "revenue", col = colours)

# Add the legend to the chart
legend("topleft", regions, cex = 1.3, fill = colours)

# Save the file
dev.off()```

## R Programming Bar Chart Labels, Title and Colors

```# Create the data for the chart
H <- c(7,12,28,3,41)
M <- c("Mar","Apr","May","Jun","Jul")

# Give the chart file a name
png(file = "barchart_months_revenue.png")

# Plot the bar chart
barplot(H,names.arg=M,xlab="Month",ylab="Revenue",col="blue",
main="Revenue chart",border="red")

# Save the file
dev.off()```

## R Bar Charts

```# Create the data for the chart
H <- c(7,12,28,3,41)

# Give the chart file a name
png(file = "barchart.png")

# Plot the bar chart
barplot(H)

# Save the file
dev.off()```

## R Random Forest Example

```# Load the party package. It will automatically load other required packages.
library(party)
library(randomForest)

# Create the forest.
output.forest <- randomForest(nativeSpeaker ~ age + shoeSize + score,

# View the forest results.
print(output.forest)

# Importance of each predictor.
print(importance(fit,type = 2))```

## R Random Forest Input Data

```# Load the party package. It will automatically load other required packages.
library(party)

# Print some records from data set readingSkills.

## R Decision Tree Example

```# Load the party package. It will automatically load other
# dependent packages.
library(party)

# Create the input data frame.

# Give the chart file a name.
png(file = "decision_tree.png")

# Create the tree.
output.tree <- ctree(
nativeSpeaker ~ age + shoeSize + score,
data = input.dat)

# Plot the tree.
plot(output.tree)

# Save the file.
dev.off()```