set_block: Set values in rectangular areas of a plate

Description Usage Arguments Value Author(s) See Also Examples

View source: R/set_block.R

Description

Updates a table representing a multiwell plate, by setting a given value for all wells in a block or a list of blocks defined by the well coordinates of their upper-left and bottom-right corners.

Usage

1
set_block(plate, block, what, value)

Arguments

plate

A table representing a multiwell plate, with one column named “well” representing the well identifiers.

block

Coordinates of a rectangular block (such as “A01~B02”), or a vector of coordinates.

what

A column name in the table.

value

The value to set.

Value

Returns the ‘plate’ table, where the values for the wells indicated in the blocks have been updated.

Author(s)

Charles Plessy

See Also

num_to_well

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
p <- data.frame(well = num_to_well(1:96))
head(p)

p <- set_block(p, c("A01~B02", "A05~D05"), "dNTP", 0.25)
p <- set_block(p,   "A03",                 "dNTP", 0.50)
head(p)

# Be careful with the column names
p <- set_block(p, "A01~H12", "Mg2+", 3.0)
head(p)

## Not run: 
# Chained updates with magrittr
p %<>%
  setBlock("A01~C04", "dNTP", 0.5) %>%
  setBlock("A01~C04", "Mg",   3.0)

## End(Not run)

platetools documentation built on June 3, 2021, 5:06 p.m.