Commit 56a00fdb by Eric Coissac

Rename simulate_matrix rmatrix

parent f3382025
......@@ -34,8 +34,8 @@ export(pca)
export(pcoa)
export(procmod_frame)
export(protate)
export(rmatrix)
export(simulate_correlation)
export(simulate_matrix)
export(varls)
import(MASS)
import(doParallel)
......
......@@ -21,8 +21,8 @@ NULL
#'
#' @examples
#' # Renerate a random matrix of size 10 x 15
#' m1 <- simulate_matrix(10, 15)
#' m2 <- simulate_matrix(10, 20)
#' m1 <- rmatrix(10, 15)
#' m2 <- rmatrix(10, 20)
#' mr <- protate(m1, m2)
#'
#' @author Christelle Gonindard-Melodelima
......
......@@ -17,14 +17,14 @@
#' @return a numeric matrix of \code{n} rows and \code{p} columns
#'
#' @examples
#' sim1 <- simulate_matrix(25,10)
#' sim1 <- rmatrix(25,10)
#' class(sim1)
#' dim(sim1)
#'
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
simulate_matrix <- function(n, p, equal_var = TRUE) {
rmatrix <- function(n, p, equal_var = TRUE) {
new <- rnorm(n * p, mean = 0, sd = 1)
dim(new) <- c(n, p)
......@@ -63,7 +63,7 @@ simulate_matrix <- function(n, p, equal_var = TRUE) {
#' @return a numeric matrix of \code{nrow(reference)} rows and \code{p} columns
#'
#' @examples
#' sim1 <- simulate_matrix(25,10)
#' sim1 <- rmatrix(25,10)
#' class(sim1)
#' dim(sim1)
#' sim2 <- simulate_correlation(sim1,20,0.8)
......@@ -77,7 +77,7 @@ simulate_correlation <- function(reference, p, r2, equal_var = TRUE) {
n <- nrow(reference)
maxdim <- max(ncol(reference), p)
noise <- simulate_matrix(n, p, equal_var = equal_var)
noise <- rmatrix(n, p, equal_var = equal_var)
if (maxdim == p && maxdim > ncol(reference)) {
# noise is the largest matrix
......@@ -111,4 +111,4 @@ simulate_correlation <- function(reference, p, r2, equal_var = TRUE) {
return(new)
}
#simulate_matrix_tree
#rmatrix_tree
......@@ -21,8 +21,8 @@ No scaling and no centrering are done, before computing the SVD.
}
\examples{
# Renerate a random matrix of size 10 x 15
m1 <- simulate_matrix(10, 15)
m2 <- simulate_matrix(10, 20)
m1 <- rmatrix(10, 15)
m2 <- rmatrix(10, 20)
mr <- protate(m1, m2)
}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\name{simulate_matrix}
\alias{simulate_matrix}
\name{rmatrix}
\alias{rmatrix}
\title{Simulate n points of dimension p.}
\usage{
simulate_matrix(n, p, equal_var = TRUE)
rmatrix(n, p, equal_var = TRUE)
}
\arguments{
\item{n}{an \code{int} value indicating the number of observations.}
......@@ -28,7 +28,7 @@ Therefore they are expected to be equal to 0 and reflect only the
random distribution of the covariance between two random vectors.
}
\examples{
sim1 <- simulate_matrix(25,10)
sim1 <- rmatrix(25,10)
class(sim1)
dim(sim1)
......
......@@ -35,7 +35,7 @@ The intensity of the correlation is determined by the \code{r2}
parameter.
}
\examples{
sim1 <- simulate_matrix(25,10)
sim1 <- rmatrix(25,10)
class(sim1)
dim(sim1)
sim2 <- simulate_correlation(sim1,20,0.8)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment