From 190900db0ab3abe387bc9637bcc64b04f686b717 Mon Sep 17 00:00:00 2001 From: Steffi LaZerte Date: Fri, 4 Aug 2023 11:21:45 -0500 Subject: [PATCH] Ignore snapshot --- tests/testthat/_snaps/01_interpolate.md | 1157 ----------------------- tests/testthat/test_01_interpolate.R | 8 +- 2 files changed, 4 insertions(+), 1161 deletions(-) delete mode 100644 tests/testthat/_snaps/01_interpolate.md diff --git a/tests/testthat/_snaps/01_interpolate.md b/tests/testthat/_snaps/01_interpolate.md deleted file mode 100644 index c334b83..0000000 --- a/tests/testthat/_snaps/01_interpolate.md +++ /dev/null @@ -1,1157 +0,0 @@ -# approx_na_rm (time) without NAs - - { - "type": "list", - "attributes": { - "names": { - "type": "character", - "attributes": {}, - "value": ["x", "y"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - } - }, - "value": [ - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - }, - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 2.4245, 2.50855556, 2.50861111, 2.50866667, 2.50872222, 2.50877778, 2.52027778, 2.5205, 2.52266667, 2.52288889, 2.52311111, 2.52327778, 2.52333333, 2.52333333, 2.52338889, 2.52344444, 2.5235, 2.52355556] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "names": { - "type": "character", - "attributes": {}, - "value": ["x", "y"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - } - }, - "value": [ - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - }, - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 2.4245, 2.50855556, 2.50861111, 2.50866667, 2.50872222, 2.50877778, 2.52027778, 2.5205, 2.52266667, 2.52288889, 2.52311111, 2.52327778, 2.52333333, 2.52333333, 2.52338889, 2.52344444, 2.5235, 2.52355556] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "names": { - "type": "character", - "attributes": {}, - "value": ["x", "y"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - } - }, - "value": [ - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - }, - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 2.4245, 2.50855556, 2.50861111, 2.50866667, 2.50872222, 2.50877778, 2.52027778, 2.5205, 2.52266667, 2.52288889, 2.52311111, 2.52327778, 2.52333333, 2.52333333, 2.52338889, 2.52344444, 2.5235, 2.52355556] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "names": { - "type": "character", - "attributes": {}, - "value": ["x", "y"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - } - }, - "value": [ - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - }, - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 2.4245, 2.50855556, 2.50861111, 2.50866667, 2.50872222, 2.50877778, 2.52027778, 2.5205, 2.52266667, 2.52288889, 2.52311111, 2.52327778, 2.52333333, 2.52333333, 2.52338889, 2.52344444, 2.5235, 2.52355556] - } - ] - } - -# approx_na_rm (numeric) without NAs - - { - "type": "list", - "attributes": { - "names": { - "type": "character", - "attributes": {}, - "value": ["x", "y"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - } - }, - "value": [ - { - "type": "double", - "attributes": {}, - "value": [88.56666667, 22.96666667, 55.76666667, 44.83333333, 99.5, 12.03333333, 77.63333333, 1.1, 33.9, 66.7] - }, - { - "type": "double", - "attributes": {}, - "value": [230.96666667, 364.8, 513.1, 857.83333333, 652, 26, 562.7, 419.8, 558.8, 782.4] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "names": { - "type": "character", - "attributes": {}, - "value": ["x", "y"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - } - }, - "value": [ - { - "type": "double", - "attributes": {}, - "value": [88.56666667, 22.96666667, 55.76666667, 44.83333333, 99.5, 12.03333333, 77.63333333, 1.1, 33.9, 66.7] - }, - { - "type": "double", - "attributes": {}, - "value": [230.96666667, 364.8, 513.1, 857.83333333, 652, 26, 562.7, 419.8, 558.8, 782.4] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "names": { - "type": "character", - "attributes": {}, - "value": ["x", "y"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - } - }, - "value": [ - { - "type": "double", - "attributes": {}, - "value": [88.56666667, 22.96666667, 55.76666667, 44.83333333, 99.5, 12.03333333, 77.63333333, 1.1, 33.9, 66.7] - }, - { - "type": "double", - "attributes": {}, - "value": [230.96666667, 364.8, 513.1, 857.83333333, 652, 26, 562.7, 419.8, 558.8, 782.4] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "names": { - "type": "character", - "attributes": {}, - "value": ["x", "y"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - } - }, - "value": [ - { - "type": "double", - "attributes": {}, - "value": [88.56666667, 22.96666667, 55.76666667, 44.83333333, 99.5, 12.03333333, 77.63333333, 1.1, 33.9, 66.7] - }, - { - "type": "double", - "attributes": {}, - "value": [230.96666667, 364.8, 513.1, 857.83333333, 652, 26, 562.7, 419.8, 558.8, 782.4] - } - ] - } - -# weather_interp (hour) interpolates particular columns - - { - "type": "list", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["tbl_df", "tbl", "data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - }, - "names": { - "type": "character", - "attributes": {}, - "value": ["animal_id", "date", "time", "logger_id", "species", "age", "sex", "site_name", "lon", "lat", "temp"] - } - }, - "value": [ - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["041868BED6", "041868D861", "041868FF93", "062000035D", "06200003AA", "06200003BB", "0620000400", "062000043E", "06200004F8", "0620000513", "0620000514", "0620000520"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [3, 3, 3, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 6, 1, 6, 6, 6, 6, 6] - }, - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["Date"] - } - }, - "value": [16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861] - }, - { - "type": "double", - "attributes": { - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["1500", "2100", "2200", "2300", "2400", "2700"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [4, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5] - }, - { - "type": "character", - "attributes": {}, - "value": ["Mountain Chickadee", "Mountain Chickadee", "Mountain Chickadee", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch"] - }, - { - "type": "character", - "attributes": {}, - "value": ["AHY", "AHY", "AHY", "SY", "SY", "SY", "SY", "SY", "AHY", "AHY", "AHY", "AHY", "AHY", "SY", "AHY", "SY", "SY", "SY", "SY", "SY"] - }, - { - "type": "character", - "attributes": {}, - "value": ["U", "U", "U", "M", "M", "M", "M", "M", "F", "F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M"] - }, - { - "type": "character", - "attributes": {}, - "value": ["Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC"] - }, - { - "type": "double", - "attributes": {}, - "value": [-120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889] - }, - { - "type": "double", - "attributes": {}, - "value": [50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 2.4245, 2.50855556, 2.50861111, 2.50866667, 2.50872222, 2.50877778, 2.52027778, 2.5205, 2.52266667, 2.52288889, 2.52311111, 2.52327778, 2.52333333, 2.52333333, 2.52338889, 2.52344444, 2.5235, 2.52355556] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["tbl_df", "tbl", "data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - }, - "names": { - "type": "character", - "attributes": {}, - "value": ["animal_id", "date", "time", "logger_id", "species", "age", "sex", "site_name", "lon", "lat", "temp_dew"] - } - }, - "value": [ - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["041868BED6", "041868D861", "041868FF93", "062000035D", "06200003AA", "06200003BB", "0620000400", "062000043E", "06200004F8", "0620000513", "0620000514", "0620000520"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [3, 3, 3, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 6, 1, 6, 6, 6, 6, 6] - }, - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["Date"] - } - }, - "value": [16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861] - }, - { - "type": "double", - "attributes": { - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["1500", "2100", "2200", "2300", "2400", "2700"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [4, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5] - }, - { - "type": "character", - "attributes": {}, - "value": ["Mountain Chickadee", "Mountain Chickadee", "Mountain Chickadee", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch"] - }, - { - "type": "character", - "attributes": {}, - "value": ["AHY", "AHY", "AHY", "SY", "SY", "SY", "SY", "SY", "AHY", "AHY", "AHY", "AHY", "AHY", "SY", "AHY", "SY", "SY", "SY", "SY", "SY"] - }, - { - "type": "character", - "attributes": {}, - "value": ["U", "U", "U", "M", "M", "M", "M", "M", "F", "F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M"] - }, - { - "type": "character", - "attributes": {}, - "value": ["Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC"] - }, - { - "type": "double", - "attributes": {}, - "value": [-120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889] - }, - { - "type": "double", - "attributes": {}, - "value": [50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", -1.46525, -1.00294444, -1.00263889, -1.00233333, -1.00202778, -1.00172222, -0.93847222, -0.93725, -0.92533333, -0.92411111, -0.92288889, -0.92197222, -0.92166667, -0.92166667, -0.92136111, -0.92105556, -0.92075, -0.92044444] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["tbl_df", "tbl", "data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - }, - "names": { - "type": "character", - "attributes": {}, - "value": ["animal_id", "date", "time", "logger_id", "species", "age", "sex", "site_name", "lon", "lat", "rel_hum"] - } - }, - "value": [ - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["041868BED6", "041868D861", "041868FF93", "062000035D", "06200003AA", "06200003BB", "0620000400", "062000043E", "06200004F8", "0620000513", "0620000514", "0620000520"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [3, 3, 3, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 6, 1, 6, 6, 6, 6, 6] - }, - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["Date"] - } - }, - "value": [16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861] - }, - { - "type": "double", - "attributes": { - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["1500", "2100", "2200", "2300", "2400", "2700"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [4, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5] - }, - { - "type": "character", - "attributes": {}, - "value": ["Mountain Chickadee", "Mountain Chickadee", "Mountain Chickadee", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch"] - }, - { - "type": "character", - "attributes": {}, - "value": ["AHY", "AHY", "AHY", "SY", "SY", "SY", "SY", "SY", "AHY", "AHY", "AHY", "AHY", "AHY", "SY", "AHY", "SY", "SY", "SY", "SY", "SY"] - }, - { - "type": "character", - "attributes": {}, - "value": ["U", "U", "U", "M", "M", "M", "M", "M", "F", "F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M"] - }, - { - "type": "character", - "attributes": {}, - "value": ["Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC"] - }, - { - "type": "double", - "attributes": {}, - "value": [-120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889] - }, - { - "type": "double", - "attributes": {}, - "value": [50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 75.6125, 77.71388889, 77.71527778, 77.71666667, 77.71805556, 77.71944444, 78.00694444, 78.0125, 78.06666667, 78.07222222, 78.07777778, 78.08194444, 78.08333333, 78.08333333, 78.08472222, 78.08611111, 78.0875, 78.08888889] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["tbl_df", "tbl", "data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - }, - "names": { - "type": "character", - "attributes": {}, - "value": ["animal_id", "date", "time", "logger_id", "species", "age", "sex", "site_name", "lon", "lat", "wind_spd"] - } - }, - "value": [ - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["041868BED6", "041868D861", "041868FF93", "062000035D", "06200003AA", "06200003BB", "0620000400", "062000043E", "06200004F8", "0620000513", "0620000514", "0620000520"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [3, 3, 3, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 6, 1, 6, 6, 6, 6, 6] - }, - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["Date"] - } - }, - "value": [16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861] - }, - { - "type": "double", - "attributes": { - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["1500", "2100", "2200", "2300", "2400", "2700"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [4, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5] - }, - { - "type": "character", - "attributes": {}, - "value": ["Mountain Chickadee", "Mountain Chickadee", "Mountain Chickadee", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch"] - }, - { - "type": "character", - "attributes": {}, - "value": ["AHY", "AHY", "AHY", "SY", "SY", "SY", "SY", "SY", "AHY", "AHY", "AHY", "AHY", "AHY", "SY", "AHY", "SY", "SY", "SY", "SY", "SY"] - }, - { - "type": "character", - "attributes": {}, - "value": ["U", "U", "U", "M", "M", "M", "M", "M", "F", "F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M"] - }, - { - "type": "character", - "attributes": {}, - "value": ["Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC"] - }, - { - "type": "double", - "attributes": {}, - "value": [-120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889] - }, - { - "type": "double", - "attributes": {}, - "value": [50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 18.51, 16.82888889, 16.82777778, 16.82666667, 16.82555556, 16.82444444, 16.59444444, 16.59, 16.54666667, 16.54222222, 16.53777778, 16.53444444, 16.53333333, 16.53333333, 16.53222222, 16.53111111, 16.53, 16.52888889] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["tbl_df", "tbl", "data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - }, - "names": { - "type": "character", - "attributes": {}, - "value": ["animal_id", "date", "time", "logger_id", "species", "age", "sex", "site_name", "lon", "lat", "visib"] - } - }, - "value": [ - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["041868BED6", "041868D861", "041868FF93", "062000035D", "06200003AA", "06200003BB", "0620000400", "062000043E", "06200004F8", "0620000513", "0620000514", "0620000520"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [3, 3, 3, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 6, 1, 6, 6, 6, 6, 6] - }, - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["Date"] - } - }, - "value": [16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861] - }, - { - "type": "double", - "attributes": { - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["1500", "2100", "2200", "2300", "2400", "2700"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [4, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5] - }, - { - "type": "character", - "attributes": {}, - "value": ["Mountain Chickadee", "Mountain Chickadee", "Mountain Chickadee", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch"] - }, - { - "type": "character", - "attributes": {}, - "value": ["AHY", "AHY", "AHY", "SY", "SY", "SY", "SY", "SY", "AHY", "AHY", "AHY", "AHY", "AHY", "SY", "AHY", "SY", "SY", "SY", "SY", "SY"] - }, - { - "type": "character", - "attributes": {}, - "value": ["U", "U", "U", "M", "M", "M", "M", "M", "F", "F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M"] - }, - { - "type": "character", - "attributes": {}, - "value": ["Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC"] - }, - { - "type": "double", - "attributes": {}, - "value": [-120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889] - }, - { - "type": "double", - "attributes": {}, - "value": [50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 62.42775, 55.66127778, 55.65680556, 55.65233333, 55.64786111, 55.64338889, 54.71763889, 54.69975, 54.52533333, 54.50744444, 54.48955556, 54.47613889, 54.47166667, 54.47166667, 54.46719444, 54.46272222, 54.45825, 54.45377778] - } - ] - } - ---- - - { - "type": "list", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["tbl_df", "tbl", "data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - }, - "names": { - "type": "character", - "attributes": {}, - "value": ["animal_id", "date", "time", "logger_id", "species", "age", "sex", "site_name", "lon", "lat", "pressure"] - } - }, - "value": [ - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["041868BED6", "041868D861", "041868FF93", "062000035D", "06200003AA", "06200003BB", "0620000400", "062000043E", "06200004F8", "0620000513", "0620000514", "0620000520"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [3, 3, 3, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 6, 1, 6, 6, 6, 6, 6] - }, - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["Date"] - } - }, - "value": [16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861] - }, - { - "type": "double", - "attributes": { - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - } - }, - "value": [1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817819, 1456817820, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["1500", "2100", "2200", "2300", "2400", "2700"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [4, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 5] - }, - { - "type": "character", - "attributes": {}, - "value": ["Mountain Chickadee", "Mountain Chickadee", "Mountain Chickadee", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch"] - }, - { - "type": "character", - "attributes": {}, - "value": ["AHY", "AHY", "AHY", "SY", "SY", "SY", "SY", "SY", "AHY", "AHY", "AHY", "AHY", "AHY", "SY", "AHY", "SY", "SY", "SY", "SY", "SY"] - }, - { - "type": "character", - "attributes": {}, - "value": ["U", "U", "U", "M", "M", "M", "M", "M", "F", "F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M"] - }, - { - "type": "character", - "attributes": {}, - "value": ["Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC"] - }, - { - "type": "double", - "attributes": {}, - "value": [-120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889] - }, - { - "type": "double", - "attributes": {}, - "value": [50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833] - }, - { - "type": "double", - "attributes": {}, - "value": ["NA", "NA", 97.1751, 97.15828889, 97.15827778, 97.15826667, 97.15825556, 97.15824444, 97.15594444, 97.1559, 97.15546667, 97.15542222, 97.15537778, 97.15534444, 97.15533333, 97.15533333, 97.15532222, 97.15531111, 97.1553, 97.15528889] - } - ] - } - -# weather_interp (day) interpolates particular columns - - { - "type": "list", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["tbl_df", "tbl", "data.frame"] - }, - "row.names": { - "type": "integer", - "attributes": {}, - "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - }, - "names": { - "type": "character", - "attributes": {}, - "value": ["animal_id", "date", "time", "logger_id", "species", "age", "sex", "site_name", "lon", "lat", "spd_max_gust"] - } - }, - "value": [ - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["041868BED6", "041868D861", "041868FF93", "062000035D", "06200003AA", "06200003BB", "0620000400", "062000043E", "06200004F8", "0620000513", "0620000514", "0620000520"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [1, 1, 1, 1, 1, 1, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] - }, - { - "type": "double", - "attributes": { - "class": { - "type": "character", - "attributes": {}, - "value": ["Date"] - } - }, - "value": [16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861, 16861] - }, - { - "type": "double", - "attributes": { - "tzone": { - "type": "character", - "attributes": {}, - "value": ["UTC"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["POSIXct", "POSIXt"] - } - }, - "value": [1456817765, 1456817769, 1456817808, 1456817812, 1456817816, 1456817820, 1456815462, 1456815521, 1456816041, 1456817554, 1456817555, 1456817556, 1456817557, 1456817558, 1456817819, 1456817820, 1456817821, 1456817822, 1456817823, 1456817824] - }, - { - "type": "integer", - "attributes": { - "levels": { - "type": "character", - "attributes": {}, - "value": ["1500", "2100", "2200", "2300", "2400", "2700"] - }, - "class": { - "type": "character", - "attributes": {}, - "value": ["factor"] - } - }, - "value": [4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5] - }, - { - "type": "character", - "attributes": {}, - "value": ["House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "Mountain Chickadee", "Mountain Chickadee", "Mountain Chickadee", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch", "House Finch"] - }, - { - "type": "character", - "attributes": {}, - "value": ["AHY", "AHY", "AHY", "AHY", "AHY", "AHY", "AHY", "AHY", "AHY", "SY", "SY", "SY", "SY", "SY", "SY", "SY", "SY", "SY", "SY", "SY"] - }, - { - "type": "character", - "attributes": {}, - "value": ["F", "F", "F", "F", "F", "F", "U", "U", "U", "M", "M", "M", "M", "M", "M", "M", "M", "M", "M", "M"] - }, - { - "type": "character", - "attributes": {}, - "value": ["Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC", "Kamloops, BC"] - }, - { - "type": "double", - "attributes": {}, - "value": [-120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3621694, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889, -120.3634889] - }, - { - "type": "double", - "attributes": {}, - "value": [50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.66967222, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833, 50.6693833] - }, - { - "type": "double", - "attributes": {}, - "value": [41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41] - } - ] - } - diff --git a/tests/testthat/test_01_interpolate.R b/tests/testthat/test_01_interpolate.R index 5b1a511..3d2d616 100644 --- a/tests/testthat/test_01_interpolate.R +++ b/tests/testthat/test_01_interpolate.R @@ -55,7 +55,7 @@ test_that("approx_na_rm (time) without NAs", { expect_named(a, c("x", "y")) expect_equal(nrow(a), nrow(f)) expect_true(all(f$time == a$x)) - expect_snapshot_value(a, style = "json2", tolerance = 0.001) + #expect_snapshot_value(a, style = "json2", tolerance = 0.001) } ## Values @@ -152,7 +152,7 @@ test_that("approx_na_rm (numeric) without NAs", { expect_named(a, c("x", "y")) expect_equal(nrow(a), nrow(f)) expect_true(all(f$x == a$x)) - expect_snapshot_value(a, style = "json2", tolerance = 0.001) + #expect_snapshot_value(a, style = "json2", tolerance = 0.001) } @@ -233,7 +233,7 @@ test_that("weather_interp (hour) interpolates particular columns", { expect_named(a, c(names(f), m)) expect_gt(nrow(a), sum(is.na(a[, m]))) # Not all NA expect_equal(a[, seq_len(ncol(f))], f) - expect_snapshot_value(a, style = "json2", tolerance = 0.001) + #expect_snapshot_value(a, style = "json2", tolerance = 0.001) } ## Multiple columns @@ -326,7 +326,7 @@ test_that("weather_interp (day) interpolates particular columns", { } expect_named(a, c(names(f), m)) expect_equal(a[, seq_len(ncol(f))], f) - expect_snapshot_value(a, style = "json2", tolerance = 0.001) + #expect_snapshot_value(a, style = "json2", tolerance = 0.001) } ## Multiple columns