vcovCL <- function(fm, cluster) {
M <- length(unique(cluster))
u <- apply(estfun(fm), 2, function(x) tapply(x, cluster, sum, na.rm = TRUE))
M/(M-1) * sandwich(fm, meat = crossprod(u)/nobs(fm))
}
vcovCL2 <- function(fm, cluster1, cluster2 = NULL) {
vc1 <- vcovCL(fm, cluster1)
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(DBI) | |
library(dplyr, warn.conflicts = FALSE) | |
pg <- dbConnect(RPostgres::Postgres(), dbname="crsp") | |
roles <- tbl(pg, sql("SELECT r.rolname, r.rolsuper, r.rolinherit, | |
r.rolcreaterole, r.rolcreatedb, r.rolcanlogin, | |
r.rolconnlimit, r.rolvaliduntil, | |
ARRAY(SELECT b.rolname | |
FROM pg_catalog.pg_auth_members m |
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(googlesheets4) | |
library(dplyr, warn.conflicts = FALSE) | |
df <- read_sheet("1q4Pd6J4olH1qKfN1e0Hl7Oq_Zps8vD3WyXJ3Pw2D-OU") | |
roster <- | |
df %>% | |
inner_join(df, by = "Gymnast") %>% | |
filter(Order.y > Order.x) %>% | |
mutate(diff = Order.y - Order.x) %>% |
library(dplyr, warn.conflicts = FALSE)
library(DBI)
pg <- dbConnect(RPostgres::Postgres(), bigint = "integer", sslmode='require')
url <- "https://github.com/tidyverse/dbplyr/files/6239289/temp.RDS.zip"
t <- tempfile(fileext = ".zip")
download.file(url, t)
temp <- readRDS(unzip(t))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
library(dbplyr)
library(dplyr, warn.conflicts = FALSE)
library(DBI)
pg <- dbConnect(RPostgres::Postgres(),
bigint = "integer",
check_interrupts = TRUE)
ccmxpf_lnkhist <- tbl(pg, sql("SELECT * FROM crsp.ccmxpf_lnkhist"))
stocknames <- tbl(pg, sql("SELECT * FROM crsp.stocknames"))
library(dplyr, warn.conflicts = FALSE)
library(DBI)
pg <- dbConnect(RPostgres::Postgres())
ccmxpf_lnkhist <- tbl(pg, sql("SELECT * FROM crsp.ccmxpf_lnkhist"))
ccmxpf_lnkused <- tbl(pg, sql("SELECT * FROM crsp.ccmxpf_lnkused"))
ccmxpf_linktable <- tbl(pg, sql("SELECT * FROM crsp.ccmxpf_linktable"))
apermnos <-
ccmxpf_lnkhist %>%
library(dplyr, warn.conflicts = FALSE)
library(dbplyr)
#>
#> Attaching package: 'dbplyr'
#> The following objects are masked from 'package:dplyr':
#>
#> ident, sql
library(DBI)
library(ggplot2)
library(dplyr, warn.conflicts = FALSE)
library(DBI)
library(parallel)
pg <- dbConnect(RPostgres::Postgres(), bigint = "integer")
table1 <- tbl(pg, sql("SELECT * FROM tfn.table1"))
stocknames <- tbl(pg, sql("SELECT * FROM crsp.stocknames"))
We can't make this file beautiful and searchable because it's too large.
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
year,tag,number,year_total | |
2008,.htaccess,54,58390 | |
2008,.net,5910,58390 | |
2008,.net-2.0,289,58390 | |
2008,.net-3.5,319,58390 | |
2008,.net-4.0,6,58390 | |
2008,.net-assembly,3,58390 | |
2008,.net-core,1,58390 | |
2008,2d,42,58390 | |
2008,32-bit,19,58390 |