#
#
#

df_investment <- read_feather("data/wp_esi_investment")
colnames(df_investment)
# "entity_id", "investment_date", "amount", "currency"

df_entity <- read_feather("data/wp_esi_entity")

#left_join(test_data, kantrowitz, by = c("first_name" = "name"))

f <- 
  left_join(df_entity, df_investment, by = c("id" = "entity_id")) %>% 
  subset(select = c("id", "name", "description", "country", "city", 
                    "founded_in", "employees","total_raised",
                    "amount", "currency", "investment_date")) %>% 
  mutate(
    country = ifelse(country=="", "N/A", country),
    description = paste0(substr(description, 1, 20), "..."),
    investment_date = as.Date(investment_date)
  )

