Skip to content

Commit

Permalink
Update build-rdb-parallel-furrr.R
Browse files Browse the repository at this point in the history
  • Loading branch information
lecy authored Mar 26, 2024
1 parent f8292aa commit 56d7e72
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions BUILD/build-rdb-parallel-furrr.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,28 @@ get_object_id <- function( url )
f <- function( url ) {

doc.i <- NULL
try( doc.i <- xml2::read_xml( file(url.i) ), silent=T )
if( is.null(doc.i) ){ return( url.i ) }
try( doc.i <- xml2::read_xml( file(url) ), silent=T )
if( is.null(doc.i) )
{
object.id <- get_object_id( url )
df <- data.frame( OBJECT_ID = object.id, URL=url )
return( df )
}

xml2::xml_ns_strip( doc.i )

activity.02 <-
build_rdb_table_v3( url=url.i,
build_rdb_table_v3( url=url,
doc=doc.i,
table.name="F9-P03-T01-PROGRAMS",
table.headers=table.headers.02 )
activity.03 <-
build_rdb_table_v3( url=url.i,
build_rdb_table_v3( url=url,
doc=doc.i,
table.name="F9-P03-T01-PROGRAMS",
table.headers=table.headers.03 )
activity.99 <-
build_rdb_table_v3( url=url.i,
build_rdb_table_v3( url=url,
doc=doc.i,
table.name="F9-P03-T01-PROGRAMS",
table.headers=table.headers.99 )
Expand All @@ -71,6 +76,7 @@ f <- function( url ) {
}



get_year <- function( urls )
{
future::plan( "future::multisession" )
Expand Down

0 comments on commit 56d7e72

Please sign in to comment.