cart2pol: Transformation from Cartesian to polar coordinates

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/beadarrayMSV.R

Description

Cartesian coordiantes are transformed to polar coordinates using a specified distance measure

Usage

1
cart2pol(x, y, dist = "euclidean", pNorm = NULL)

Arguments

x

Cartesian abscissa value

y

Cartesian ordinate value

dist

One of “manhattan”, “euclidean” (default), or “minkowski”, defining which distance measure to use

pNorm

The exponent “p” in the p-norm (Minkowski) distance

Details

The Manhattan distance is the special case of the Minkowski distance of norm 1, the Euclidean distance equals the Minkowski distance of norm 2. The unit circle of the Minkowski distance changes from a diamond shape (1-norm), through an Euclidean circle (2-norm), to a square (infinity-norm) as pNorm increases from 1 to infinity. Any norm between 2 and infinity results in a unit circle resembling a square with more or less rounded corners.

For non-transformed signal, the 1-norm is the most accurate representation, however a higher norm is called for after root- or log-transformations.

Value

A list holding the polar coordinates

r

Signal intensity

th

Polar angle

Author(s)

Lars Gidskehaug

See Also

preprocessBeadSet, setNormOptions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Points defining a 4-norm unit-circle in the first quadrant
x <- seq(0,1,.01)^(1/4)
y <- (1-x^4)^(1/4)

## Polar coordinates using different distance-measures
eucl <- cart2pol(x,y)
mink <- cart2pol(x,y,'minkowski',4)

## Not run: 
## Plot in cartesian coordinates
dev.new()
plot(x,y,type='b',main='4-norm unit circle')

## Plot polar coordinates on cartesian axes
dev.new()
plot(eucl$th,eucl$r,type='b',col='red',xlab='theta',ylab='r')
points(mink$th,mink$r,type='b',col='blue')
title(main='Euclidean (red) and 4-norm (blue) distance')
## End(Not run)

Example output

Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: geneplotter
Loading required package: lattice
Loading required package: annotate
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: XML
R session is headless; GTK+ not initialized.
dev.new(): using pdf(file="Rplots1.pdf")

beadarrayMSV documentation built on May 1, 2019, 6:33 p.m.