This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.
#Order of operations (5 * 4) * (4 * 5) - 56
23 - 1 * (8 - 12)
56/8 * (3 + 4)
45-5 * 8 + (8 + 9)
#Create vector
a<-c(2,5,6,7) b<-c(1,0,9,8) c<-c(6,5,8,3)
row1 <- c(2,5,6,7) row2 <- c(1,0,9,8) row3 <- c(6,5,8,3) matrix_3x4 <- rbind(row1, row2, row3) print(matrix_3x4)
colnames (matrix_3x4) <-c (“Mon”,“Tue”,“Wed”,“Thu”) print(matrix_3x4)
rownames(matrix_3x4) <- c(“Present”, “Absent”, “On leave”) print(matrix_3x4)
row_sums <- rowSums(matrix_3x4) print(row_sums)
col_sums <- colSums(matrix_3x4) print(col_sums)