Posts

Showing posts from April, 2023

FInal

Image
final rmd 2023-04-24 library (datasets) library (tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr      1.1.1      ✔ readr      2.1.4 ## ✔ forcats    1.0.0      ✔ stringr    1.5.0 ## ✔ ggplot2    3.4.2      ✔ tibble     3.2.1 ## ✔ lubridate 1.9.2      ✔ tidyr      1.3.0 ## ✔ purrr      1.0.1      ## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ── ## ✖ dplyr::filter() masks stats::filter() ## ✖ dplyr::lag()     masks stats::lag() ## ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors library (plotly) ## ## Attaching package: 'plotly' ## ## The following object is masked from 'package:ggplot...

wk13

Image
  wk13.R assas 2023-04-09 library (animation) # Create a function to plot a bouncing ball bounce_ball <- function () {   for (i in 1 : 50 ) {     plot.new ()     plot.window ( xlim = c ( 0 , 100 ), ylim = c ( 0 , 100 ))     x <- 50     y <- abs ( 100 * sin (i * pi / 10 ))     symbols (x, y, circles = 5 , inches = FALSE , add = TRUE )     Sys.sleep ( 0.1 )   } } # Create the animation ani.record ( reset = TRUE )   bounce_ball ()              ani.replay ()               saveGIF ({   bounce_ball () }, interval = 0.1 , movie.name = "bouncing_ball.gif" ) ## Output at: bouncing_ball.gif ## [1] TRUE This R code generates a basic animation that shows a blue dot moving horizontally from left to right. Th...