withr::local_temp_libpaths()
pak::pkg_install("ggplot2@3.5.2")
#> ℹ Loading metadata database✔ Loading metadata database ... done
#>
#> → Will install 20 packages.
#> → Will download 18 CRAN packages (11.47 MB), cached: 2 (1.51 MB).
#> + cli 3.6.5 [dl] (1.40 MB)
#> + farver 2.1.2 [dl] (1.52 MB)
#> + ggplot2 3.5.2 [bld]library(tidyverse)TLDR: probability functions like pt() can provide log values so that you can avoid numerical problems. (This is why we sum log likelihoods instead of multiplying likelihoods.) So, we can identify the FLOATING-POINT BREAKERS of p-values if we stick to the log scale throughout the pipeline.
library(tidyverse)
# d <- readr::read_tsv("test.tsv") |>
# janitor::clean_names()
#
# d$total <- d$biden + d$trump + d$other
# d$prop_votes_in <- d$ballots_accepted / d$total
# d$prop_biden <- d$biden / d$total
# datapasta::tribble_paste(d)library(ggplot2)
geom_crossrange <- function(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
na.rm = FALSE,print.file_check_log <- function(x, ...) str(x, ...)
as_file_check_log <- function(x) UseMethod("as_file_check_log")
as_file_check_log.default <- function(x) {
structure(list(x = x, notes = list()), class = "file_check_log")
}
apply_to_file_check_log <- function(x, fn, ...) {
results <- fn(x$x, ...)
l <- list(results)# Make a csv to read in
db1 <- DBI::dbConnect(duckdb::duckdb())
f <- tempfile("mtcars", fileext = ".csv")
write.csv(mtcars, f)
library(tidyverse)
# Read in the csv.
# Here two column types are hard-coded using a structSome of the rows have more columns than the first row of column names.
writeLines(
"a\tb\tc\td\te\tf
1\t2\t3\t4\t5\t6\t
1\t2\t3\t4\t5\t6\t7\t
1\t2\t3\t4\t5\t6\t7\t8
1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11
1\t2\t3\t4\t5\t6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ``` r | |
| A <- matrix(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), nrow = 3, ncol = 4) | |
| B <- matrix(c(13, 14, 15, 16, 17, 18, 19, 20), nrow = 4, ncol = 2) | |
| dot_product <- function(x, y) { | |
| mapply(\(x, y) sum(x * y), x, y) | |
| } | |
| rows_of <- function(m) purrr::array_tree(m, 1) | |
| cols_of <- function(m) purrr::array_tree(m, 2) |
Local .Rprofile detected at C:\Users\mahr\Documents\WiscRepos\2021-04-kh-td-intel-and-rate\.Rprofile
library(faux)
#>
#> ************
#> Welcome to faux. For support and examples visit:
#> https://debruine.github.io/faux/
#> - Get and set global package options with: faux_options()
#> ************NewerOlder
