mteb/BrightProStackoverflowRetrieval huggingface dataset:
[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ micropan  (version  1.0  ) ](/packages/micropan/versions/1.0)

#  plot.Panmat: Plotting and printing ` Panmat ` objects

##  Description

Generic functions for plotting and printing the content of a ` Panmat `
object.

##  Usage

    
    
    "plot"(x, col="black", xlab="Number of genomes", ylab="Number of clusters", ...)
    "summary"(object, ...)
    "str"(object, ...)

##  Arguments

x

A ` Panmat ` object, see below.

object

A ` Panmat ` object, see below.

col

The color, default is  "black"  , of interior and borders of the bars in the
barplot.

xlab

The label of the X axis.

ylab

The label of the Y axis.

...

Optional (graphical) arguments.

##  Details

A ` Panmat ` object contains a pan-matrix, which is the fundamental data
structure for pan-genome analyses. It is a small (S3) extension to a ` matrix
` . It has one row for each genome in the study, and one column for each gene
cluster. The number in cell  [i,j]  is the number of sequences in genome  i
that belongs to cluster  j  . A ` Panmat ` object is typically created by the
function ` [ panMatrix ](/link/panMatrix?package=micropan&version=1.0) ` . The
` [ plot.Panmat ](/link/plot.Panmat?package=micropan&version=1.0) ` function
will display the content of the ` Panmat ` object as a bar chart showing the
number of clusters found in 1,2,...,G genomes, where G is the total number of
genomes in the study (rows in  Panmat  ). The ` [ summary.Panmat
](/link/summary.Panmat?package=micropan&version=1.0) ` function will display a
text giving the same information as ` [ plot.Panmat
](/link/plot.Panmat?package=micropan&version=1.0) ` . The ` [ str.Panmat
](/link/str.Panmat?package=micropan&version=1.0) ` function will simply print
the dimensions of the ` Panmat ` object.

##  See Also

` [ panMatrix ](/link/panMatrix?package=micropan&version=1.0) ` .

##  Examples

[ Run this code
](https://www.datacamp.com/datalab/preview?_tag=rdocs&rdocsPath=packages%2Fmicropan%2Fversions%2F1.0%2Ftopics%2Fplot.Panmat&utm_source=r-docs&utm_medium=docs&utm_term=plot.Panmat&utm_content=run_example_in_datalab)

    
    
    # Loading clustering data in the micropan package
    data(list="Mpneumoniae.blast.clustering",package="micropan")
    panmat.blast <- panMatrix(Mpneumoniae.blast.clustering)
    
    # Plotting and printing the Panmat object
    plot(panmat.blast)
    summary(panmat.blast)
    str(panmat.blast)
    

Run the code above in your browser using  [ DataLab
](https://www.datacamp.com/datalab/preview?_tag=rdocs&rdocsPath=packages%2Fmicropan%2Fversions%2F1.0%2Ftopics%2Fplot.Panmat&utm_source=r-docs&utm_medium=docs&utm_term=plot.Panmat&utm_content=run_example_in_datalab)

Powered by  [ DataCamp ](https://www.datacamp.com/)
[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  data.matrix: Convert a Data Frame to a Numeric Matrix

##  Description

Return the matrix obtained by converting all the variables in a data frame to
numeric mode and then binding them together as the columns of a matrix.
Factors and ordered factors are replaced by their internal codes.

##  Usage

    
    
    data.matrix(frame, rownames.force = NA)

##  Arguments

frame

a data frame whose components are logical vectors, factors or numeric vectors.

rownames.force

logical indicating if the resulting matrix should have character (rather than
` NULL ` ) ` [ rownames ](/link/rownames?package=base&version=3.6.2) ` . The
default, ` NA ` , uses ` NULL ` rownames if the data frame has ‘automatic’
row.names or for a zero-row data frame.

##  Value

If ` frame ` inherits from class ` "data.frame" ` , an integer or numeric
matrix of the same dimensions as ` frame ` , with dimnames taken from the `
row.names ` (or ` NULL ` , depending on ` rownames.force ` ) and ` names ` .

Otherwise, the result of ` [ as.matrix
](/link/as.matrix?package=base&version=3.6.2) ` .

##  Details

Logical and factor columns are converted to integers. Any other column which
is not numeric (according to ` [ is.numeric
](/link/is.numeric?package=base&version=3.6.2) ` ) is converted by ` [
as.numeric ](/link/as.numeric?package=base&version=3.6.2) ` or, for S4
objects, ` [ as ](/link/as?package=base&version=3.6.2) (, "numeric") ` . If
all columns are integer (after conversion) the result is an integer matrix,
otherwise a numeric (double) matrix.

##  References

Chambers, J. M. (1992) _Data for models._ Chapter 3 of _Statistical Models in
S_ eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.

##  See Also

` [ as.matrix ](/link/as.matrix?package=base&version=3.6.2) ` , ` [ data.frame
](/link/data.frame?package=base&version=3.6.2) ` , ` [ matrix
](/link/matrix?package=base&version=3.6.2) ` .

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fdata.matrix&utm_source=r-docs&utm_medium=docs&utm_term=data.matrix&utm_content=run_example_in_workspace)

    
    
    # NOT RUN {
    DF <- data.frame(a = 1:3, b = letters[10:12],
                     c = seq(as.Date("2004-01-01"), by = "week", len = 3),
                     stringsAsFactors = TRUE)
    data.matrix(DF[1:2])
    data.matrix(DF)
    # }
    

Run the code above in your browser using  [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fdata.matrix&utm_source=r-docs&utm_medium=docs&utm_term=data.matrix&utm_content=run_example_in_workspace)

Powered by  [ DataCamp ](https://www.datacamp.com/)
[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ micropan  (version  1.0  ) ](/packages/micropan/versions/1.0)

#  entrezDownload: Downloading genome data

##  Description

Retrieving genomes from NCBI using the Entrez programming utilities.

##  Usage

    
    
    entrezDownload(accession,out.file,verbose=TRUE)

##  Arguments

accession

A character vector containing a set of valid accession numbers at the NCBI
Nucleotide database.

out.file

Name of the file where downloaded sequences should be written in FASTA format.

verbose

Logical indicating if textual output should be given during execution, to
monitor the download progress.

##  Value

The name of the resulting FASTA file is returned (same as ` file ` ), but the
real result of this function is the creation of the file itself.

##  Details

The Entrez programming utilities is a toolset for automatic download of data
from the NCBI databases, see [ E-utilities Quick Start
](http://www.ncbi.nlm.nih.gov/books/NBK25500/) for details. ` [ entrezDownload
](/link/entrezDownload?package=micropan&version=1.0) ` can be used to download
genomes from the NCBI Nucleotide database through these utilities.

The argument  accession  must be a set of valid accession numbers at NCBI
Nucleotide, typically all accession numbers related to a genome (chromosomes,
plasmids, contigs, etc). For completed genomes, where the number of sequences
is low,  accession  is typically a single text listing all accession numbers
separated by commas. In the case of some draft genomes having a large number
of contigs, the accession numbers must be split into several comma-separated
texts. The reason for this is that Entrez will not accept too many queries in
one chunk (less than 500).

The downloaded sequences are saved in  file  on your system. This will be a
FASTA formatted file, and should by convention have the filename extension
.fsa  . Note that all downloaded sequences end up in this file. If you want to
download multiple genomes, you call ` [ entrezDownload
](/link/entrezDownload?package=micropan&version=1.0) ` multiple times.

##  See Also

` [ getAccessions ](/link/getAccessions?package=micropan&version=1.0) ` , ` [
readFasta ](/link/readFasta?package=micropan&version=1.0) ` .

##  Examples

[ Run this code
](https://www.datacamp.com/datalab/preview?_tag=rdocs&rdocsPath=packages%2Fmicropan%2Fversions%2F1.0%2Ftopics%2FentrezDownload&utm_source=r-docs&utm_medium=docs&utm_term=entrezDownload&utm_content=run_example_in_datalab)

    
    
    # Accession numbers for the chromosome and plasmid of Buchnera aphidicola, strain APS
    entrezDownload( accession="BA000003.2,AP001071.1", out.file="Buchnera_aphidicola_APS.fsa" )
    

Run the code above in your browser using  [ DataLab
](https://www.datacamp.com/datalab/preview?_tag=rdocs&rdocsPath=packages%2Fmicropan%2Fversions%2F1.0%2Ftopics%2FentrezDownload&utm_source=r-docs&utm_medium=docs&utm_term=entrezDownload&utm_content=run_example_in_datalab)

Powered by  [ DataCamp ](https://www.datacamp.com/)
[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  pushBack: Push Text Back on to a Connection

##  Description

Functions to push back text lines onto a [ connection
](/link/connection?package=base&version=3.6.2) , and to enquire how many lines
are currently pushed back.

##  Usage

    
    
    pushBack(data, connection, newLine = TRUE,
             encoding = c("", "bytes", "UTF-8"))
    pushBackLength(connection)
    clearPushBack(connection)

##  Arguments

data

a character vector.

connection

A [ connection ](/link/connection?package=base&version=3.6.2) .

newLine

logical. If true, a newline is appended to each string pushed back.

encoding

character string, partially matched. See details.

##  Value

` pushBack ` and ` clearPushBack() ` return nothing, invisibly.

` pushBackLength ` returns the number of lines currently pushed back.

##  Details

Several character strings can be pushed back on one or more occasions. The
occasions form a stack, so the first line to be retrieved will be the first
string from the last call to ` pushBack ` . Lines which are pushed back are
read prior to the normal input from the connection, by the normal text-reading
functions such as ` [ readLines ](/link/readLines?package=base&version=3.6.2)
` and ` [ scan ](/link/scan?package=base&version=3.6.2) ` .

Pushback is only allowed for readable connections in text mode.

Not all uses of connections respect pushbacks, in particular the input
connection is still wired directly, so for example parsing commands from the
console and ` [ scan ](/link/scan?package=base&version=3.6.2) ("") ` ignore
pushbacks on ` [ stdin ](/link/stdin?package=base&version=3.6.2) ` .

When character strings with a marked encoding (see ` [ Encoding
](/link/Encoding?package=base&version=3.6.2) ` ) are pushed back they are
converted to the current encoding if ` encoding = "" ` . This may involve
representing characters as  <U+xxxx> if they cannot be converted. They will be
converted to UTF-8 if ` encoding = "UTF-8" ` or left as-is if ` encoding =
"bytes" ` .

##  See Also

` [ connections ](/link/connections?package=base&version=3.6.2) ` , ` [
readLines ](/link/readLines?package=base&version=3.6.2) ` .

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2FpushBack&utm_source=r-docs&utm_medium=docs&utm_term=pushBack&utm_content=run_example_in_workspace)

    
    
    # NOT RUN {
    zz <- textConnection(LETTERS)
    readLines(zz, 2)
    pushBack(c("aa", "bb"), zz)
    pushBackLength(zz)
    readLines(zz, 1)
    pushBackLength(zz)
    readLines(zz, 1)
    readLines(zz, 1)
    close(zz)
    # }
    

Run the code above in your browser using  [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2FpushBack&utm_source=r-docs&utm_medium=docs&utm_term=pushBack&utm_content=run_example_in_workspace)

Powered by  [ DataCamp ](https://www.datacamp.com/)
etween 0.0 and 1.0 the
transformed value is shrunk towards 1, but a certain effect of larger copy
numbers is still present. In this way you can decide if the PCA should be
affected, and to what degree, by differences in copy numbers beyond 1. The PCA
can also up- or downweight some clusters compared to others. The vector
weights  must contain one value for each column in  pan.matrix  . The default
is to use flat weights, i.e. all clusters count equal. See ` [ geneWeights
](/link/geneWeights?package=micropan&version=1.0) ` for alternative weighting
strategies. The functions ` [ plotScores
](/link/plotScores?package=micropan&version=1.0) ` and ` [ plotLoadings
](/link/plotLoadings?package=micropan&version=1.0) ` can be used to visualize
the results of ` [ panpca ](/link/panpca?package=micropan&version=1.0) ` .

##  See Also

` [ plotScores ](/link/plotScores?package=micropan&version=1.0) ` , ` [
plotLoadings ](/link/plotLoadings?package=micropan&version=1.0) ` , ` [
panTree ](/link/panTree?package=micropan&version=1.0) ` , ` [ distManhattan
](/link/distManhattan?package=micropan&version=1.0) ` , ` [ geneWeights
](/link/geneWeights?package=micropan&version=1.0) ` .

##  Examples

[ Run this code
](https://www.datacamp.com/datalab/preview?_tag=rdocs&rdocsPath=packages%2Fmicropan%2Fversions%2F1.0%2Ftopics%2Fpanpca&utm_source=r-docs&utm_medium=docs&utm_term=panpca&utm_content=run_example_in_datalab)

    
    
    # Loading two Panmat objects in the micropan package
    data(list=c("Mpneumoniae.blast.panmat","Mpneumoniae.domain.panmat"),package="micropan")
    
    # Panpca based on a BLAST clustering Panmat object
    ppca.blast <- panpca(Mpneumoniae.blast.panmat)
    plot(ppca.blast) # The generic plot function
    plotScores(ppca.blast) # A score-plot
    
    # Panpca based on domain sequence clustering Panmat object
    w <- geneWeights(Mpneumoniae.domain.panmat,type="shell")
    ppca.domains <- panpca(Mpneumoniae.domain.panmat,scale=0.5,weights=w)
    summary(ppca.domains)
    plotLoadings(ppca.domains)
    

Run the code above in your browser using  [ DataLab
](https://www.datacamp.com/datalab/preview?_tag=rdocs&rdocsPath=packages%2Fmicropan%2Fversions%2F1.0%2Ftopics%2Fpanpca&utm_source=r-docs&utm_medium=docs&utm_term=panpca&utm_content=run_example_in_datalab)

Powered by  [ DataCamp ](https://www.datacamp.com/)
[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  matmult: Matrix Multiplication

##  Description

Multiplies two matrices, if they are conformable. If one argument is a vector,
it will be promoted to either a row or column matrix to make the two arguments
conformable. If both are vectors of the same length, it will return the inner
product (as a matrix).

##  Usage

    
    
    x %*% y

##  Arguments

x, y

numeric or complex matrices or vectors.

##  Value

A double or complex matrix product. Use ` [ drop
](/link/drop?package=base&version=3.6.2) ` to remove dimensions which have
only one level.

##  Details

When a vector is promoted to a matrix, its names are not promoted to row or
column names, unlike ` [ as.matrix
](/link/as.matrix?package=base&version=3.6.2) ` .

Promotion of a vector to a 1-row or 1-column matrix happens when one of the
two choices allows ` x ` and ` y ` to get conformable dimensions.

This operator is S4 generic but not S3 generic. S4 methods need to be written
for a function of two arguments named ` x ` and ` y ` .

##  References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S Language_ .
Wadsworth & Brooks/Cole.

##  See Also

For matrix _cross_ products, ` [ crossprod
](/link/crossprod?package=base&version=3.6.2) () ` and ` tcrossprod() ` are
typically preferable. ` [ matrix ](/link/matrix?package=base&version=3.6.2) `
, ` [ Arithmetic ](/link/Arithmetic?package=base&version=3.6.2) ` , ` [ diag
](/link/diag?package=base&version=3.6.2) ` .

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fmatmult&utm_source=r-docs&utm_medium=docs&utm_term=matmult&utm_content=run_example_in_workspace)

    
    
    # NOT RUN {
    x <- 1:4
    (z <- x %*% x)    # scalar ("inner") product (1 x 1 matrix)
    drop(z)             # as scalar
    
    y <- diag(x)
    z <- matrix(1:12, ncol = 3, nrow = 4)
    y %*% z
    y %*% x
    x %*% z
    # }
    

Run the code above in your browser using  [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fmatmult&utm_source=r-docs&utm_medium=docs&utm_term=matmult&utm_content=run_example_in_workspace)

Powered by  [ DataCamp ](https://www.datacamp.com/)
[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  noquote: Class for ‘no quote’ Printing of Character Strings

##  Description

Print character strings without quotes.

##  Usage

    
    
    noquote(obj, right = FALSE)
    
    # S3 method for noquote
    print(x, quote = FALSE, right = FALSE, …)
    
    # S3 method for noquote
    c(…, recursive = FALSE)

##  Arguments

obj

any  R  object, typically a vector of ` [ character
](/link/character?package=base&version=3.6.2) ` strings.

right

optional ` [ logical ](/link/logical?package=base&version=3.6.2) ` eventually
to be passed to ` print() ` , used by ` [ print.default
](/link/print.default?package=base&version=3.6.2) () ` , indicating whether or
not strings should be right aligned.

x

an object of class ` "noquote" ` .

quote, …

further options passed to next methods, such as ` [ print
](/link/print?package=base&version=3.6.2) ` .

recursive

for compatibility with the generic ` [ c ](/link/c?package=base&version=3.6.2)
` function.

##  Details

` noquote ` returns its argument as an object of class ` "noquote" ` . There
is a method for ` c() ` and subscript method ( ` "[.noquote" ` ) which ensures
that the class is not lost by subsetting. The print method ( ` print.noquote `
) prints character strings _without_ quotes ( ` "\dots" ` ).

If ` right ` is specified in a call ` print(x, right=*) ` , it takes
precedence over a possible ` right ` setting of ` x ` , e.g., created by ` x
<- noquote(*, right=TRUE) ` .

These functions exist both as utilities and as an example of using (S3) ` [
class ](/link/class?package=base&version=3.6.2) ` and object orientation.

##  See Also

` [ methods ](/link/methods?package=base&version=3.6.2) ` , ` [ class
](/link/class?package=base&version=3.6.2) ` , ` [ print
](/link/print?package=base&version=3.6.2) ` .

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fnoquote&utm_source=r-docs&utm_medium=docs&utm_term=noquote&utm_content=run_example_in_workspace)

    
    
    # NOT RUN {
    letters
    nql <- noquote(letters)
    nql
    nql[1:4] <- "oh"
    nql[1:12]
    
    cmp.logical <- function(log.v)
    {
      ## Purpose: compact printing of logicals
      log.v <- as.logical(log.v)
      noquote(if(length(log.v) == 0)"()" else c(".","|")[1 + log.v])
    }
    cmp.logical(stats::runif(20) > 0.8)
    
    chmat <- as.matrix(format(stackloss)) # a "typical" character matrix
    ## noquote(*, right=TRUE)  so it prints exactly like a data frame
    chmat <- noquote(chmat, right = TRUE)
    chmat
    # }
    # NOT RUN {
    <!-- %dont -->
    # }
    

Run the code above in your browser using  [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fnoquote&utm_source=r-docs&utm_medium=docs&utm_term=noquote&utm_content=run_example_in_workspace)

Powered by  [ DataCamp ](https://www.datacamp.com/)
[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  Reserved: Reserved Words in R

##  Description

The reserved words in  R  's parser are

` [ if ](/link/if?package=base&version=3.6.2) ` ` [ else
](/link/else?package=base&version=3.6.2) ` ` [ repeat
](/link/repeat?package=base&version=3.6.2) ` ` [ while
](/link/while?package=base&version=3.6.2) ` ` [ function
](/link/function?package=base&version=3.6.2) ` ` [ for
](/link/for?package=base&version=3.6.2) ` ` in ` ` [ next
](/link/next?package=base&version=3.6.2) ` ` [ break
](/link/break?package=base&version=3.6.2) `

` [ TRUE ](/link/TRUE?package=base&version=3.6.2) ` ` [ FALSE
](/link/FALSE?package=base&version=3.6.2) ` ` [ NULL
](/link/NULL?package=base&version=3.6.2) ` ` [ Inf
](/link/Inf?package=base&version=3.6.2) ` ` [ NaN
](/link/NaN?package=base&version=3.6.2) ` ` [ NA
](/link/NA?package=base&version=3.6.2) ` ` [ NA_integer_
](/link/NA_integer_?package=base&version=3.6.2) ` ` [ NA_real_
](/link/NA_real_?package=base&version=3.6.2) ` ` [ NA_complex_
](/link/NA_complex_?package=base&version=3.6.2) ` ` [ NA_character_
](/link/NA_character_?package=base&version=3.6.2) `

` … ` and ` ..1 ` , ` ..2 ` etc, which are used to refer to arguments passed
down from a calling function, see ` [ ...
](/link/...?package=base&version=3.6.2) ` .

##  Arguments

##  Details

Reserved words outside [ quotes
](/link/quotes?package=base&version=3.6.2&to=%3DQuotes) are always parsed to
be references to the objects linked to in the ‘Description’, and hence they
are not allowed as syntactic names (see ` [ make.names
](/link/make.names?package=base&version=3.6.2) ` ). They **are** allowed as
non-syntactic names, e.g.inside [ backtick
](/link/backtick?package=base&version=3.6.2) quotes.

Powered by  [ DataCamp ](https://www.datacamp.com/)