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 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 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 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 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 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 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 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 |
This file contains 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) | |
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") | |
DBI::dbWriteTable(con, "mtcars", mtcars) | |
mtcars2 <- tbl(con, "mtcars") | |
mtcars2 | |
mtcars2 %>% | |
select(cyl) %>% |
This file contains 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
--- introduction.Rmd 2017-04-13 21:34:20.746708500 +0900 | |
+++ dplyr.Rmd 2017-04-13 21:32:54.691292800 +0900 | |
@@ -1,6 +1,5 @@ | |
--- | |
title: "Introduction to dplyr" | |
-date: "`r Sys.Date()`" | |
output: rmarkdown::html_vignette | |
vignette: > | |
%\VignetteIndexEntry{Introduction to dplyr} | |
@@ -13,6 +12,7 @@ |