Skip to contents

Read and format data from csv or xlsx files

Usage

read_data(files_data, data_names = NULL)

Arguments

files_data

List of files to be read

data_names

Optional vector of names for the data frames

Value

A list of data frames

Examples

read_data(files_data = valid_example, data_names = c("methodology", "particles", "samples"))
#> $methodology
#> # A tibble: 659 × 15
#>    MethodID         MatIDMethod Equipment Magnification MethodComments Protocols
#>    <chr>            <lgl>       <lgl>     <lgl>         <lgl>          <lgl>    
#>  1 doi.org/10.1016… NA          NA        NA            NA             NA       
#>  2 doi.org/10.1016… NA          NA        NA            NA             NA       
#>  3 doi.org/10.1016… NA          NA        NA            NA             NA       
#>  4 doi.org/10.1016… NA          NA        NA            NA             NA       
#>  5 doi.org/10.1016… NA          NA        NA            NA             NA       
#>  6 doi.org/10.1016… NA          NA        NA            NA             NA       
#>  7 doi.org/10.1016… NA          NA        NA            NA             NA       
#>  8 doi.org/10.1016… NA          NA        NA            NA             NA       
#>  9 doi.org/10.1016… NA          NA        NA            NA             NA       
#> 10 doi.org/10.1016… NA          NA        NA            NA             NA       
#> # ℹ 649 more rows
#> # ℹ 9 more variables: Deployment <chr>, SamplingDevice <lgl>,
#> #   SmallestParticle <dbl>, TopParticle <dbl>, FilterType <lgl>,
#> #   FilterDiameter <lgl>, FilterPoreSize <dbl>, ImageFile <lgl>,
#> #   ImageType <lgl>
#> 
#> $particles
#> # A tibble: 659 × 131
#>    SampleID             SampleSize Project Affiliation Citation OwnerContributor
#>    <chr>                     <dbl> <lgl>   <lgl>       <lgl>    <lgl>           
#>  1 Bacon_Rind_1A|doi.o…        714 NA      NA          NA       NA              
#>  2 Big_Sky_2B|doi.org/…        714 NA      NA          NA       NA              
#>  3 Black_Butte_1A|doi.…        714 NA      NA          NA       NA              
#>  4 Black_Butte_2B|doi.…        714 NA      NA          NA       NA              
#>  5 Buffalo_Horn_2A|doi…        714 NA      NA          NA       NA              
#>  6 Buffalo_Horn_3A|doi…        714 NA      NA          NA       NA              
#>  7 Big_Sky_1A|doi.org/…        714 NA      NA          NA       NA              
#>  8 Big_Sky_2A|doi.org/…        714 NA      NA          NA       NA              
#>  9 Black_Butte_1B|doi.…        714 NA      NA          NA       NA              
#> 10 Black_Butte_3A|doi.…        714 NA      NA          NA       NA              
#> # ℹ 649 more rows
#> # ℹ 125 more variables: AnalysisContributor <lgl>, ReportingContributor <lgl>,
#> #   SiteName <chr>, Location <chr>, Compartment <chr>, SampleComments <chr>,
#> #   SamplingDepth <lgl>, SamplingVolume <lgl>, SamplingWeight <lgl>,
#> #   BlankContamination <lgl>, Latitude <dbl>, Longitude <dbl>, Matrix <chr>,
#> #   CollectionStartDateTime <dttm>, CollectionEndDateTime <dttm>,
#> #   SpatialFile <chr>, Concentration <chr>, ConcentrationUnits <chr>, …
#> 
#> $samples
#> # A tibble: 0 × 19
#> # ℹ 19 variables: ParticleID <lgl>, Amount <lgl>, Color <lgl>, Polymer <lgl>,
#> #   Shape <lgl>, PhotoID <lgl>, ParticleComments <lgl>, PlasticType <lgl>,
#> #   Length <lgl>, Width <lgl>, Height <lgl>, Units <lgl>, Mass <lgl>,
#> #   SurfaceArea <lgl>, SizeDimension <lgl>, Volume <lgl>, Tactile <lgl>,
#> #   ArrivalDate <lgl>, AnalysisDate <lgl>
#>