R Markdown

Trying out the Flow package

I have been meaning to try out the flow package as it appears to help people visualize loops and conditional statements. Here is some code that I made to help someone over in the R4DS Slack channel. The task was to check if the change in temperature was over 0.5, and then to set the next 30 days of data to NA. temp_data <- rnorm(100, 20, 1) #fake data about temperatures N <- length(temp_data) #initialization buffer <- 0 day <- 2 previous_temp <- temp_data[1] # loop while(day <= N){ current_temp <- temp_data[day] if(buffer == 0){ if(!

Continue reading

Trying out blastula

# vignette: https://github.com/rstudio/blastula # Get a nicely formatted date/time string current_date_time <- add_readable_time() image_string <- blastula::add_image("20220402_160706.jpg") newsletter <- blastula::compose_email( body = md( glue::glue( "Good Afternoon, This is a very early draft of a newsletter format that has been created with the R programming language using the `blastula` package. For now, here is a picture from my garden: {image_string} " )), footer = md( glue::glue( "Newsletter compiled on {current_date_time}" ) ) ) #print(newsletter)

Continue reading