cross_series.Rd
This function crosses two (l,z) series and provides a tibble regarding all points of interest (observations, intersections, interpolations)
cross_series(s1, s2, h = NA)
s1 | tibble with columns l and z describing first profile |
---|---|
s2 | tibble with columns l and z describing second profile |
h | if provided by user, the second profile is supposed to be horizontal, with constant height=h (defaults to NA) |
a tibble providing info on all points of interest in the crossing of the two series.
s1 <- tibble::tibble(l=c(1,3,5,6,9), z=c(1,2,3,2.5,5)) s2 <- tibble::tibble(l=c(0.5,2.5,4,6,8), z=c(3,1,2,4,3)) cross_series(s1,s2)#> # A tibble: 21 x 7 #> l l_obs z_obs p series z1 z2 #> <dbl> <dbl> <dbl> <chr> <chr> <dbl> <dbl> #> 1 0.5 0.5 3 observed s2 NA 3 #> 2 1 1 1 observed s1 1 2.5 #> 3 1 NA NA interpolated s2 1 2.5 #> 4 2 NA NA intersect NA 1.5 1.5 #> 5 2.5 NA NA interpolated s1 1.75 1 #> 6 2.5 2.5 1 observed s2 1.75 1 #> 7 3 3 2 observed s1 2 1.33 #> 8 3 NA NA interpolated s2 2 1.33 #> 9 4 NA NA interpolated s1 2.5 2 #> 10 4 4 2 observed s2 2.5 2 #> # … with 11 more rowscross_series(s1,h=2)#> # A tibble: 13 x 7 #> l l_obs z_obs p series z1 z2 #> <dbl> <dbl> <dbl> <chr> <chr> <dbl> <dbl> #> 1 1 1 1 observed s1 1 2 #> 2 1 1 2 observed s2 1 2 #> 3 3 3 2 observed s1 2 2 #> 4 3 NA NA interpolated s2 2 2 #> 5 3 NA NA intersect NA 2 2 #> 6 3 NA NA intersect NA 2 2 #> 7 5 5 3 observed s1 3 2 #> 8 5 NA NA interpolated s2 3 2 #> 9 6 6 2.5 observed s1 2.5 2 #> 10 6 NA NA interpolated s2 2.5 2 #> 11 9 9 5 observed s1 5 2 #> 12 9 9 2 observed s2 5 2 #> 13 NaN NA NA intersect NA NaN NaN