diff --git a/NAMESPACE b/NAMESPACE index 8b111c8..a25eea6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,9 +2,7 @@ export(addAlleles) export(admix1) -export(blanks) export(calculatePopLogml) -export(colon) export(computeAllFreqs2) export(computeIndLogml) export(computePersonalAllFreqs) @@ -15,8 +13,6 @@ export(fopen) export(greedyMix) export(handleData) export(initPopNames) -export(inputdlg) -export(isfield) export(laskeMuutokset4) export(learn_partition_modified) export(learn_simple_partition) @@ -25,29 +21,20 @@ export(load_fasta) export(logml2String) export(lueGenePopData) export(lueNimi) -export(matlab2r) export(noIndex) export(ownNum2Str) export(poistaLiianPienet) export(proportion2str) -export(questdlg) -export(rand) export(randdir) -export(repmat) export(rivinSisaltamienMjonojenLkm) export(selvitaDigitFormat) export(simulateAllFreqs) export(simulateIndividuals) export(simuloiAlleeli) -export(size) -export(strcmp) export(suoritaMuutos) export(takeLine) export(testaaOnkoKunnollinenBapsData) export(testaaPop) -export(times) -export(uigetfile) -export(uiputfile) export(writeMixtureInfo) import(utils) importFrom(Rsamtools,scanBam) @@ -55,9 +42,27 @@ importFrom(adegenet,.readExt) importFrom(adegenet,read.genepop) importFrom(ape,as.DNAbin) importFrom(ape,read.FASTA) +importFrom(matlab2r,blanks) +importFrom(matlab2r,cell) +importFrom(matlab2r,colon) +importFrom(matlab2r,inputdlg) +importFrom(matlab2r,isempty) +importFrom(matlab2r,isfield) +importFrom(matlab2r,isspace) +importFrom(matlab2r,max) +importFrom(matlab2r,min) +importFrom(matlab2r,ones) +importFrom(matlab2r,rand) +importFrom(matlab2r,repmat) +importFrom(matlab2r,reshape) +importFrom(matlab2r,size) +importFrom(matlab2r,sortrows) +importFrom(matlab2r,squeeze) +importFrom(matlab2r,strcmp) +importFrom(matlab2r,times) +importFrom(matlab2r,zeros) importFrom(methods,is) importFrom(stats,runif) importFrom(stats,sd) importFrom(utils,read.delim) -importFrom(utils,write.table) importFrom(vcfR,read.vcfR) diff --git a/R/indMix.R b/R/indMix.R index 922b764..6040e87 100644 --- a/R/indMix.R +++ b/R/indMix.R @@ -150,8 +150,8 @@ indMix <- function(c, npops, dispText = TRUE) { diffInCounts <- muutokset_diffInCounts$diffInCounts if (round == 1) { - maxMuutos <- max_MATLAB(muutokset)$max - i2 <- max_MATLAB(muutokset)$idx + maxMuutos <- matlab2r::max(muutokset)$max + i2 <- matlab2r::max(muutokset)$idx } if (i1 != i2 & maxMuutos > 1e-5) { @@ -174,7 +174,7 @@ indMix <- function(c, npops, dispText = TRUE) { partitionSummary <- temp_addToSum$partitionSummary added <- temp_addToSum$added if (added == 1) { - temp_minMATLAB <- min_MATLAB( + temp_minMATLAB <- matlab2r::min( partitionSummary[, 2] ) worstLogml <- temp_minMATLAB$mins @@ -195,8 +195,8 @@ indMix <- function(c, npops, dispText = TRUE) { ) muutokset <- muutokset_diffInCounts$muutokset diffInCounts <- muutokset_diffInCounts$diffInCounts - isoin <- max_MATLAB(muutokset)[[1]] - indeksi <- max_MATLAB(muutokset)[[2]] + isoin <- matlab2r::max(muutokset)[[1]] + indeksi <- matlab2r::max(muutokset)[[2]] if (isoin > maxMuutos) { maxMuutos <- isoin i1 <- pop @@ -222,8 +222,8 @@ indMix <- function(c, npops, dispText = TRUE) { partitionSummary <- temp_addToSum$partitionSummary added <- temp_addToSum$added if (added == 1) { - worstLogml <- min_MATLAB(partitionSummary[, 2])[[1]] - worstIndex <- min_MATLAB(partitionSummary[, 2])[[2]] + worstLogml <- matlab2r::min(partitionSummary[, 2])[[1]] + worstIndex <- matlab2r::min(partitionSummary[, 2])[[2]] } } } else { @@ -247,8 +247,8 @@ indMix <- function(c, npops, dispText = TRUE) { muutokset <- laskeMuutokset3( T2, inds2, rows, data, adjprior, priorTerm, pop ) - isoin <- max_MATLAB(muutokset)[[1]] - indeksi <- max_MATLAB(muutokset)[[2]] + isoin <- matlab2r::max(muutokset)[[1]] + indeksi <- matlab2r::max(muutokset)[[2]] if (isoin > maxMuutos) { maxMuutos <- isoin muuttuvaPop2 <- indeksi %% npops2 @@ -289,8 +289,8 @@ indMix <- function(c, npops, dispText = TRUE) { partitionSummary <- temp_addToSum$partitionSummary added <- temp_addToSum$added if (added == 1) { - worstLogml <- min_MATLAB(partitionSummary[, 2])[[1]] - worstIndex <- min_MATLAB(partitionSummary[, 2])[[2]] + worstLogml <- matlab2r::min(partitionSummary[, 2])[[1]] + worstIndex <- matlab2r::min(partitionSummary[, 2])[[2]] } } } else { @@ -334,8 +334,8 @@ indMix <- function(c, npops, dispText = TRUE) { diffInCounts <- muutokset_diffInCounts$diffInCounts muutokset[pop] <- -1e50 # Varmasti ei suurin!!! - maxMuutos <- max_MATLAB(muutokset)[[1]] - i2 <- max_MATLAB(muutokset)[[2]] + maxMuutos <- matlab2r::max(muutokset)[[1]] + i2 <- matlab2r::max(muutokset)[[2]] updateGlobalVariables( ind, i2, diffInCounts, adjprior, priorTerm ) @@ -370,8 +370,8 @@ indMix <- function(c, npops, dispText = TRUE) { partitionSummary <- temp_addToSum$partitionSummary added <- temp_addToSum$added if (added == 1) { - worstLogml <- min_MATLAB(partitionSummary[, 2])[[1]] - worstIndex <- min_MATLAB(partitionSummary[, 2])[[2]] + worstLogml <- matlab2r::min(partitionSummary[, 2])[[1]] + worstIndex <- matlab2r::min(partitionSummary[, 2])[[2]] } } } else { @@ -441,7 +441,7 @@ indMix <- function(c, npops, dispText = TRUE) { pop, emptyPop ) - maxMuutos <- indeksi <- max_MATLAB(muutokset) + maxMuutos <- indeksi <- matlab2r::max(muutokset) muuttuva <- inds2(indeksi) if (PARTITION(muuttuva) == pop) { @@ -474,8 +474,8 @@ indMix <- function(c, npops, dispText = TRUE) { partitionSummary <- temp_addToSum$partitionSummary added <- temp_addToSum$added if (added == 1) { - worstLogml <- min_MATLAB(partitionSummary[, 2])[[1]] - worstIndex <- min_MATLAB(partitionSummary[, 2])[[2]] + worstLogml <- matlab2r::min(partitionSummary[, 2])[[1]] + worstIndex <- matlab2r::min(partitionSummary[, 2])[[2]] } } if (muutoksiaNyt == 0) { diff --git a/R/linkage.R b/R/linkage.R index fdd1e6d..d06c4be 100644 --- a/R/linkage.R +++ b/R/linkage.R @@ -31,8 +31,8 @@ linkage <- function(Y, method = "co") { for (s in 1:(n - 1)) { X <- as.matrix(as.vector(Y), ncol = 1) - v <- min_MATLAB(X)$mins - k <- min_MATLAB(X)$idx + v <- matlab2r::min(X)$mins + k <- matlab2r::min(X)$idx i <- floor(m + 1 / 2 - sqrt(m^2 - m + 1 / 4 - 2 * (k - 1))) j <- k - (i - 1) * (m - i / 2) + i diff --git a/man/blanks.Rd b/man/blanks.Rd deleted file mode 100644 index 87471f4..0000000 --- a/man/blanks.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/blanks.R -\name{blanks} -\alias{blanks} -\title{Blanks} -\usage{ -blanks(n) -} -\arguments{ -\item{n}{length of vector} -} -\value{ -Vector of n blanks -} -\description{ -Create character vector of blanks -} -\details{ -This function emulates the behavior of a homonimous function from Matlab -} -\author{ -Waldir Leoncio -} diff --git a/man/cell.Rd b/man/cell.Rd deleted file mode 100644 index 4b1b3ac..0000000 --- a/man/cell.Rd +++ /dev/null @@ -1,24 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cell.R -\name{cell} -\alias{cell} -\title{Cell array} -\usage{ -cell(n, sz = c(n, n), expandable = FALSE, ...) -} -\arguments{ -\item{n}{a the first dimension (or both, if sz is not passed)} - -\item{sz}{the second dimension (or 1st and 2nd, if not passed)} - -\item{expandable}{if TRUE, output is a list (so it can take different -lengths)} - -\item{...}{Other dimensions} -} -\value{ -An array of zeroes with the dimensions passed on call -} -\description{ -Creates an array of zeros -} diff --git a/man/colon.Rd b/man/colon.Rd deleted file mode 100644 index 4ae3857..0000000 --- a/man/colon.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/colon.R -\name{colon} -\alias{colon} -\title{Vector creation} -\usage{ -colon(a, b) -} -\arguments{ -\item{a}{initial number} - -\item{b}{final number} -} -\description{ -Simulates the function `colon()` and its equivalent `:` operator from Matlab, which have a similar but not quite equivalent behavior when compared to `seq()` and `:` in R. -} diff --git a/man/find.Rd b/man/find.Rd deleted file mode 100644 index e429d07..0000000 --- a/man/find.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/find.R -\name{find} -\alias{find} -\title{Find indices and values of nonzero elements} -\usage{ -find(x, sort = TRUE) -} -\arguments{ -\item{x}{object or logic operation on an object} - -\item{sort}{sort output?} -} -\description{ -Emulates behavior of `find` -} diff --git a/man/fix.Rd b/man/fix.Rd deleted file mode 100644 index 91b4678..0000000 --- a/man/fix.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/fix.R -\name{fix} -\alias{fix} -\title{Round toward zero} -\usage{ -fix(X) -} -\arguments{ -\item{X}{input element} -} -\description{ -Rounds each element of input to the nearest integer towards zero. Basically the same as trunc() -} -\author{ -Waldir Leoncio -} diff --git a/man/inputdlg.Rd b/man/inputdlg.Rd deleted file mode 100644 index 48c3e4c..0000000 --- a/man/inputdlg.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/inputdlg.R -\name{inputdlg} -\alias{inputdlg} -\title{Gather user input} -\usage{ -inputdlg(prompt, dims = 1, definput = NULL) -} -\arguments{ -\item{prompt}{Text field with user instructions} - -\item{dims}{number of dimensions in the answwers} - -\item{definput}{default value of the input} -} -\description{ -Replicates the functionality of the homonymous function in Matlab (sans dialog box) -} diff --git a/man/isempty.Rd b/man/isempty.Rd deleted file mode 100644 index e4ddc43..0000000 --- a/man/isempty.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/isempty.R -\name{isempty} -\alias{isempty} -\title{Is Array Empty?} -\usage{ -isempty(x) -} -\arguments{ -\item{x}{array} -} -\description{ -Determine whether array is empty. An empty array, table, or timetable has at least one dimension with length 0, such as 0-by-0 or 0-by-5. -} -\details{ -Emulates the behavior of the `isempty` function on Matlab -} diff --git a/man/isfield.Rd b/man/isfield.Rd deleted file mode 100644 index a3ccd17..0000000 --- a/man/isfield.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/isfield.R -\name{isfield} -\alias{isfield} -\title{Checks if a list contains a field} -\usage{ -isfield(x, field) -} -\arguments{ -\item{x}{list} - -\item{field}{name of field} -} -\description{ -This function tries to replicate the behavior of the `isfield` -function in Matlab -} -\references{ -https://se.mathworks.com/help/matlab/ref/isfield.html -} diff --git a/man/isspace.Rd b/man/isspace.Rd deleted file mode 100644 index fba4844..0000000 --- a/man/isspace.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/isspace.R -\name{isspace} -\alias{isspace} -\title{Determine space characters} -\usage{ -isspace(A) -} -\arguments{ -\item{A}{a character array or a string scalar} -} -\value{ -a vector TF such that the elements of TF are logical 1 (true) where corresponding characters in A are space characters, and logical 0 (false) elsewhere -} -\description{ -Determine which characters are space characters -} -\note{ -Recognized whitespace characters are ` ` and `\\t`. -} -\author{ -Waldir Leoncio -} diff --git a/man/matlab2r.Rd b/man/matlab2r.Rd deleted file mode 100644 index e809709..0000000 --- a/man/matlab2r.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/matlab2r.R -\name{matlab2r} -\alias{matlab2r} -\title{Convert Matlab function to R} -\usage{ -matlab2r( - filename, - output = "diff", - improve_formatting = TRUE, - change_assignment = TRUE, - append = FALSE -) -} -\arguments{ -\item{filename}{name of the file} - -\item{output}{can be "asis", "clean", "save" or "diff"} - -\item{improve_formatting}{if `TRUE` (default), makes minor changes -to conform to best-practice formatting conventions} - -\item{change_assignment}{if `TRUE` (default), uses `<-` as the assignment operator} - -\item{append}{if `FALSE` (default), overwrites file; otherwise, append -output to input} -} -\value{ -text converted to R, printed to screen or replacing input file -} -\description{ -Performs basic syntax conversion from Matlab to R -} -\note{ -This function is intended to expedite the process of converting a -Matlab function to R by making common replacements. It does not have the -immediate goal of outputting a ready-to-use function. In other words, -after using this function you should go back to it and make minor changes. - -It is also advised to do a dry-run with `output = "clean"` and only switching -to `output = "save"` when you are confident that no important code will be -lost (for shorter functions, a careful visual inspection should suffice). -} -\author{ -Waldir Leoncio -} diff --git a/man/max_MATLAB.Rd b/man/max_MATLAB.Rd deleted file mode 100644 index d7fbdf7..0000000 --- a/man/max_MATLAB.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/min_max_MATLAB.R -\name{max_MATLAB} -\alias{max_MATLAB} -\title{Maximum (MATLAB version)} -\usage{ -max_MATLAB(X, indices = TRUE) -} -\arguments{ -\item{X}{matrix} - -\item{indices}{return indices?} -} -\value{ -Either a list or a vector -} -\description{ -Finds the minimum value for each column of a matrix, potentially returning the indices instead -} -\author{ -Waldir Leoncio -} diff --git a/man/min_MATLAB.Rd b/man/min_MATLAB.Rd deleted file mode 100644 index 9825e90..0000000 --- a/man/min_MATLAB.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/min_max_MATLAB.R -\name{min_MATLAB} -\alias{min_MATLAB} -\title{Minimum (MATLAB version)} -\usage{ -min_MATLAB(X, indices = TRUE) -} -\arguments{ -\item{X}{matrix} - -\item{indices}{return indices?} -} -\value{ -Either a list or a vector -} -\description{ -Finds the minimum value for each column of a matrix, potentially returning the indices instead -} -\author{ -Waldir Leoncio -} diff --git a/man/nargin.Rd b/man/nargin.Rd deleted file mode 100644 index a7922a6..0000000 --- a/man/nargin.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/nargin.R -\name{nargin} -\alias{nargin} -\title{Number of function input arguments} -\usage{ -nargin() -} -\value{ -An integer -} -\description{ -Returns the number of arguments passed to the parent function -} -\note{ -This function only makes sense inside another function -} -\references{ -https://stackoverflow.com/q/64422780/1169233 -} -\author{ -Waldir Leoncio -} diff --git a/man/ones.Rd b/man/ones.Rd deleted file mode 100644 index 76f3f4a..0000000 --- a/man/ones.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/zeros_ones.R -\name{ones} -\alias{ones} -\title{Matrix of ones} -\usage{ -ones(n1, n2 = n1, ...) -} -\arguments{ -\item{n1}{number of rows} - -\item{n2}{number of columns} - -\item{...}{extra dimensions} -} -\description{ -wrapper of `zeros_or_ones()` that replicates the behavior of -the `ones()` function on Matlab -} diff --git a/man/questdlg.Rd b/man/questdlg.Rd deleted file mode 100644 index e4f5fa9..0000000 --- a/man/questdlg.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/questdlg.R -\name{questdlg} -\alias{questdlg} -\title{Prompt for multiple-choice} -\usage{ -questdlg( - quest, - dlgtitle = "", - btn = c("y", "n"), - defbtn = "n", - accepted_ans = c("y", "yes", "n", "no") -) -} -\arguments{ -\item{quest}{Question} - -\item{dlgtitle}{Title of question} - -\item{btn}{Vector of alternatives} - -\item{defbtn}{Scalar with the name of the default option} - -\item{accepted_ans}{Vector containing accepted answers} -} -\description{ -This function aims to loosely mimic the behavior of the -questdlg function on Matlab -} diff --git a/man/rand.Rd b/man/rand.Rd deleted file mode 100644 index 131a43c..0000000 --- a/man/rand.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/rand.R -\name{rand} -\alias{rand} -\title{Generate matrix with U(0, 1) trials} -\usage{ -rand(r = 1, c = 1) -} -\arguments{ -\item{r}{number of rows of output matrix} - -\item{c}{number of columns of output matrix} -} -\value{ -\eqn{r \times c} matrix with random trials from a standard uniform distribution. -} -\description{ -Imitates the behavior of `rand()` on Matlab -} diff --git a/man/repmat.Rd b/man/repmat.Rd deleted file mode 100644 index 0fbaa6e..0000000 --- a/man/repmat.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/repmat.R -\name{repmat} -\alias{repmat} -\title{Repeat matrix} -\usage{ -repmat(mx, n) -} -\arguments{ -\item{mx}{matrix} - -\item{n}{either a scalar with the number of replications in both rows and -columns or a <= 3-length vector with individual repetitions.} -} -\value{ -matrix replicated over `ncol(mx) * n` columns and `nrow(mx) * n` rows -} -\description{ -Repeats a matrix over n columns and rows -} -\details{ -This function was created to replicate the behavior of a homonymous -function on Matlab -} -\note{ -The Matlab implementation of this function accepts `n` with length > 2. - -It should also be noted that a concatenated vector in R, e.g. `c(5, 2)`, becomes a column vector when coerced to matrix, even though it may look like a row vector at first glance. This is important to keep in mind when considering the expected output of this function. Vectors in R make sense to be seen as column vectors, given R's Statistics-oriented paradigm where variables are usually disposed as columns in a dataset. -} diff --git a/man/reshape.Rd b/man/reshape.Rd deleted file mode 100644 index 39d74f9..0000000 --- a/man/reshape.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/reshape.R -\name{reshape} -\alias{reshape} -\title{Reshape array} -\usage{ -reshape(A, sz) -} -\arguments{ -\item{A}{input matrix} - -\item{sz}{vector containing the dimensions of the output vector} -} -\description{ -Reshapes a matrix according to a certain number of dimensions -} -\details{ -This function replicates the functionality of the `reshape()` -function on Matlab. This function is basically a fancy wrapper for the -`array()` function in R, but is useful because it saves the user translation -time. Moreover, it introduces validation code that alter the behavior of -`array()` and makes it more similar to `replicate()`. -} -\note{ -The Matlab function also accepts as input the dismemberment of sz as -scalars. -} diff --git a/man/setdiff_MATLAB.Rd b/man/setdiff_MATLAB.Rd deleted file mode 100644 index dcc6c00..0000000 --- a/man/setdiff_MATLAB.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/setdiff_MATLAB.R -\name{setdiff_MATLAB} -\alias{setdiff_MATLAB} -\title{Set differences of two arrays} -\usage{ -setdiff_MATLAB(A, B, legacy = FALSE) -} -\arguments{ -\item{A}{first array} - -\item{B}{second array} - -\item{legacy}{if `TRUE`, preserves the behavior of the setdiff function from MATLAB R2012b and prior releases. (currently not supported)} -} -\description{ -Loosely replicates the behavior of the homonym Matlab function -} -\author{ -Waldir Leoncio -} diff --git a/man/size.Rd b/man/size.Rd deleted file mode 100644 index 3fe1893..0000000 --- a/man/size.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/size.R -\name{size} -\alias{size} -\title{Size of an object} -\usage{ -size(x, d) -} -\arguments{ -\item{x}{object to be evaluated} - -\item{d}{dimension of object to be evaluated} -} -\description{ -This functions tries to replicate the behavior of the base function "size" in Matlab -} -\note{ -On MATLAB, size(1, 100) returns 1. As a matter of fact, if the user -calls for a dimension which x doesn't have `size()` always returns 1. R's -default behavior is more reasonable in those cases (i.e., returning NA), -but since the point of this function is to replicate MATLAB behaviors -(bugs and questionable behaviors included), this function also does this. -} diff --git a/man/sortrows.Rd b/man/sortrows.Rd deleted file mode 100644 index 9680899..0000000 --- a/man/sortrows.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sortrows.R -\name{sortrows} -\alias{sortrows} -\title{Sort rows of matrix or table} -\usage{ -sortrows(A, column = 1) -} -\arguments{ -\item{A}{matrix} - -\item{column}{ordering column} -} -\description{ -Emulates the behavior of the `sortrows` function on Matlab -} diff --git a/man/squeeze.Rd b/man/squeeze.Rd deleted file mode 100644 index 6191ee4..0000000 --- a/man/squeeze.Rd +++ /dev/null @@ -1,33 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/squeeze.R -\name{squeeze} -\alias{squeeze} -\title{Squeeze} -\usage{ -squeeze(A) -} -\arguments{ -\item{A}{input or array matrix} -} -\value{ -An array with the same elements as the input array, but with -dimensions of length 1 removed. -} -\description{ -Remove dimensions of length 1 -} -\details{ -This function implements the behavior of the homonimous function on -Matlab. `B = squeeze(A)` returns an array with the same elements as the -input array A, but with dimensions of length 1 removed. For example, if A is -a 3-by-1-by-1-by-2 array, then squeeze(A) returns a 3-by-2 matrix. If A is a -row vector, column vector, scalar, or an array with no dimensions of length -1, then squeeze returns the input A. -} -\note{ -This is basically a wrapper of drop() with a minor adjustment to adapt -the output to what happens on Matlab -} -\author{ -Waldir Leoncio -} diff --git a/man/strcmp.Rd b/man/strcmp.Rd deleted file mode 100644 index b832fa9..0000000 --- a/man/strcmp.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/strcmp.R -\name{strcmp} -\alias{strcmp} -\title{Compare two character elements} -\usage{ -strcmp(s1, s2) -} -\arguments{ -\item{s1}{first character element (string, vector or matrix)} - -\item{s2}{second character element (string, vector or matrix)} -} -\value{ -a logical element of the same type as the input -} -\description{ -Logical test if two character elements are identical -} diff --git a/man/times.Rd b/man/times.Rd deleted file mode 100644 index a52d264..0000000 --- a/man/times.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/times.R -\name{times} -\alias{times} -\title{Element-wise matrix multiplication} -\usage{ -times(a, b) -} -\arguments{ -\item{a}{first factor of the multiplication} - -\item{b}{second factor of the multiplication} -} -\value{ -matrix with dimensions equal to the larger of the two factors -} -\description{ -Emulates the `times()` and `.*` operators from Matlab. -} -\details{ -This function basically handles elements of different length better than the `*` operator in R, at least as far as behavior from a Matlab user is expecting. -} diff --git a/man/uigetfile.Rd b/man/uigetfile.Rd deleted file mode 100644 index 21594ba..0000000 --- a/man/uigetfile.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/uigetfile.R -\name{uigetfile} -\alias{uigetfile} -\title{Select a file for loading} -\usage{ -uigetfile(filter = "", title = "") -} -\arguments{ -\item{filter}{Filter listed files} - -\item{title}{Pre-prompt message} -} -\description{ -Loosely mimics the functionality of the `uigetfile` function on -Matlab. -} -\references{ -https://se.mathworks.com/help/matlab/ref/uigetfile.html -} diff --git a/man/uiputfile.Rd b/man/uiputfile.Rd deleted file mode 100644 index 7b37f76..0000000 --- a/man/uiputfile.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/uiputfile.R -\name{uiputfile} -\alias{uiputfile} -\title{Save file} -\usage{ -uiputfile(filter = ".rda", title = "Save file") -} -\arguments{ -\item{filter}{accepted file extension} - -\item{title}{Title} -} -\description{ -This function intends to loosely mimic the behaviour of the -homonymous Matlab function. -} diff --git a/man/zeros.Rd b/man/zeros.Rd deleted file mode 100644 index c027e24..0000000 --- a/man/zeros.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/zeros_ones.R -\name{zeros} -\alias{zeros} -\title{Matrix of zeros} -\usage{ -zeros(n1, n2 = n1, ...) -} -\arguments{ -\item{n1}{number of rows} - -\item{n2}{number of columns} - -\item{...}{extra dimensions} -} -\description{ -wrapper of `zeros_or_ones()` that replicates the behavior of -the `zeros()` function on Matlab -} diff --git a/man/zeros_or_ones.Rd b/man/zeros_or_ones.Rd deleted file mode 100644 index a9ec7f7..0000000 --- a/man/zeros_or_ones.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/zeros_ones.R -\name{zeros_or_ones} -\alias{zeros_or_ones} -\title{Matrix of zeros or ones} -\usage{ -zeros_or_ones(n, x) -} -\arguments{ -\item{n}{scalar or 2D vector} - -\item{x}{value to fill matrix with} -} -\value{ -n-by-n matrix filled with `x` -} -\description{ -Generates a square or rectangular matrix of zeros or ones -} -\details{ -This is a wrapper function to replicate the behavior of the -`zeros()` and the `ones()` functions on Matlab -} -\note{ -Actually works for any `x`, but there's no need to bother imposing -validation controls here. -}