This function is responsible for handling the rule reformating, dataset handling and foreign key checks.
Examples
data("test_rules")
data("valid_example")
reformat_rules(rules = test_rules, data_formatted = valid_example)
#> name
#> 1 ParticleID
#> 2 Amount
#> 3 Color
#> 4 Polymer
#> 5 Shape
#> 6 PhotoID
#> 7 ParticleComments
#> 8 PlasticType
#> 9 Length
#> 10 Width
#> 11 Height
#> 12 Units
#> 13 Mass
#> 14 SurfaceArea
#> 15 SizeDimension
#> 16 Volume
#> 17 Tactile
#> 18 ArrivalDate
#> 19 AnalysisDate
#> 20 MethodID
#> 21 MatIDMethod
#> 22 Equipment
#> 23 Magnification
#> 24 MethodComments
#> 25 Protocols
#> 26 Deployment
#> 27 SamplingDevice
#> 28 SmallestParticle
#> 29 TopParticle
#> 30 FilterType
#> 31 FilterDiameter
#> 32 FilterPoreSize
#> 33 ImageFile
#> 34 ImageType
#> 35 SampleID
#> 36 SampleSize
#> 37 Project
#> 38 Affiliation
#> 39 Citation
#> 40 OwnerContributor
#> 41 AnalysisContributor
#> 42 ReportingContributor
#> 43 SiteName
#> 44 Location
#> 45 Compartment
#> 46 SampleComments
#> 47 SamplingDepth
#> 48 SamplingVolume
#> 49 SamplingWeight
#> 50 BlankContamination
#> 51 Latitude
#> 52 Longitude
#> 53 Matrix
#> 54 CollectionStartDateTime
#> 55 CollectionEndDateTime
#> 56 SpatialFile
#> 57 Concentration
#> 58 ConcentrationUnits
#> 59 StandardizedConcentration
#> 60 StandardizedConcentrationUnits
#> 61 Color_Transparent
#> 62 Color_Blue
#> 63 Color_Red
#> 64 Color_Brown
#> 65 Color_Green
#> 66 Color_Orange
#> 67 Color_White
#> 68 Color_Yellow
#> 69 Color_Pink
#> 70 Color_Black
#> 71 Color_Other
#> 72 Material_PEST
#> 73 Material_PE
#> 74 Material_PP
#> 75 Material_PA
#> 76 Material_PE_PS
#> 77 Material_PS
#> 78 Material_CA
#> 79 Material_PVC
#> 80 Material_ER
#> 81 Material_PAM
#> 82 Material_PET
#> 83 Material_PlasticAdditive
#> 84 Material_PBT
#> 85 Material_PU
#> 86 Material_PET_PEST
#> 87 Material_PAN
#> 88 Material_Silicone
#> 89 Material_Acrylic
#> 90 Material_Vinyl
#> 91 Material_Vinyon
#> 92 Material_Other
#> 93 Material_PA_ER
#> 94 Material_PTT
#> 95 Material_PE_PP
#> 96 Material_PPS
#> 97 Material_Rayon
#> 98 Material_PAA
#> 99 Material_PMPS
#> 100 Material_PI
#> 101 Material_Olefin
#> 102 Material_Styrene_Butadiene
#> 103 Material_PBA
#> 104 Material_PMMA
#> 105 Material_Cellophane
#> 106 Material_SAN
#> 107 Material_PC
#> 108 Material_PDMS
#> 109 Material_PLA
#> 110 Material_PTFE
#> 111 Material_SBR
#> 112 Material_PET_Olefin
#> 113 Material_PES
#> 114 Material_ABS
#> 115 Material_LDPE
#> 116 Material_PEVA
#> 117 Material_AR
#> 118 Material_PVA
#> 119 Material_PPE
#> 120 Morphology_Fragment
#> 121 Morphology_Fiber
#> 122 Morphology_Nurdle
#> 123 Morphology_Film
#> 124 Morphology_Foam
#> 125 Morphology_Sphere
#> 126 Morphology_Line
#> 127 Morphology_Bead
#> 128 Morphology_Sheet
#> 129 Morphology_Film_Fragment
#> 130 Morphology_Rubbery_Fragment
#> 131 Size_3000um
#> 132 Size_2_5mm
#> 133 Size_1_5mm
#> 134 Size_1_2mm
#> 135 Size_0.5_1mm
#> 136 Size_less_than_0.5mm
#> 137 Size_500um
#> 138 Size_300_500um
#> 139 Size_125_300um
#> 140 Size_100_500um
#> 141 Size_greater_than_100um
#> 142 Size_50_150um
#> 143 Size_50_100um
#> 144 Size_50um
#> 145 Size_45_125um
#> 146 Size_greater_than_25um
#> 147 Size_20um_5mm
#> 148 Size_20_100um
#> 149 Size_20_50um
#> 150 Size_10_50um
#> 151 Size_10_45um
#> 152 Size_10_20um
#> 153 Size_greater_than_10um
#> 154 Size_8_316um
#> 155 Size_5_100um
#> 156 Size_5_10um
#> 157 Size_4_10um
#> 158 Size_1.5_5um
#> 159 Size_less_than_1.5um
#> 160 Size_1_100um
#> 161 Size_1_50um
#> 162 Size_1_10um
#> 163 Size_1_5um
#> 164 Size_110_124nm
#> 165 Size_0_20um
#> description
#> 1 Online identifier for particle; should be unique
#> 2 If there are two or more identical particles (in every aspect), upload it once and indicate the number of identical particles here as a whole number
#> 3 Particle color must be a character
#> 4 Particle polymer must be a character
#> 5 Particle shape/morphology must be a character
#> 6 Images must be .png, .jpg, or .jpeg
#> 7 Additional comments about the particle
#> 8 Plastic type should be either 'Microplastic'(s), 'Macroplastic'(s), or NA
#> 9 Particle size longest dimension
#> 10 Particle size shortest dimension
#> 11 Third particle dimension
#> 12 Evaluated size range units
#> 13 Particle mass (mg)
#> 14 Particle projected surface area (um^3)
#> 15 The name of the size used to describe the plastic rather than the exact dimensions
#> 16 Particle projected volume
#> 17 Particle tactile features (Ridgid, Rubbery, Squishy)
#> 18 The date the particle arrived for analysis
#> 19 The date the analysis for the particle was finalized
#> 20 Online identifier for methodology; should be unique
#> 21 Material identification method (ex. Raman, ftir)
#> 22 The name of the instrument used for analysis
#> 23 Magnification of the instrument during analysis
#> 24 Additional comments about the method
#> 25 List any protocols that were taken to reduce contamination (ex. Airfiltration type, clothing policy, etc)
#> 26 Deployment method; Grab or Net
#> 27 Device used to collect sample and dimensions
#> 28 Smallest particle size measured (um)
#> 29 Top particle size measured (um)
#> 30 Filter material type
#> 31 Diameter of filter in mm; must not be NA
#> 32 Filter pore size in um
#> 33 File name needs to be unique
#> 34 Image type should be SEM, Visual, or Fluorescence
#> 35 Online identifier for sample; should be unique
#> 36 The number of particles in the sample
#> 37 The name of the project the sample is a part of and should not be NA
#> 38 The name of the institute where the researcher is from; must not be NA
#> 39 The citation for the sample collected; must not be NA
#> 40 The name of the person/people who owns the sample
#> 41 The name of the person/people who analyzed the sample; is in charge of the quality of the data entry
#> 42 The name of the person/people who reported the sample results
#> 43 The name of the site that the sample was collected at and should not be NA
#> 44 The name of the location the sample was collected at and should not be NA
#> 45 Sample type of environment must be valid (ex. Fresh water surface)
#> 46 Additional comments about the sample
#> 47 The depth layer the sample was taken (in m); biota and sediment samples = water depth, soil and beach samples = depth from surface if not surface
#> 48 The volume of the matrix sampled (in m3)
#> 49 The weight of the sample (in kg)- apart from biota it always refers to dry weight
#> 50 The number of particles which contaminate each blank sample collected with this methodology on average
#> 51 Latitude of sample in decimal degrees up to eight places
#> 52 Longitude of sample in decimal degrees up to eight places
#> 53 The sample type; ex. 'Drinking Water', 'River Water', or 'Source Water'
#> 54 Sample collection start date time (yyyy-mm-dd hh:mm)
#> 55 Sample collection end date time (yyyy-mm-dd hh:mm)
#> 56 Spatial file name (.kml)
#> 57 The concentration of plastics in a sample
#> 58 The unit for the concentration of plastics per sample
#> 59 If concentration is standardized, indicate here
#> 60 The unit for the standardized concentration
#> 61 Proportion of sample that has a given attribute
#> 62 Proportion of sample that has a given attribute
#> 63 Proportion of sample that has a given attribute
#> 64 Proportion of sample that has a given attribute
#> 65 Proportion of sample that has a given attribute
#> 66 Proportion of sample that has a given attribute
#> 67 Proportion of sample that has a given attribute
#> 68 Proportion of sample that has a given attribute
#> 69 Proportion of sample that has a given attribute
#> 70 Proportion of sample that has a given attribute
#> 71 Proportion of sample that has a given attribute
#> 72 Proportion of sample that has a given attribute
#> 73 Proportion of sample that has a given attribute
#> 74 Proportion of sample that has a given attribute
#> 75 Proportion of sample that has a given attribute
#> 76 Proportion of sample that has a given attribute
#> 77 Proportion of sample that has a given attribute
#> 78 Proportion of sample that has a given attribute
#> 79 Proportion of sample that has a given attribute
#> 80 Proportion of sample that has a given attribute
#> 81 Proportion of sample that has a given attribute
#> 82 Proportion of sample that has a given attribute
#> 83 Proportion of sample that has a given attribute
#> 84 Proportion of sample that has a given attribute
#> 85 Proportion of sample that has a given attribute
#> 86 Proportion of sample that has a given attribute
#> 87 Proportion of sample that has a given attribute
#> 88 Proportion of sample that has a given attribute
#> 89 Proportion of sample that has a given attribute
#> 90 Proportion of sample that has a given attribute
#> 91 Proportion of sample that has a given attribute
#> 92 Proportion of sample that has a given attribute
#> 93 Proportion of sample that has a given attribute
#> 94 Proportion of sample that has a given attribute
#> 95 Proportion of sample that has a given attribute
#> 96 Proportion of sample that has a given attribute
#> 97 Proportion of sample that has a given attribute
#> 98 Proportion of sample that has a given attribute
#> 99 Proportion of sample that has a given attribute
#> 100 Proportion of sample that has a given attribute
#> 101 Proportion of sample that has a given attribute
#> 102 Proportion of sample that has a given attribute
#> 103 Proportion of sample that has a given attribute
#> 104 Proportion of sample that has a given attribute
#> 105 Proportion of sample that has a given attribute
#> 106 Proportion of sample that has a given attribute
#> 107 Proportion of sample that has a given attribute
#> 108 Proportion of sample that has a given attribute
#> 109 Proportion of sample that has a given attribute
#> 110 Proportion of sample that has a given attribute
#> 111 Proportion of sample that has a given attribute
#> 112 Proportion of sample that has a given attribute
#> 113 Proportion of sample that has a given attribute
#> 114 Proportion of sample that has a given attribute
#> 115 Proportion of sample that has a given attribute
#> 116 Proportion of sample that has a given attribute
#> 117 Proportion of sample that has a given attribute
#> 118 Proportion of sample that has a given attribute
#> 119 Proportion of sample that has a given attribute
#> 120 Proportion of sample that has a given attribute
#> 121 Proportion of sample that has a given attribute
#> 122 Proportion of sample that has a given attribute
#> 123 Proportion of sample that has a given attribute
#> 124 Proportion of sample that has a given attribute
#> 125 Proportion of sample that has a given attribute
#> 126 Proportion of sample that has a given attribute
#> 127 Proportion of sample that has a given attribute
#> 128 Proportion of sample that has a given attribute
#> 129 Proportion of sample that has a given attribute
#> 130 Proportion of sample that has a given attribute
#> 131 Proportion of sample that has a given attribute
#> 132 Proportion of sample that has a given attribute
#> 133 Proportion of sample that has a given attribute
#> 134 Proportion of sample that has a given attribute
#> 135 Proportion of sample that has a given attribute
#> 136 Proportion of sample that has a given attribute
#> 137 Proportion of sample that has a given attribute
#> 138 Proportion of sample that has a given attribute
#> 139 Proportion of sample that has a given attribute
#> 140 Proportion of sample that has a given attribute
#> 141 Proportion of sample that has a given attribute
#> 142 Proportion of sample that has a given attribute
#> 143 Proportion of sample that has a given attribute
#> 144 Proportion of sample that has a given attribute
#> 145 Proportion of sample that has a given attribute
#> 146 Proportion of sample that has a given attribute
#> 147 Proportion of sample that has a given attribute
#> 148 Proportion of sample that has a given attribute
#> 149 Proportion of sample that has a given attribute
#> 150 Proportion of sample that has a given attribute
#> 151 Proportion of sample that has a given attribute
#> 152 Proportion of sample that has a given attribute
#> 153 Proportion of sample that has a given attribute
#> 154 Proportion of sample that has a given attribute
#> 155 Proportion of sample that has a given attribute
#> 156 Proportion of sample that has a given attribute
#> 157 Proportion of sample that has a given attribute
#> 158 Proportion of sample that has a given attribute
#> 159 Proportion of sample that has a given attribute
#> 160 Proportion of sample that has a given attribute
#> 161 Proportion of sample that has a given attribute
#> 162 Proportion of sample that has a given attribute
#> 163 Proportion of sample that has a given attribute
#> 164 Proportion of sample that has a given attribute
#> 165 Proportion of sample that has a given attribute
#> dataset
#> 1 particles
#> 2 particles
#> 3 particles
#> 4 particles
#> 5 particles
#> 6 particles
#> 7 particles
#> 8 particles
#> 9 particles
#> 10 particles
#> 11 particles
#> 12 particles
#> 13 particles
#> 14 particles
#> 15 particles
#> 16 particles
#> 17 particles
#> 18 particles
#> 19 particles
#> 20 methodology
#> 21 methodology
#> 22 methodology
#> 23 methodology
#> 24 methodology
#> 25 methodology
#> 26 methodology
#> 27 methodology
#> 28 methodology
#> 29 methodology
#> 30 methodology
#> 31 methodology
#> 32 methodology
#> 33 methodology
#> 34 methodology
#> 35 samples
#> 36 samples
#> 37 samples
#> 38 samples
#> 39 samples
#> 40 samples
#> 41 samples
#> 42 samples
#> 43 samples
#> 44 samples
#> 45 samples
#> 46 samples
#> 47 samples
#> 48 samples
#> 49 samples
#> 50 samples
#> 51 samples
#> 52 samples
#> 53 samples
#> 54 samples
#> 55 samples
#> 56 samples
#> 57 samples
#> 58 samples
#> 59 samples
#> 60 samples
#> 61 samples
#> 62 samples
#> 63 samples
#> 64 samples
#> 65 samples
#> 66 samples
#> 67 samples
#> 68 samples
#> 69 samples
#> 70 samples
#> 71 samples
#> 72 samples
#> 73 samples
#> 74 samples
#> 75 samples
#> 76 samples
#> 77 samples
#> 78 samples
#> 79 samples
#> 80 samples
#> 81 samples
#> 82 samples
#> 83 samples
#> 84 samples
#> 85 samples
#> 86 samples
#> 87 samples
#> 88 samples
#> 89 samples
#> 90 samples
#> 91 samples
#> 92 samples
#> 93 samples
#> 94 samples
#> 95 samples
#> 96 samples
#> 97 samples
#> 98 samples
#> 99 samples
#> 100 samples
#> 101 samples
#> 102 samples
#> 103 samples
#> 104 samples
#> 105 samples
#> 106 samples
#> 107 samples
#> 108 samples
#> 109 samples
#> 110 samples
#> 111 samples
#> 112 samples
#> 113 samples
#> 114 samples
#> 115 samples
#> 116 samples
#> 117 samples
#> 118 samples
#> 119 samples
#> 120 samples
#> 121 samples
#> 122 samples
#> 123 samples
#> 124 samples
#> 125 samples
#> 126 samples
#> 127 samples
#> 128 samples
#> 129 samples
#> 130 samples
#> 131 samples
#> 132 samples
#> 133 samples
#> 134 samples
#> 135 samples
#> 136 samples
#> 137 samples
#> 138 samples
#> 139 samples
#> 140 samples
#> 141 samples
#> 142 samples
#> 143 samples
#> 144 samples
#> 145 samples
#> 146 samples
#> 147 samples
#> 148 samples
#> 149 samples
#> 150 samples
#> 151 samples
#> 152 samples
#> 153 samples
#> 154 samples
#> 155 samples
#> 156 samples
#> 157 samples
#> 158 samples
#> 159 samples
#> 160 samples
#> 161 samples
#> 162 samples
#> 163 samples
#> 164 samples
#> 165 samples
#> valid_example
#> 1 1_23jreh334
#> 2 2
#> 3 White
#> 4 Polyethylene
#> 5 Sphere
#> 6 ALGALITA_CW_3_above500_30.jpeg
#> 7 Spectra noisy
#> 8 Microplastic
#> 9 100
#> 10 100
#> 11 100
#> 12 um
#> 13 0.1
#> 14 31415.93
#> 15 Nominal
#> 16 10000
#> 17 Ridgid
#> 18 yyyy-mm-dd
#> 19 yyyy-mm-dd
#> 20 https://www.waterboards.ca.gov/drinking_water/certlic/drinkingwater/documents/microplastics/mcrplsts_plcy_drft.pdf
#> 21 FTIR
#> 22 Nikon SMZ1270
#> 23 10
#> 24 N/A
#> 25 Airfiltration system in lab (Honeywell) and synthetic clothing is restricted from lab
#> 26 Grab
#> 27 10 L Glass Jar
#> 28 45
#> 29 9600
#> 30 gold coated polycarbonate
#> 31 45
#> 32 10
#> 33 photo.jpg
#> 34 SEM
#> 35 23jreh334
#> 36 714
#> 37 Microplastics Image Explorer
#> 38 Moore Institute for Plastic Pollution Research
#> 39 Lattin and Moore 2020, Interlab Comparison Study Data, Moore Institute for Plastic Pollution Research
#> 40 Moore Institute for Plastic Pollution Research
#> 41 Moore Institute for Plastic Pollution Research
#> 42 Moore Institute for Plastic Pollution Research
#> 43 Riverside County Water Municipality
#> 44 Long Beach, CA, USA
#> 45 Fresh water surface
#> 46 internal standard particles
#> 47 100
#> 48 100
#> 49 100
#> 50 10
#> 51 33.74697
#> 52 -118.11537
#> 53 Drinking Water
#> 54 yyyy-mm-dd hh:mm:ss
#> 55 yyyy-mm-dd hh:mm:ss
#> 56 Bacon_Rind_1A|doi.org/10.1016/j.watres.2018.10.013.kml
#> 57 0.8
#> 58 particles/L
#> 59 800
#> 60 ppm3
#> 61 0.09
#> 62 0.09
#> 63 0.09
#> 64 0.09
#> 65 0.09
#> 66 0.09
#> 67 0.09
#> 68 0.09
#> 69 0.09
#> 70 0.09
#> 71 0.09
#> 72 0.019
#> 73 0.019
#> 74 0.019
#> 75 0.019
#> 76 0.019
#> 77 0.019
#> 78 0.019
#> 79 0.019
#> 80 0.019
#> 81 0.019
#> 82 0.019
#> 83 0.019
#> 84 0.019
#> 85 0.019
#> 86 0.019
#> 87 0.019
#> 88 0.019
#> 89 0.019
#> 90 0.019
#> 91 0.019
#> 92 0.019
#> 93 0.019
#> 94 0.019
#> 95 0.019
#> 96 0.019
#> 97 0.019
#> 98 0.019
#> 99 0.019
#> 100 0.019
#> 101 0.019
#> 102 0.019
#> 103 0.019
#> 104 0.019
#> 105 0.019
#> 106 0.019
#> 107 0.019
#> 108 0.019
#> 109 0.019
#> 110 0.019
#> 111 0.019
#> 112 0.019
#> 113 0.019
#> 114 0.019
#> 115 0.019
#> 116 0.019
#> 117 0.019
#> 118 0.019
#> 119 0.019
#> 120 0.14
#> 121 0.14
#> 122 0.019
#> 123 0.019
#> 124 0.019
#> 125 0.019
#> 126 0.14
#> 127 0.14
#> 128 0.14
#> 129 0.14
#> 130 0.14
#> 131 0.028
#> 132 0.028
#> 133 0.028
#> 134 0.028
#> 135 0.028
#> 136 0.028
#> 137 0.028
#> 138 0.028
#> 139 0.028
#> 140 0.028
#> 141 0.028
#> 142 0.028
#> 143 0.028
#> 144 0.028
#> 145 0.028
#> 146 0.028
#> 147 0.028
#> 148 0.028
#> 149 0.028
#> 150 0.028
#> 151 0.028
#> 152 0.028
#> 153 0.028
#> 154 0.028
#> 155 0.028
#> 156 0.028
#> 157 0.028
#> 158 0.028
#> 159 0.028
#> 160 0.028
#> 161 0.028
#> 162 0.028
#> 163 0.028
#> 164 0.028
#> 165 0.028
#> severity
#> 1 warning
#> 2 warning
#> 3 warning
#> 4 warning
#> 5 warning
#> 6 warning
#> 7 warning
#> 8 warning
#> 9 warning
#> 10 warning
#> 11 warning
#> 12 warning
#> 13 warning
#> 14 warning
#> 15 warning
#> 16 warning
#> 17 warning
#> 18 warning
#> 19 warning
#> 20 warning
#> 21 warning
#> 22 warning
#> 23 warning
#> 24 warning
#> 25 warning
#> 26 warning
#> 27 warning
#> 28 warning
#> 29 warning
#> 30 warning
#> 31 warning
#> 32 warning
#> 33 warning
#> 34 warning
#> 35 warning
#> 36 warning
#> 37 warning
#> 38 warning
#> 39 warning
#> 40 warning
#> 41 warning
#> 42 warning
#> 43 warning
#> 44 warning
#> 45 warning
#> 46 warning
#> 47 warning
#> 48 warning
#> 49 warning
#> 50 warning
#> 51 warning
#> 52 warning
#> 53 warning
#> 54 warning
#> 55 warning
#> 56 warning
#> 57 warning
#> 58 warning
#> 59 warning
#> 60 warning
#> 61 warning
#> 62 warning
#> 63 warning
#> 64 warning
#> 65 warning
#> 66 warning
#> 67 warning
#> 68 warning
#> 69 warning
#> 70 warning
#> 71 warning
#> 72 warning
#> 73 warning
#> 74 warning
#> 75 warning
#> 76 warning
#> 77 warning
#> 78 warning
#> 79 warning
#> 80 warning
#> 81 warning
#> 82 warning
#> 83 warning
#> 84 warning
#> 85 warning
#> 86 warning
#> 87 warning
#> 88 warning
#> 89 warning
#> 90 warning
#> 91 warning
#> 92 warning
#> 93 warning
#> 94 warning
#> 95 warning
#> 96 warning
#> 97 warning
#> 98 warning
#> 99 warning
#> 100 warning
#> 101 warning
#> 102 warning
#> 103 warning
#> 104 warning
#> 105 warning
#> 106 warning
#> 107 warning
#> 108 warning
#> 109 warning
#> 110 warning
#> 111 warning
#> 112 warning
#> 113 warning
#> 114 warning
#> 115 warning
#> 116 warning
#> 117 warning
#> 118 warning
#> 119 warning
#> 120 warning
#> 121 warning
#> 122 warning
#> 123 warning
#> 124 warning
#> 125 warning
#> 126 warning
#> 127 warning
#> 128 warning
#> 129 warning
#> 130 warning
#> 131 warning
#> 132 warning
#> 133 warning
#> 134 warning
#> 135 warning
#> 136 warning
#> 137 warning
#> 138 warning
#> 139 warning
#> 140 warning
#> 141 warning
#> 142 warning
#> 143 warning
#> 144 warning
#> 145 warning
#> 146 warning
#> 147 warning
#> 148 warning
#> 149 warning
#> 150 warning
#> 151 warning
#> 152 warning
#> 153 warning
#> 154 warning
#> 155 warning
#> 156 warning
#> 157 warning
#> 158 warning
#> 159 warning
#> 160 warning
#> 161 warning
#> 162 warning
#> 163 warning
#> 164 warning
#> 165 warning
#> rule
#> 1 is_unique(ParticleID) & !is.na(ParticleID)
#> 2 Amount >= 2 | is.na(Amount)
#> 3 is.character(Color)
#> 4 is.character(Polymer)
#> 5 is.character(Shape)
#> 6 grepl("(\\\\.jpg$)|(\\\\.png$)|(\\\\.jpeg$)", PhotoID, ignore.case = TRUE) & is_unique(PhotoID)
#> 7 !is.na(ParticleComments) | is.na(ParticleComments)
#> 8 PlasticType %in% c("Microplastic", "Microplastics", "Macroplastic", "Macroplastics") | is.na(PlasticType)
#> 9 is.numeric(Length)
#> 10 is.numeric(Width)
#> 11 is.numeric(Height)
#> 12 is.character(Units)
#> 13 is.numeric(Mass)
#> 14 in_range(is.numeric(SurfaceArea), min = 0.1, max = 1000000)
#> 15 SizeDimension %in% c("Nominal", "nominal", "ferret diameter", "longest length") | is.na(SizeDimension)
#> 16 is.numeric(Volume)
#> 17 Tactile %in% c("Ridgid", "Rubbery", "Squishy") | is.na(Tactile)
#> 18 !is.na(ArrivalDate) & !is.na(as.Date(ArrivalDate, format = "%Y-%m-%d"))
#> 19 !is.na(AnalysisDate) & !is.na(as.Date(AnalysisDate, format = "%Y-%m-%d"))
#> 20 is_unique(MethodID) & !is.na(MethodID)
#> 21 MatIDMethod %in% c("FTIR", "Raman", "PyGCMS") | is.na(MatIDMethod)
#> 22 !is.na(Equipment)
#> 23 is.numeric(Magnification)
#> 24 !is.na(MethodComments) | is.na(MethodComments)
#> 25 !is.na(Protocols) | is.na(Protocols)
#> 26 toupper(Deployment) %in% c("GRAB", "NET") | is.na(Deployment) | Deployment == ""
#> 27 is.character(SamplingDevice)
#> 28 is.numeric(SmallestParticle)
#> 29 is.numeric(TopParticle)
#> 30 is.character(FilterType)
#> 31 is.numeric(FilterDiameter)
#> 32 is.numeric(FilterPoreSize)
#> 33 is_unique(ImageFile)
#> 34 ImageType %in% c("SEM", "Visual", "Fluorescence") | is.na(ImageType)
#> 35 is_unique(SampleID) & !is.na(SampleID)
#> 36 is.numeric(SampleSize)
#> 37 !is.na(Project) & is.character(Project)
#> 38 !is.na(Affiliation) & is.character(Affiliation)
#> 39 !is.na(Citation) & is.character(Citation)
#> 40 !is.na(OwnerContributor) & is.character(OwnerContributor)
#> 41 !is.na(AnalysisContributor) & is.character(AnalysisContributor)
#> 42 !is.na(ReportingContributor) & is.character(ReportingContributor)
#> 43 !is.na(SiteName) & is.character(SiteName)
#> 44 !is.na(Location) & is.character(Location)
#> 45 is.character(Compartment)
#> 46 !is.na(SampleComments) | is.na(SampleComments)
#> 47 is.numeric(SamplingDepth)
#> 48 is.numeric(SamplingVolume)
#> 49 is.numeric(SamplingWeight)
#> 50 BlankContamination >= 0
#> 51 grepl("^-?\\\\d+(\\\\.\\\\d{1,8})*$", Latitude)
#> 52 grepl("^-?\\\\d+(\\\\.\\\\d{1,8})*$", Longitude)
#> 53 is.character(Matrix)
#> 54 !is.na(CollectionStartDateTime)
#> 55 !is.na(CollectionEndDateTime)
#> 56 is.character(SpatialFile)
#> 57 is.numeric(Concentration)
#> 58 is.character(ConcentrationUnits)
#> 59 is.numeric(StandardizedConcentration)
#> 60 is.character(StandardizedConcentrationUnits)
#> 61 Color_Transparent <=1 | Color_Transparent%vin%c("N/A") | Color_Transparent%vin%("Present")
#> 62 Color_Blue <=1 | Color_Blue%vin%c("N/A") | Color_Blue%vin%("Present")
#> 63 Color_Red <=1 | Color_Red%vin%c("N/A") | Color_Red%vin%("Present")
#> 64 Color_Brown <=1 | Color_Brown%vin%c("N/A") | Color_Brown%vin%("Present")
#> 65 Color_Green <=1 | Color_Green%vin%c("N/A") | Color_Green%vin%("Present")
#> 66 Color_Orange <=1 | Color_Orange%vin%c("N/A") | Color_Orange%vin%("Present")
#> 67 Color_White <=1 | Color_White%vin%c("N/A") | Color_White%vin%("Present")
#> 68 Color_Yellow <=1 | Color_Yellow%vin%c("N/A") | Color_Yellow%vin%("Present")
#> 69 Color_Pink <=1 | Color_Pink%vin%c("N/A") | Color_Pink%vin%("Present")
#> 70 Color_Black <=1 | Color_Black%vin%c("N/A") | Color_Black%vin%("Present")
#> 71 Color_Other <=1 | Color_Other%vin%c("N/A") | Color_Other%vin%("Present")
#> 72 Material_PEST <=1 | Material_PEST%vin%c("N/A") | Material_PEST%vin%("Present")
#> 73 Material_PE <=1 | Material_PE%vin%c("N/A") | Material_PE%vin%("Present")
#> 74 Material_PP <=1 | Material_PP%vin%c("N/A") | Material_PP%vin%("Present")
#> 75 Material_PA <=1 | Material_PA%vin%c("N/A") | Material_PA%vin%("Present")
#> 76 Material_PE_PS <=1 | Material_PE_PS%vin%c("N/A") | Material_PE_PS%vin%("Present")
#> 77 Material_PS <=1 | Material_PS%vin%c("N/A") | Material_PS%vin%("Present")
#> 78 Material_CA <=1 | Material_CA%vin%c("N/A") | Material_CA%vin%("Present")
#> 79 Material_PVC <=1 | Material_PVC%vin%c("N/A") | Material_PVC%vin%("Present")
#> 80 Material_ER <=1 | Material_ER%vin%c("N/A") | Material_ER%vin%("Present")
#> 81 Material_PAM <=1 | Material_PAM%vin%c("N/A") | Material_PAM%vin%("Present")
#> 82 Material_PET <=1 | Material_PET%vin%c("N/A") | Material_PET%vin%("Present")
#> 83 Material_PlasticAdditive <=1 | Material_PlasticAdditive%vin%c("N/A") | Material_PlasticAdditive%vin%("Present")
#> 84 Material_PBT <=1 | Material_PBT%vin%c("N/A") | Material_PBT%vin%("Present")
#> 85 Material_PU <=1 | Material_PU%vin%c("N/A") | Material_PU%vin%("Present")
#> 86 Material_PET_PEST <=1 | Material_PET_PEST%vin%c("N/A") | Material_PET_PEST%vin%("Present")
#> 87 Material_PAN <=1 | Material_PAN%vin%c("N/A") | Material_PAN%vin%("Present")
#> 88 Material_Silicone <=1 | Material_Silicone%vin%c("N/A") | Material_Silicone%vin%("Present")
#> 89 Material_Acrylic <=1 | Material_Acrylic%vin%c("N/A") | Material_Acrylic%vin%("Present")
#> 90 Material_Vinyl <=1 | Material_Vinyl%vin%c("N/A") | Material_Vinyl%vin%("Present")
#> 91 Material_Vinyon <=1 | Material_Vinyon%vin%c("N/A") | Material_Vinyon%vin%("Present")
#> 92 Material_Other <=1 | Material_Other%vin%c("N/A") | Material_Other%vin%("Present")
#> 93 Material_PA_ER <=1 | Material_PA_ER%vin%c("N/A") | Material_PA_ER%vin%("Present")
#> 94 Material_PTT <=1 | Material_PTT%vin%c("N/A") | Material_PTT%vin%("Present")
#> 95 Material_PE_PP <=1 | Material_PE_PP%vin%c("N/A") | Material_PE_PP%vin%("Present")
#> 96 Material_PPS <=1 | Material_PPS%vin%c("N/A") | Material_PPS%vin%("Present")
#> 97 Material_Rayon <=1 | Material_Rayon%vin%c("N/A") | Material_Rayon%vin%("Present")
#> 98 Material_PAA <=1 | Material_PAA%vin%c("N/A") | Material_PAA%vin%("Present")
#> 99 Material_PMPS <=1 | Material_PMPS%vin%c("N/A") | Material_PMPS%vin%("Present")
#> 100 Material_PI <=1 | Material_PI%vin%c("N/A") | Material_PI%vin%("Present")
#> 101 Material_Olefin <=1 | Material_Olefin%vin%c("N/A") | Material_Olefin%vin%("Present")
#> 102 Material_Styrene_Butadiene <=1 | Material_Styrene_Butadiene%vin%c("N/A") | Material_Styrene_Butadiene%vin%("Present")
#> 103 Material_PBA <=1 | Material_PBA%vin%c("N/A") | Material_PBA%vin%("Present")
#> 104 Material_PMMA <=1 | Material_PMMA%vin%c("N/A") | Material_PMMA%vin%("Present")
#> 105 Material_Cellophane <=1 | Material_Cellophane%vin%c("N/A") | Material_Cellophane%vin%("Present")
#> 106 Material_SAN <=1 | Material_SAN%vin%c("N/A") | Material_SAN%vin%("Present")
#> 107 Material_PC <=1 | Material_PC%vin%c("N/A") | Material_PC%vin%("Present")
#> 108 Material_PDMS <=1 | Material_PDMS%vin%c("N/A") | Material_PDMS%vin%("Present")
#> 109 Material_PLA <=1 | Material_PLA%vin%c("N/A") | Material_PLA%vin%("Present")
#> 110 Material_PTFE <=1 | Material_PTFE%vin%c("N/A") | Material_PTFE%vin%("Present")
#> 111 Material_SBR <=1 | Material_SBR%vin%c("N/A") | Material_SBR%vin%("Present")
#> 112 Material_PET_Olefin <=1 | Material_PET_Olefin%vin%c("N/A") | Material_PET_Olefin%vin%("Present")
#> 113 Material_PES <=1 | Material_PES%vin%c("N/A") | Material_PES%vin%("Present")
#> 114 Material_ABS <=1 | Material_ABS%vin%c("N/A") | Material_ABS%vin%("Present")
#> 115 Material_LDPE <=1 | Material_LDPE%vin%c("N/A") | Material_LDPE%vin%("Present")
#> 116 Material_PEVA <=1 | Material_PEVA%vin%c("N/A") | Material_PEVA%vin%("Present")
#> 117 Material_AR <=1 | Material_AR%vin%c("N/A") | Material_AR%vin%("Present")
#> 118 Material_PVA <=1 | Material_PVA%vin%c("N/A") | Material_PVA%vin%("Present")
#> 119 Material_PPE <=1 | Material_PPE%vin%c("N/A") | Material_PPE%vin%("Present")
#> 120 Morphology_Fragment <=1 | Morphology_Fragment%vin%c("N/A") | Morphology_Fragment%vin%("Present")
#> 121 Morphology_Fiber <=1 | Morphology_Fiber%vin%c("N/A") | Morphology_Fiber%vin%("Present")
#> 122 Morphology_Nurdle <=1 | Morphology_Nurdle%vin%c("N/A") | Morphology_Nurdle%vin%("Present")
#> 123 Morphology_Film <=1 | Morphology_Film%vin%c("N/A") | Morphology_Film%vin%("Present")
#> 124 Morphology_Foam <=1 | Morphology_Foam%vin%c("N/A") | Morphology_Foam%vin%("Present")
#> 125 Morphology_Sphere <=1 | Morphology_Sphere%vin%c("N/A") | Morphology_Sphere%vin%("Present")
#> 126 Morphology_Line <=1 | Morphology_Line%vin%c("N/A") | Morphology_Line%vin%("Present")
#> 127 Morphology_Bead <=1 | Morphology_Bead%vin%c("N/A") | Morphology_Bead%vin%("Present")
#> 128 Morphology_Sheet <=1 | Morphology_Sheet%vin%c("N/A") | Morphology_Sheet%vin%("Present")
#> 129 Morphology_Film_Fragment <=1 | Morphology_Film_Fragment%vin%c("N/A") | Morphology_Film_Fragment%vin%("Present")
#> 130 Morphology_Rubbery_Fragment <=1 | Morphology_Rubbery_Fragment%vin%c("N/A") | Morphology_Rubbery_Fragment%vin%("Present")
#> 131 Size_3000um <=1 | Size_3000um%vin%c("N/A") | Size_3000um%vin%("Present")
#> 132 Size_2_5mm <=1 | Size_2_5mm%vin%c("N/A") | Size_2_5mm%vin%("Present")
#> 133 Size_1_5mm <=1 | Size_1_5mm%vin%c("N/A") | Size_1_5mm%vin%("Present")
#> 134 Size_1_2mm <=1 | Size_1_2mm%vin%c("N/A") | Size_1_2mm%vin%("Present")
#> 135 Size_0.5_1mm <=1 | Size_0.5_1mm%vin%c("N/A") | Size_0.5_1mm%vin%("Present")
#> 136 Size_less_than_0.5mm <=1 | Size_less_than_0.5mm%vin%c("N/A") | Size_less_than_0.5mm%vin%("Present")
#> 137 Size_500um <=1 | Size_500um%vin%c("N/A") | Size_500um%vin%("Present")
#> 138 Size_300_500um <=1 | Size_300_500um%vin%c("N/A") | Size_300_500um%vin%("Present")
#> 139 Size_125_300um <=1 | Size_125_300um%vin%c("N/A") | Size_125_300um%vin%("Present")
#> 140 Size_100_500um <=1 | Size_100_500um%vin%c("N/A") | Size_100_500um%vin%("Present")
#> 141 Size_greater_than_100um <=1 | Size_greater_than_100um%vin%c("N/A") | Size_greater_than_100um%vin%("Present")
#> 142 Size_50_150um <=1 | Size_50_150um%vin%c("N/A") | Size_50_150um%vin%("Present")
#> 143 Size_50_100um <=1 | Size_50_100um%vin%c("N/A") | Size_50_100um%vin%("Present")
#> 144 Size_50um <=1 | Size_50um%vin%c("N/A") | Size_50um%vin%("Present")
#> 145 Size_45_125um <=1 | Size_45_125um%vin%c("N/A") | Size_45_125um%vin%("Present")
#> 146 Size_greater_than_25um <=1 | Size_greater_than_25um%vin%c("N/A") | Size_greater_than_25um%vin%("Present")
#> 147 Size_20um_5mm <=1 | Size_20um_5mm%vin%c("N/A") | Size_20um_5mm%vin%("Present")
#> 148 Size_20_100um <=1 | Size_20_100um%vin%c("N/A") | Size_20_100um%vin%("Present")
#> 149 Size_20_50um <=1 | Size_20_50um%vin%c("N/A") | Size_20_50um%vin%("Present")
#> 150 Size_10_50um <=1 | Size_10_50um%vin%c("N/A") | Size_10_50um%vin%("Present")
#> 151 Size_10_45um <=1 | Size_10_45um%vin%c("N/A") | Size_10_45um%vin%("Present")
#> 152 Size_10_20um <=1 | Size_10_20um%vin%c("N/A") | Size_10_20um%vin%("Present")
#> 153 Size_greater_than_10um <=1 | Size_greater_than_10um%vin%c("N/A") | Size_greater_than_10um%vin%("Present")
#> 154 Size_8_316um <=1 | Size_8_316um%vin%c("N/A") | Size_8_316um%vin%("Present")
#> 155 Size_5_100um <=1 | Size_5_100um%vin%c("N/A") | Size_5_100um%vin%("Present")
#> 156 Size_5_10um <=1 | Size_5_10um%vin%c("N/A") | Size_5_10um%vin%("Present")
#> 157 Size_4_10um <=1 | Size_4_10um%vin%c("N/A") | Size_4_10um%vin%("Present")
#> 158 Size_1.5_5um <=1 | Size_1.5_5um%vin%c("N/A") | Size_1.5_5um%vin%("Present")
#> 159 Size_less_than_1.5um <=1 | Size_less_than_1.5um%vin%c("N/A") | Size_less_than_1.5um%vin%("Present")
#> 160 Size_1_100um <=1 | Size_1_100um%vin%c("N/A") | Size_1_100um%vin%("Present")
#> 161 Size_1_50um <=1 | Size_1_50um%vin%c("N/A") | Size_1_50um%vin%("Present")
#> 162 Size_1_10um <=1 | Size_1_10um%vin%c("N/A") | Size_1_10um%vin%("Present")
#> 163 Size_1_5um <=1 | Size_1_5um%vin%c("N/A") | Size_1_5um%vin%("Present")
#> 164 Size_110_124nm <=1 | Size_110_124nm%vin%c("N/A") | Size_110_124nm%vin%("Present")
#> 165 Size_0_20um <=1 | Size_0_20um%vin%c("N/A") | Size_0_20um%vin%("Present")