Skip to content

Commit

Permalink
Update functions.R
Browse files Browse the repository at this point in the history
  • Loading branch information
lecy authored Nov 22, 2024
1 parent ec21249 commit 66badff
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ get_bmf <- function( inactive=TRUE ){
return( bmf )
}


format_ein <- function( x, to="id" ) {

if( to == "id" ){
Expand All @@ -45,6 +46,22 @@ format_ein <- function( x, to="id" ) {

if( to == "n" ){
x <- gsub( "[^0-9]", "", x )
return( x ) }

return( x ) }
}


# df.list <- list()
# df.list[[ "2009" ]] <- get_table( "F9-P01-T00-SUMMARY", year=2009 )
# df.list[[ "2010" ]] <- get_table( "F9-P01-T00-SUMMARY", year=2010 )
# df.list[[ "2011" ]] <- get_table( "F9-P01-T00-SUMMARY", year=2011 )
# df <- dplyr::bind_rows( df.list )

get_panel <- function( table.name, years=2009:2019 ){
df.list <- list()
for( i in years )
{
df.list[[ "2009" ]] <- get_table( "F9-P01-T00-SUMMARY", year=2009 )
}
df <- dplyr::bind_rows( df.list )
return( df )
}

0 comments on commit 66badff

Please sign in to comment.