library(dplyr, warn.conflicts = FALSE)
library(ggplot2)
day <- lubridate::as_datetime(Sys.Date())
d <- tibble::tibble(
x = day + lubridate::minutes(0:147 * 30),
y = 0,
day = lubridate::day(x)
)
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
;; add load-paths | |
(add-to-list 'load-path "~/.emacs.d/elisp") | |
(require 'package) | |
;; MELPA | |
(add-to-list | |
'package-archives | |
'("melpa" . "http://melpa.org/packages/") t) |
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
f <- function(return_true = TRUE) { | |
function(return_true = return_true) { | |
if (return_true) return(TRUE) | |
FALSE | |
} | |
} | |
f() | |
#> function(return_true = return_true) { | |
#> if (return_true) return(TRUE) | |
#> FALSE |
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
library(dplyr) | |
#> | |
#> Attaching package: 'dplyr' | |
#> The following objects are masked from 'package:stats': | |
#> | |
#> filter, lag | |
#> The following objects are masked from 'package:base': | |
#> | |
#> intersect, setdiff, setequal, union | |
library(sf) |
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
library(ggjoy) | |
library(dplyr) | |
library(purrr) | |
# data ------------------------------------------------------------ | |
set.seed(10) | |
l <- rerun(26, rnorm(1000, mean = runif(1), sd = sqrt(runif(1)))) | |
names(l) <- LETTERS |
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
library(tidyverse) | |
# parameters --------- | |
steps <- 10000L | |
coil_turns <- 20L | |
rotation <- pi/2 | |
coil_waviness <- 100 | |
wave_height <- 1.5 | |
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
# インストール | |
devtools::install_github("tidyverse/googledrive") | |
# 認証 | |
drive_auth() | |
tmp_doc <- tempfile(fileext = ".doc") | |
# word_documentなRmdをrender() | |
rmarkdown::render("~/Rmd/test.Rmd", output_file = tmp_doc) |
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
library(httr) | |
library(tidyverse) | |
#> Loading tidyverse: ggplot2 | |
#> Loading tidyverse: tibble | |
#> Loading tidyverse: tidyr | |
#> Loading tidyverse: readr | |
#> Loading tidyverse: purrr | |
#> Loading tidyverse: dplyr | |
#> Conflicts with tidy packages ---------------------------------------------- | |
#> filter(): dplyr, stats |
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のコピー修正の例 | |
## 元のデータを上書きしない場合 | |
### `mutate()` | |
``` r | |
library(pryr) | |
library(dplyr, warn.conflicts = FALSE) | |
d <- tibble(x = 1:1000000, y = 1:1000000) |
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
.Rproj.user | |
.Rhistory | |
.RData | |
.Ruserdata |