Commit 54194f16 authored by Ahmad Alkadri's avatar Ahmad Alkadri 🎧

merging

parents cd36c90b 753a688e
^.*\.Rproj$
^\.Rproj\.user$
.Rproj.user
.Rhistory
.RData
.Ruserdata
Package: rterahertz
Type: Package
Title: R-Terahertz
Version: 0.1.0
Authors@R:
person(given = "Ahmad",
family = "Alkadri",
role = c("aut", "cre"),
email = "ahmad.alkadri@outlook.com")
Description: This package is a collection of functions used for working with THz data.
Specifically, it is used for working with the raw THz data obtained during the
research cooperation between LMGC (Laboratoire de Mechanics et Genie Civil) and
L2C (Laboratoire de Charles Coulomb) of the University of Montpellier, France.
Currently in active development due to the active state of the research.
Imports: ggplot2,reshape2,plotly
Depends: R (>= 3.0.0)
License: CeCILL
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
exportPattern("^[[:alpha:]]+")
#' Function for extracting the odd-numbered lines of a matrix.
#'
#' @description A function for extracting the odd-numbered lines (1,3,5,etc.) of a matrix
#'
#' @usage extractmatline_odd(m)
#'
#' @param m A matrix object
#'
#' @return The same matrix without the values of its even-numbered lines
#'
#' @examples
#' m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
#' m_oddlines <- extractmatline_odd(m)
extractmatline_odd <- function(m){
#m = data de scan THz
m <- as.matrix(m)
colnames(m) <- 1:ncol(m)
row.names(m) <- 1:nrow(m)
nrow_m <- nrow(m)
nrow_odd <- seq(1,nrow_m,by=2)
m_odd <- m[nrow_odd,]
return(m_odd)
}
#' Function for extracting the even-numbered lines of a matrix.
#'
#' @description A function for extracting the even-numbered lines (2,4,6,etc.) of a matrix
#'
#' @usage extractmatline_even(m)
#'
#' @param m A matrix object
#'
#' @return The same matrix without the values of its odd-numbered lines
#'
#' @examples
#' m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
#' m_evenlines <- extractmatline_even(m)
extractmatline_even <- function(m){
#m = data de scan THz
m <- as.matrix(m)
colnames(m) <- 1:ncol(m)
row.names(m) <- 1:nrow(m)
nrow_m <- nrow(m)
nrow_even <- seq(2,nrow_m,by=2)
m_even <- m[nrow_even,]
return(m_even)
}
#' Function for extracting the odd-numbered lines of a matrix.
#'
#' @description A function for extracting the odd-numbered lines (1,3,5,etc.) of a matrix
#'
#' @usage extrairematligne_odd(m)
#'
#' @param m A matrix object
#'
#' @return The same matrix without the values of its even-numbered lines
#'
#' @examples
#' m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
#' m_oddlines <- extrairematligne_odd(m)
extrairematligne_odd <- function(m){
#m = data de scan THz
m <- as.matrix(m)
colnames(m) <- 1:ncol(m)
row.names(m) <- 1:nrow(m)
nrow_m <- nrow(m)
nrow_odd <- seq(1,nrow_m,by=2)
m_odd <- m[nrow_odd,]
return(m_odd)
}
#' Function for extracting the even-numbered lines of a matrix.
#'
#' @description A function for extracting the even-numbered lines (2,4,6,etc.) of a matrix
#'
#' @usage extrairematligne_even(m)
#'
#' @param m A matrix object
#'
#' @return The same matrix without the values of its odd-numbered lines
#'
#' @examples
#' m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
#' m_evenlines <- extrairematligne_even(m)
extrairematligne_even <- function(m){
#m = data de scan THz
m <- as.matrix(m)
colnames(m) <- 1:ncol(m)
row.names(m) <- 1:nrow(m)
nrow_m <- nrow(m)
nrow_even <- seq(2,nrow_m,by=2)
m_even <- m[nrow_even,]
return(m_even)
}
\ No newline at end of file
#' Function for visualizing the THz image matrix using plotly
#'
#' @description A wrapper for plot_ly() function, useful for visualizing the THz matrix data quickly.
#'
#' @usage plotlyTHz(m)
#'
#' @param m THz matrix data, obtained through the THz scan
#'
#' @return An imaging of said matrix
#'
#' @examples
#' m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
#' plotlyTHz(m)
plotlyTHz <- function(m){
# m is the matrix of the data obtained through the THz imaging
plotly::plot_ly(
x = 1:ncol(m),
y = 1:nrow(m),
z = (as.matrix(m)), type = "heatmap"
)
}
#' Function for visualizing the THz image matrix using ggplot2
#'
#' @description A wrapper for ggplot() function, useful for visualizing the THz matrix data quickly.
#'
#' @usage plotTHz(m)
#'
#' @param m THz matrix data, obtained through the THz scan
#'
#' @return An imaging of said matrix
#'
#' @examples
#' m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
#' plotTHz(m)
plotTHz <- function(m){
#m is the matrix of the data obtained through the THz imaging
m <- as.matrix(m)
colnames(m) <- 1:ncol(m)
row.names(m) <- 1:nrow(m)
m <- reshape2::melt(m)
names(m) <- c("Y","X","Val")
m$Y <- as.numeric(m$Y)
m$X <- as.numeric(m$X)
ggplot2::ggplot(data = m, ggplot2::aes(x = X, y = Y, fill = Val))+
ggplot2::geom_tile()
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matrixlineextractions.R
\name{extractmatline_even}
\alias{extractmatline_even}
\title{Function for extracting the even-numbered lines of a matrix.}
\usage{
extractmatline_even(m)
}
\arguments{
\item{m}{A matrix object}
}
\value{
The same matrix without the values of its odd-numbered lines
}
\description{
A function for extracting the even-numbered lines (2,4,6,etc.) of a matrix
}
\examples{
m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
m_evenlines <- extractmatline_even(m)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matrixlineextractions.R
\name{extractmatline_odd}
\alias{extractmatline_odd}
\title{Function for extracting the odd-numbered lines of a matrix.}
\usage{
extractmatline_odd(m)
}
\arguments{
\item{m}{A matrix object}
}
\value{
The same matrix without the values of its even-numbered lines
}
\description{
A function for extracting the odd-numbered lines (1,3,5,etc.) of a matrix
}
\examples{
m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
m_oddlines <- extractmatline_odd(m)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matrixlineextractions.R
\name{extrairematligne_even}
\alias{extrairematligne_even}
\title{Function for extracting the even-numbered lines of a matrix.}
\usage{
extrairematligne_even(m)
}
\arguments{
\item{m}{A matrix object}
}
\value{
The same matrix without the values of its odd-numbered lines
}
\description{
A function for extracting the even-numbered lines (2,4,6,etc.) of a matrix
}
\examples{
m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
m_evenlines <- extrairematligne_even(m)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matrixlineextractions.R
\name{extrairematligne_odd}
\alias{extrairematligne_odd}
\title{Function for extracting the odd-numbered lines of a matrix.}
\usage{
extrairematligne_odd(m)
}
\arguments{
\item{m}{A matrix object}
}
\value{
The same matrix without the values of its even-numbered lines
}
\description{
A function for extracting the odd-numbered lines (1,3,5,etc.) of a matrix
}
\examples{
m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
m_oddlines <- extrairematligne_odd(m)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plottingfunctions.R
\name{plotTHz}
\alias{plotTHz}
\title{Function for visualizing the THz image matrix using ggplot2}
\usage{
plotTHz(m)
}
\arguments{
\item{m}{THz matrix data, obtained through the THz scan}
}
\value{
An imaging of said matrix
}
\description{
A wrapper for ggplot() function, useful for visualizing the THz matrix data quickly.
}
\examples{
m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
plotTHz(m)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plottingfunctions.R
\name{plotlyTHz}
\alias{plotlyTHz}
\title{Function for visualizing the THz image matrix using plotly}
\usage{
plotlyTHz(m)
}
\arguments{
\item{m}{THz matrix data, obtained through the THz scan}
}
\value{
An imaging of said matrix
}
\description{
A wrapper for plot_ly() function, useful for visualizing the THz matrix data quickly.
}
\examples{
m <- matrix(rnorm(100, mean = 0, sd = 1), nrow = 10, ncol = 10)
plotlyTHz(m)
}
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
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