Skip to content

Instantly share code, notes, and snippets.

View abresler's full-sized avatar

Alex Bresler abresler

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 16 columns, instead of 2. in line 6.
isUncompletedTransaction,typeTransaction,yearTransaction,monthTransaction,dateInvestment,nameEntityChinese,nameEntityInvestment,amountInvestment,pctShare,sectorInvestment,subSectorInvestment,countryInvestment,regionInvestment,isBRI,isGreenfield,amountEnterpriseValueEntity
FALSE,FOREIGN INVESTMENTS,2005,JANUARY,2005-01-01,MINMETALS,CUBAPETROLEO,"$500,000,000", NA,METALS,NA,CUBA,NORTH AMERICA,FALSE,TRUE,"NA"
FALSE,FOREIGN INVESTMENTS,2005,JANUARY,2005-01-01,CHINA ACADEMY OF SCIENCES,IBM,"$1,740,000,000", NA,TECHNOLOGY,NA,USA,USA,FALSE,FALSE,"NA"
FALSE,FOREIGN INVESTMENTS,2005,FEBRUARY,2005-02-01,MINMETALS,CODELCO,"$550,000,000",50.00%,METALS,COPPER,CHILE,SOUTH AMERICA,FALSE,TRUE,"$1,100,000,000"
FALSE,FOREIGN INVESTMENTS,2005,MARCH,2005-03-01,MCC,HIGHLANDS PACIFIC,"$670,000,000",85.00%,METALS,STEEL,PAPUA NEW GUINEA,EAST ASIA,FALSE,TRUE,"$788,235,294"
FALSE,FOREIGN INVESTMENTS,2005,APRIL,2005-04-01,CNOOC,MEG ENERGY,"$130,000,000",17.00%,ENERGY,OIL,CANADA,NORTH AMERICA,FALSE,FALSE,"$764,705,882"
FALSE,FOREIGN INV
@abresler
abresler / tufte
Last active July 4, 2023 18:56
Recreating Edward Tufte's New York City Weather Visualization
library(dplyr)
library(tidyr)
library(magrittr)
library(ggplot2)
"http://academic.udayton.edu/kissock/http/Weather/gsod95-current/NYNEWYOR.txt" %>%
read.table() %>% data.frame %>% tbl_df -> data
names(data) <- c("month", "day", "year", "temp")
data %>%
group_by(year, month) %>%
devtools::install_github("abresler/gdeltr2")
devtools::install_github("hafen/trelliscopejs")
library(gdeltr2)
library(dplyr)
asb_ocr <- "Brooklyn Nets"
gkg_codes <-
get_codes_gkg_themes()
imageweb_codes <- get_gdelt_codebook_ft_api(code_book = "imageweb")
d3 = function() {
var d3 = {
version: "3.2.7"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window;
try {
d3_document.createElement("div").style.setProperty("opacity", 0, "");
combination count
Anosmia 140
Cough 57
Fatigue 198
Diarrhea 12
Breath 5
Fever 11
Cough&Fatigue 179
Fatigue&Fever 28
Breath&Fatigue 10
@abresler
abresler / neuralnetR.R
Created September 24, 2015 16:35 — forked from mick001/neuralnetR.R
A neural network exaple in R. Full article at:
# Set a seed
set.seed(500)
library(MASS)
data <- Boston
# Check that no data is missing
apply(data,2,function(x) sum(is.na(x)))
# Train-test random splitting for linear model
typeWRUPrediction nameSponsor nameChinese namePerson descriptionPerson idBatch isExternal
Asian AIQIKANG PHARMACEUTICAL TECHNOLOGY (SHANGHAI) CO LTD LU SHOUFU SHOUFU LU NA 2 FALSE
Asian ANHUI UNIVERSITY DING HONGQIANG HONGQIANG DING PROFESSOR OF COMPUTER SCIENCE AND ENGINEERING, UNIVERSITY OF TEXAS AT ARLINGTON NA NA
Asian ANJI MICROELECTRONICS (SHANGHAI) CO LTD WANG YUCHUN YUCHUN WANG NA 7 FALSE
Asian ANJI MICROELECTRONICS (SHANGHAI) CO LTD WANG SHUMIN SHUMIN WANG NA 10 FALSE
Asian AVIC COMMERCIAL AIRCRAFT ENGINE CO LTD HAN PINLIAN PINLIAN HAN NA 3 FALSE
Asian AVIC COMMERCIAL AIRCRAFT ENGINE CO LTD ZHANG WEISHAN WEISHAN ZHANG NA 3 FALSE
Asian AVIC COMMERCIAL AIRCRAFT ENGINE CO LTD HU ZHONGZHI ZHONGZHI HU NA 7 FALSE
Asian AVIC COMMERCIAL AIRCRAFT ENGINE CO LTD FANG LEI LEI FANG NA 7 FALSE
Asian AVIC COMMERCIAL AVIATION ENGINE CO LTD FENG JINXI JINXI FENG NA 7 FALSE
from to type weight
s01 s02 hyperlink 22
s01 s03 hyperlink 22
s01 s04 hyperlink 21
s01 s15 mention 20
s02 s01 hyperlink 23
s02 s03 hyperlink 21
s02 s09 hyperlink 1
s02 s10 hyperlink 5
s03 s01 hyperlink 21
s01 s02 hyperlink 22
s01 s03 hyperlink 22
s01 s04 hyperlink 21
s01 s15 mention 20
s02 s01 hyperlink 23
s02 s03 hyperlink 21
s02 s09 hyperlink 1
s02 s10 hyperlink 5
s03 s01 hyperlink 21
We can't make this file beautiful and searchable because it's too large.
,Name,Age,Photo,Nationality,Flag,Overall,Potential,Club,Club Logo,Value,Wage,Special,Acceleration,Aggression,Agility,Balance,Ball control,Composure,Crossing,Curve,Dribbling,Finishing,Free kick accuracy,GK diving,GK handling,GK kicking,GK positioning,GK reflexes,Heading accuracy,Interceptions,Jumping,Long passing,Long shots,Marking,Penalties,Positioning,Reactions,Short passing,Shot power,Sliding tackle,Sprint speed,Stamina,Standing tackle,Strength,Vision,Volleys,CAM,CB,CDM,CF,CM,ID,LAM,LB,LCB,LCM,LDM,LF,LM,LS,LW,LWB,Preferred Positions,RAM,RB,RCB,RCM,RDM,RF,RM,RS,RW,RWB,ST
0,Cristiano Ronaldo,32,https://cdn.sofifa.org/48/18/players/20801.png,Portugal,https://cdn.sofifa.org/flags/38.png,94,94,Real Madrid CF,https://cdn.sofifa.org/24/18/teams/243.png,€95.5M,€565K,2228,89,63,89,63,93,95,85,81,91,94,76,7,11,15,14,11,88,29,95,77,92,22,85,95,96,83,94,23,91,92,31,80,85,88,89.0,53.0,62.0,91.0,82.0,20801,89.0,61.0,53.0,82.0,62.0,91.0,89.0,92.0,91.0,66.0,ST LW ,89.0,61.0,53.0,82.0,62.0,91.0,89.0,92.0,91.0,66.0,92.0
1,L.