Skip to contents

Remove one or more views from the view composition.

Usage

remove_views(current.views, view.names)

Arguments

current.views

the current view composition.

view.names

the names of one or more views to be removed.

Value

A mistyR view composition with view.names views removed.

Details

The intraview and the unique id cannot be removed with this function.

See also

Other view composition functions: add_juxtaview(), add_paraview(), add_views(), create_initial_view(), create_view()

Examples

library(dplyr)

# get the expression data
data("synthetic")
expr <- synthetic[[1]] %>% select(-c(row, col, type))
# get the coordinates for each cell
pos <- synthetic[[1]] %>% select(row, col)

# compose
misty.views <- create_initial_view(expr) %>%
  add_juxtaview(pos, neighbor.thr = 1.5) %>%
  add_paraview(pos, l = 10)
#> 
#> Computing triangulation
#> 
#> Generating juxtaview
#> 
#> Generating paraview

# preview
str(misty.views)
#> List of 4
#>  $ intraview     :List of 2
#>   ..$ abbrev: chr "intra"
#>   ..$ data  : tibble [4,205 × 11] (S3: tbl_df/tbl/data.frame)
#>   .. ..$ ECM  : num [1:4205] 0.0385 0.0327 0.1444 0.387 0.1635 ...
#>   .. ..$ ligA : num [1:4205] 0.834 0.119 0.525 0.269 0.195 ...
#>   .. ..$ ligB : num [1:4205] 0.0157 0.0104 0.014 0.0367 0.1176 ...
#>   .. ..$ ligC : num [1:4205] 0.236 0.804 0.334 0.502 0.232 ...
#>   .. ..$ ligD : num [1:4205] 1.183 0.101 0.434 0.241 0.203 ...
#>   .. ..$ protE: num [1:4205] 1.18 0 1.67 0 0 ...
#>   .. ..$ protF: num [1:4205] 2.547 0.386 1.614 0.913 0.162 ...
#>   .. ..$ prodA: num [1:4205] 0.382 0 0.472 0 0 ...
#>   .. ..$ prodB: num [1:4205] 0 0 0 0 0.16 ...
#>   .. ..$ prodC: num [1:4205] 0 0.536 0 0.418 0 ...
#>   .. ..$ prodD: num [1:4205] 0.588 0 0.379 0 0 ...
#>  $ misty.uniqueid: chr "b98ad35f4e671871cba35f2155228612"
#>  $ juxtaview.1.5 :List of 2
#>   ..$ abbrev: chr "juxta.1.5"
#>   ..$ data  :'data.frame':	4205 obs. of  11 variables:
#>   .. ..$ ECM  : num [1:4205] 0.116 0.105 1.395 1.315 1.395 ...
#>   .. ..$ ligA : num [1:4205] 1.3988 0.0653 0.5141 0.965 0.5141 ...
#>   .. ..$ ligB : num [1:4205] 0.0394 0.0188 0.0629 0.1578 0.0629 ...
#>   .. ..$ ligC : num [1:4205] 0.53 0.856 0.825 0.89 0.825 ...
#>   .. ..$ ligD : num [1:4205] 1.9261 0.0577 0.4646 0.8604 0.4646 ...
#>   .. ..$ protE: num [1:4205] 0.779 0 1.617 3.286 1.617 ...
#>   .. ..$ protF: num [1:4205] 4.31 0.25 0.988 1.851 0.988 ...
#>   .. ..$ prodA: num [1:4205] 0.455 0 0 0.472 0 ...
#>   .. ..$ prodB: num [1:4205] 0 0 0 0.16 0 ...
#>   .. ..$ prodC: num [1:4205] 0.433 0.548 0.418 0 0.418 ...
#>   .. ..$ prodD: num [1:4205] 0.536 0 0 0.379 0 ...
#>  $ paraview.10   :List of 2
#>   ..$ abbrev: chr "para.10"
#>   ..$ data  :'data.frame':	4205 obs. of  11 variables:
#>   .. ..$ ECM  : num [1:4205] 6.98 15.05 17.37 18.4 19.93 ...
#>   .. ..$ ligA : num [1:4205] 13.2 12.9 13.6 14.3 14.7 ...
#>   .. ..$ ligB : num [1:4205] 1.29 2.31 2.78 3 3.16 ...
#>   .. ..$ ligC : num [1:4205] 9.56 18.52 20.42 20.97 21.99 ...
#>   .. ..$ ligD : num [1:4205] 17 15.1 16.1 16.9 17.5 ...
#>   .. ..$ protE: num [1:4205] 14 26.6 28.1 31.5 33.2 ...
#>   .. ..$ protF: num [1:4205] 28.1 27.7 29 30.9 32.7 ...
#>   .. ..$ prodA: num [1:4205] 4.37 5.24 5.04 5.61 5.69 ...
#>   .. ..$ prodB: num [1:4205] 0.816 1.659 1.948 2.093 2.076 ...
#>   .. ..$ prodC: num [1:4205] 3.87 7.29 8.23 8 8.61 ...
#>   .. ..$ prodD: num [1:4205] 5.64 6.01 5.98 6.51 6.64 ...

# remove juxtaview and preview
misty.views %>%
  remove_views("juxtaview.1.5") %>%
  str()
#> List of 3
#>  $ intraview     :List of 2
#>   ..$ abbrev: chr "intra"
#>   ..$ data  : tibble [4,205 × 11] (S3: tbl_df/tbl/data.frame)
#>   .. ..$ ECM  : num [1:4205] 0.0385 0.0327 0.1444 0.387 0.1635 ...
#>   .. ..$ ligA : num [1:4205] 0.834 0.119 0.525 0.269 0.195 ...
#>   .. ..$ ligB : num [1:4205] 0.0157 0.0104 0.014 0.0367 0.1176 ...
#>   .. ..$ ligC : num [1:4205] 0.236 0.804 0.334 0.502 0.232 ...
#>   .. ..$ ligD : num [1:4205] 1.183 0.101 0.434 0.241 0.203 ...
#>   .. ..$ protE: num [1:4205] 1.18 0 1.67 0 0 ...
#>   .. ..$ protF: num [1:4205] 2.547 0.386 1.614 0.913 0.162 ...
#>   .. ..$ prodA: num [1:4205] 0.382 0 0.472 0 0 ...
#>   .. ..$ prodB: num [1:4205] 0 0 0 0 0.16 ...
#>   .. ..$ prodC: num [1:4205] 0 0.536 0 0.418 0 ...
#>   .. ..$ prodD: num [1:4205] 0.588 0 0.379 0 0 ...
#>  $ misty.uniqueid: chr "b98ad35f4e671871cba35f2155228612"
#>  $ paraview.10   :List of 2
#>   ..$ abbrev: chr "para.10"
#>   ..$ data  :'data.frame':	4205 obs. of  11 variables:
#>   .. ..$ ECM  : num [1:4205] 6.98 15.05 17.37 18.4 19.93 ...
#>   .. ..$ ligA : num [1:4205] 13.2 12.9 13.6 14.3 14.7 ...
#>   .. ..$ ligB : num [1:4205] 1.29 2.31 2.78 3 3.16 ...
#>   .. ..$ ligC : num [1:4205] 9.56 18.52 20.42 20.97 21.99 ...
#>   .. ..$ ligD : num [1:4205] 17 15.1 16.1 16.9 17.5 ...
#>   .. ..$ protE: num [1:4205] 14 26.6 28.1 31.5 33.2 ...
#>   .. ..$ protF: num [1:4205] 28.1 27.7 29 30.9 32.7 ...
#>   .. ..$ prodA: num [1:4205] 4.37 5.24 5.04 5.61 5.69 ...
#>   .. ..$ prodB: num [1:4205] 0.816 1.659 1.948 2.093 2.076 ...
#>   .. ..$ prodC: num [1:4205] 3.87 7.29 8.23 8 8.61 ...
#>   .. ..$ prodD: num [1:4205] 5.64 6.01 5.98 6.51 6.64 ...

# remove juxtaview and paraview and preview
misty.views %>%
  remove_views(c("juxtaview.1.5", "paraview.10")) %>%
  str()
#> List of 2
#>  $ intraview     :List of 2
#>   ..$ abbrev: chr "intra"
#>   ..$ data  : tibble [4,205 × 11] (S3: tbl_df/tbl/data.frame)
#>   .. ..$ ECM  : num [1:4205] 0.0385 0.0327 0.1444 0.387 0.1635 ...
#>   .. ..$ ligA : num [1:4205] 0.834 0.119 0.525 0.269 0.195 ...
#>   .. ..$ ligB : num [1:4205] 0.0157 0.0104 0.014 0.0367 0.1176 ...
#>   .. ..$ ligC : num [1:4205] 0.236 0.804 0.334 0.502 0.232 ...
#>   .. ..$ ligD : num [1:4205] 1.183 0.101 0.434 0.241 0.203 ...
#>   .. ..$ protE: num [1:4205] 1.18 0 1.67 0 0 ...
#>   .. ..$ protF: num [1:4205] 2.547 0.386 1.614 0.913 0.162 ...
#>   .. ..$ prodA: num [1:4205] 0.382 0 0.472 0 0 ...
#>   .. ..$ prodB: num [1:4205] 0 0 0 0 0.16 ...
#>   .. ..$ prodC: num [1:4205] 0 0.536 0 0.418 0 ...
#>   .. ..$ prodD: num [1:4205] 0.588 0 0.379 0 0 ...
#>  $ misty.uniqueid: chr "b98ad35f4e671871cba35f2155228612"