From 1585d3c37e1f83bf557cf2cf485e5d3a544fdf30 Mon Sep 17 00:00:00 2001 From: rtroise89 <47065420+rtroise89@users.noreply.github.com> Date: Sun, 17 Feb 2019 21:28:11 -0500 Subject: [PATCH 1/3] richard's changes --- 7709Rproblems.Rproj | 2 + fizzbuzz.Rmd | 28 +++++- fizzbuzz.html | 230 ++++++-------------------------------------- 3 files changed, 58 insertions(+), 202 deletions(-) diff --git a/7709Rproblems.Rproj b/7709Rproblems.Rproj index d063e8b..9eef387 100644 --- a/7709Rproblems.Rproj +++ b/7709Rproblems.Rproj @@ -11,3 +11,5 @@ Encoding: UTF-8 RnwWeave: knitr LaTeX: pdfLaTeX + +BuildType: Website diff --git a/fizzbuzz.Rmd b/fizzbuzz.Rmd index d407c6c..3643460 100644 --- a/fizzbuzz.Rmd +++ b/fizzbuzz.Rmd @@ -11,11 +11,31 @@ knitr::opts_chunk$set(echo = TRUE) This document contains student solutions to the fizzbuzz problem. Students will add to this file using the outline below. Write your name (using three hashtags), then below create an R code block and insert your code. Save the .rmd file, then knit the document to update the html output. Then submit a pull request to merge your changes to the main repository. -### Student Name +### Richard Troise -```{r} -#your code here -1+1 +```{r, eval = FALSE} + vec_num <- c(1:100) + + k <- 1 + while(k <= 100) { + if(vec_num[k]%%3==0 || vec_num[k]%%5== 0) { + if(vec_num[k]%%3==0 && vec_num[k]%%5== 0) {print("FizzBuzz")} + if(vec_num[k]%%5 == 0) { + print("Buzz") + k <- k + 1 + } + else { + print("Fizz") + k <- k + 1 + } + } + + else { + print(vec_num[k]) + k <- k + 1 + } + +} ``` ### Matt's Code diff --git a/fizzbuzz.html b/fizzbuzz.html index c30a140..3ceec06 100644 --- a/fizzbuzz.html +++ b/fizzbuzz.html @@ -14,200 +14,15 @@ Fizzbuzz - + - - - - - - - + + + + + + + - - - - - - + + + + + + +