resolve_location function

Resolve short form location

Resolve short form location

Convert short form location format, a numeric or a string (e.g. "body [1]"), into its corresponding location object. Under the hood, we parse the short form location and call the corresponding function from the ph_location_* family. Note that short forms may not cover all function from the ph_location_* and offer less customization.

resolve_location(x)

Short forms

The following location short forms are implemented. The corresponding call of the function from the ph_location_* family is displayed on the right.

Short formDescriptionLocation function
"left"Keyword stringph_location_left()
"right"Keyword stringph_location_right()
"fullsize"Keyword stringph_location_fullsize()
"body [1]"String: type + index in brackets ( 1 if omitted)ph_location_type("body", 1)
"my_label"Any string not matching a keyword or typeph_location_label("my_label")
2Length 1 integerph_location_id(2)
c(0,0,4,5)Length 4 numeric, optionally named, c(top=0, left=0, ...)ph_location(0, 0, 4, 5)

Examples

resolve_location("left") resolve_location("right") resolve_location("fullsize") resolve_location("body") resolve_location("body [1]") resolve_location("<some label>") resolve_location(2) resolve_location(c(0, 0, 4, 5))