Skip to content
Extraits de code Groupes Projets
Valider 06eccb71 rédigé par Michel Crucifix's avatar Michel Crucifix
Parcourir les fichiers

address check warnings

parent 2cafbcda
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
.gitignore .gitignore
test test
man_old old_man
^data-raw$ ^data-raw$
.Rprofile .Rprofile
TODO TODO
......
Package: gtseries Package: gtseries
Type: Package Type: Package
Title: Time Series analysis for paleoclimate and cyclostrat purposes Title: Time Series analysis for paleoclimate and cyclostrat purposes
Version: 1.05-pre Version: 1.05
Date: 2023-26-10 Date: 2023-26-10
Author: Michel Crucifix [aut, cre] (<https://orcid.org/0000-0002-3437-4911>) Author: Michel Crucifix [aut, cre] (<https://orcid.org/0000-0002-3437-4911>)
Maintainer: Michel Crucifix <michel.crucifix@uclouvain.be> Maintainer: Michel Crucifix <michel.crucifix@uclouvain.be>
Description: More about what it does (maybe more than one line) Description: Collection of time series analysis tools, focused on spectral decomposition and reconstruction, with an original focus on astronomical theory of paleoclimates and cyclostratigraphy.
License: What license is it under? License: MIT licence
LazyLoad: yes LazyLoad: yes
RoxygenNote: 7.2.3 RoxygenNote: 7.2.3
Imports: Rdpack, sfsmisc Imports: Rdpack, sfsmisc
......
...@@ -11,14 +11,24 @@ export(mfft) ...@@ -11,14 +11,24 @@ export(mfft)
export(powerspectrum.wavelet) export(powerspectrum.wavelet)
export(ssa) export(ssa)
importFrom(Rdpack,reprompt) importFrom(Rdpack,reprompt)
importFrom(graphics,axis)
importFrom(graphics,image)
importFrom(graphics,lines)
importFrom(graphics,mtext) importFrom(graphics,mtext)
importFrom(graphics,par)
importFrom(graphics,text)
importFrom(sfsmisc,axTexpr) importFrom(sfsmisc,axTexpr)
importFrom(sfsmisc,eaxis) importFrom(sfsmisc,eaxis)
importFrom(stats,ar) importFrom(stats,ar)
importFrom(stats,as.ts) importFrom(stats,as.ts)
importFrom(stats,coef) importFrom(stats,coef)
importFrom(stats,deltat)
importFrom(stats,fft) importFrom(stats,fft)
importFrom(stats,lm)
importFrom(stats,qnorm)
importFrom(stats,runif) importFrom(stats,runif)
importFrom(stats,start) importFrom(stats,start)
importFrom(stats,time) importFrom(stats,time)
importFrom(stats,toeplitz)
importFrom(stats,ts)
useDynLib(gtseries) useDynLib(gtseries)
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
## Wavelets : theory and applications, Erlenbacher et al. eds, Oxford University Press 1996 ## Wavelets : theory and applications, Erlenbacher et al. eds, Oxford University Press 1996
col_wavelet <- colorRampPalette(c('darkblue','lightblue','grey','white','red'))(100) col_wavelet <- colorRampPalette(c('darkblue','lightblue','grey','white','red'))(100)
search_ridge <- function (A,first_guess,k0=5.6,tol=1e-6, itmax=20,B=seq(along=A),window=c(0,Inf)) search_ridge <- function (A,first_guess,k0=5.6,tol=1e-6, itmax=20,B=seq(along=A),window=c(0,Inf))
...@@ -120,8 +122,8 @@ cross_morlet <- function(A, B, ...) ...@@ -120,8 +122,8 @@ cross_morlet <- function(A, B, ...)
#' Continous Morlet Wavelet Transform #' Continous Morlet Wavelet Transform
#' @importFrom stats fft #' @importFrom stats fft deltat lm qnorm toeplitz ts time
#' @importFrom stats time #' @importFrom graphics axis image lines par text
#' @export cwt_morlet #' @export cwt_morlet
cwt_morlet <- function (A,inter=20,k0=5.6,amin=1,amax=Inf,calcmask=TRUE,scale=NA,deriv=FALSE) cwt_morlet <- function (A,inter=20,k0=5.6,amin=1,amax=Inf,calcmask=TRUE,scale=NA,deriv=FALSE)
{ {
...@@ -200,20 +202,20 @@ cwt_morlet <- function (A,inter=20,k0=5.6,amin=1,amax=Inf,calcmask=TRUE,scale=NA ...@@ -200,20 +202,20 @@ cwt_morlet <- function (A,inter=20,k0=5.6,amin=1,amax=Inf,calcmask=TRUE,scale=NA
#' @rdname cwt_morlet #' @rdname cwt_morlet
#' @export #' @export
plot.wavelet <- function (wave,resx=400,resy=300,xlab="Time",ylab="Period",scaling_correction=0,col=col_wavelet,legend=FALSE,Mode=Mod,plotMask=TRUE,...) plot.wavelet <- function (x,resx=400,resy=300,xlab="Time",ylab="Period",scaling_correction=0,col=col_wavelet,legend=FALSE,Mode=Mod,plotMask=TRUE,...)
{ {
require(fields) require(fields)
xx <- attr(wave,"time") xx <- attr(x,"time")
period <- attr(wave,"period") period <- attr(x,"period")
mask <- attr(wave,"mask") mask <- attr(x,"mask")
if (!plotMask) mask[,] = 1 # do not hide influence cone if (!plotMask) mask[,] = 1 # do not hide influence cone
aa <- attr(wave,"scale") aa <- attr(x,"scale")
thin_factor_xx <- max(ceiling(length(xx)/ resx),1) thin_factor_xx <- max(ceiling(length(xx)/ resx),1)
thin_factor_yy <- max(ceiling(length(aa)/ resy),1) thin_factor_yy <- max(ceiling(length(aa)/ resy),1)
subx <- seq(thin_factor_xx,length(xx),thin_factor_xx) subx <- seq(thin_factor_xx,length(xx),thin_factor_xx)
suba <- seq(thin_factor_yy,length(aa),thin_factor_yy) suba <- seq(thin_factor_yy,length(aa),thin_factor_yy)
wave_scaled <- Mode(wave[subx,suba])*mask[subx,suba] wave_scaled <- Mode(x[subx,suba])*mask[subx,suba]
for (i in 1:length(suba)) wave_scaled[,i] <- wave_scaled[,i]/(aa[i]^scaling_correction) for (i in 1:length(suba)) wave_scaled[,i] <- wave_scaled[,i]/(aa[i]^scaling_correction)
if (legend) par(oma=c(2,2,2,5)) if (legend) par(oma=c(2,2,2,5))
image(xx[subx],period[suba],wave_scaled,log="y",ylab=ylab,xlab=xlab,axes=FALSE,col=col,...) image(xx[subx],period[suba],wave_scaled,log="y",ylab=ylab,xlab=xlab,axes=FALSE,col=col,...)
......
...@@ -39,10 +39,10 @@ mem <- function (A,method='burg',order.max=90,...) { ...@@ -39,10 +39,10 @@ mem <- function (A,method='burg',order.max=90,...) {
#' @rdname mem #' @rdname mem
#' @export #' @export
plot.memObject <- function (memObject,period=FALSE,xaxp=NULL,yaxp=NULL,...) plot.memObject <- function (x,period=FALSE,xaxp=NULL,yaxp=NULL,...)
{ {
plot(memObject$frequency,memObject$power, plot(x$frequency,x$power,
frame=FALSE,axes=FALSE,log="xy",type="l",xlab="",ylab="Power density",...) frame=FALSE,axes=FALSE,log="xy",type="l",xlab="",ylab="Power density",...)
local({ local({
if (is.null(yaxp)) {yaxp <- par("yaxp"); yaxp[3] <- 1; par(yaxp=yaxp)} if (is.null(yaxp)) {yaxp <- par("yaxp"); yaxp[3] <- 1; par(yaxp=yaxp)}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#' @param X the input series (typically a numeric) #' @param X the input series (typically a numeric)
#' @param N if provided, the length of the input series to beconsiderd #' @param N if provided, the length of the input series to beconsiderd
#' @param M the length of the sliding window #' @param M the length of the sliding window
#' @param Nrec: number of components to be output #' @param Nrec number of components to be output
#' @importFrom sfsmisc axTexpr #' @importFrom sfsmisc axTexpr
#' @importFrom sfsmisc eaxis #' @importFrom sfsmisc eaxis
...@@ -157,9 +157,9 @@ ssa <- function(X=X,N=length(X),M=M,Nrec=10) { ...@@ -157,9 +157,9 @@ ssa <- function(X=X,N=length(X),M=M,Nrec=10) {
#' @rdname ssa #' @rdname ssa
#' @export #' @export
plot.SSAObject <- function (SSAObject,...) plot.SSAObject <- function (x,...)
{ {
Nrec = length(SSAAbject$LA) Nrec = length(x$LA)
yat <- outer(seq(1:Nrec),10^(seq(-3,5)),"*") yat <- outer(seq(1:Nrec),10^(seq(-3,5)),"*")
ylab <- 10^(-2:5) ylab <- 10^(-2:5)
...@@ -168,7 +168,7 @@ plot.SSAObject <- function (SSAObject,...) ...@@ -168,7 +168,7 @@ plot.SSAObject <- function (SSAObject,...)
substitute(10^E, list(E=log10(ylab[i])))) substitute(10^E, list(E=log10(ylab[i]))))
S <- do.call("expression",ss) S <- do.call("expression",ss)
plot(SSAObject$lambda,frame=T,axes=F,log="y",xlab="rank",ylab="Eigenvalue",...) plot(x$lambda,frame=T,axes=F,log="y",xlab="rank",ylab="Eigenvalue",...)
axis(1,xlab="rank") axis(1,xlab="rank")
axis(2,at=yat,ylab="Eigenvalue",labels=F) axis(2,at=yat,ylab="Eigenvalue",labels=F)
axis(2,at=ylab,labels=axTexpr(1,at=ylab),tick=F,las=1) axis(2,at=ylab,labels=axTexpr(1,at=ylab),tick=F,las=1)
......
## gtseries
Collection of time series analysis tools for R, focused on spectral decomposition
and reconstruction, with an original focus on astronomical theory of paleoclimates and
cyclostratigraphy.
#!/bin/sh #! /bin/sh
for f in ./config.* autom4te.cache/; do
rm -f config.* src/Makevars src/config.h rm -rf $f
done
if [ -e src/Makevars ]; then
rm -f src/Makevars
fi
exit 0
AC_INIT
# Ensure C++ is set up as R expects
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
AC_MSG_ERROR([Could not determine R_HOME.])
fi
CC=`"${R_HOME}/bin/R" CMD config CC`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
AC_PROG_CC
AC_CONFIG_SRCDIR([src/airy.c])
#AC_CHECK_LIB(gsl, gsl_sf_airy_Ai_e,
# [LIBS="${LIBS} -lgsl -lgslcblas"],
# [AC_MSG_ERROR([Cannot find Gnu Scientific Library.])],
# [-lgslcblas])
#AC_CHECK_HEADER([gsl/gsl_version.h], ,
# [AC_MSG_ERROR([Cannot find GSL headers.])])
# Following lines kindly supplied by Dirk Eddelbuettel
## Use gsl-config to find arguments for compiler and linker flags
##
## Check for non-standard programs: gsl-config(1)
AC_PATH_PROG([GSL_CONFIG], [gsl-config])
## If gsl-config was found, let's use it
if test "${GSL_CONFIG}" != ""; then
# Use gsl-config for header and linker arguments
GSL_CFLAGS=`${GSL_CONFIG} --cflags`
GSL_LIBS=`${GSL_CONFIG} --libs`
CFLAGS="$CFLAGS $GSL_CFLAGS" # kindly supplied by Ray Brownrigg
else
AC_MSG_ERROR([gsl-config not found, is GSL installed?])
fi
AC_MSG_CHECKING([if GSL version >= 2.5])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
#include <gsl/gsl_version.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
#ifdef GSL_VERSION
int major, minor;
char *gslv = GSL_VERSION;
if ((sscanf(gslv, "%d.%d", &major, &minor)) != 2) {
exit (1);
}
exit (minor < 5);
exit (major < 2);
#else
exit(1);
#endif
}
]])],
[gsl_version_ok=yes],
[gsl_version_ok=no],
[gsl_version_ok=yes])
if test "${gsl_version_ok}" = no; then
AC_MSG_ERROR([Need GSL version >= 2.5])
else
AC_MSG_RESULT([yes])
fi
# Now substitute these variables in src/Makevars.in to create src/Makevars
AC_SUBST(GSL_CFLAGS)
AC_SUBST(GSL_LIBS)
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
editor = {}, editor = {},
year = {1997}, year = {1997},
title = {Frequency Modified Fourier Transform and its Application to Asteroids}, title = {Frequency Modified Fourier Transform and its Application to Asteroids},
pages = {137148}, pages = {137-148},
journal = {The Dynamical Behaviour of our Planetary System}, journal = {The Dynamical Behaviour of our Planetary System},
doi = {10.1007/978-94-011-5510-6_9}, doi = {10.1007/978-94-011-5510-6_9},
url = {http://dx.doi.org/10.1007/978-94-011-5510-6_9}, url = {http://dx.doi.org/10.1007/978-94-011-5510-6_9},
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
isbn = {9783030260507}, isbn = {9783030260507},
} }
@article{pardoiguzquiza06aa, @article{pardoiguzquiza06aa,
author = {PardoIgúzquiza, E. and RodríguezTovar, F. J. }, author = {Pardo-Igúzquiza, E. and Rodríguez-Tovar, F. J. },
editor = {}, editor = {},
year = {2006}, year = {2006},
title = {Maximum entropy spectral analysis of climatic time series revisited: Assessing the statistical significance of estimated spectral peaks}, title = {Maximum entropy spectral analysis of climatic time series revisited: Assessing the statistical significance of estimated spectral peaks},
......
...@@ -18,7 +18,7 @@ cwt_morlet( ...@@ -18,7 +18,7 @@ cwt_morlet(
) )
\method{plot}{wavelet}( \method{plot}{wavelet}(
wave, x,
resx = 400, resx = 400,
resy = 300, resy = 300,
xlab = "Time", xlab = "Time",
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
\usage{ \usage{
mem(A, method = "burg", order.max = 90, ...) mem(A, method = "burg", order.max = 90, ...)
\method{plot}{memObject}(memObject, period = FALSE, xaxp = NULL, yaxp = NULL, ...) \method{plot}{memObject}(x, period = FALSE, xaxp = NULL, yaxp = NULL, ...)
} }
\arguments{ \arguments{
\item{A}{input, a time-series object} \item{A}{input, a time-series object}
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
\usage{ \usage{
ssa(X = X, N = length(X), M = M, Nrec = 10) ssa(X = X, N = length(X), M = M, Nrec = 10)
\method{plot}{SSAObject}(SSAObject, ...) \method{plot}{SSAObject}(x, ...)
} }
\arguments{ \arguments{
\item{X}{the input series (typically a numeric)} \item{X}{the input series (typically a numeric)}
...@@ -16,7 +16,7 @@ ssa(X = X, N = length(X), M = M, Nrec = 10) ...@@ -16,7 +16,7 @@ ssa(X = X, N = length(X), M = M, Nrec = 10)
\item{M}{the length of the sliding window} \item{M}{the length of the sliding window}
\item{Nrec:}{number of components to be output} \item{Nrec}{number of components to be output}
} }
\value{ \value{
a SSA object, compatible with the supplied plot function a SSA object, compatible with the supplied plot function
......
# Kindly supplied by Dirk Eddelbuettel
# set by configure
GSL_CFLAGS = -I/usr/local/include
GSL_LIBS = -L/usr/local/lib -lgsl -lgslcblas -lm
# combine to standard arguments for R
PKG_CPPFLAGS = $(GSL_CFLAGS) -I.
PKG_LIBS = $(GSL_LIBS)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter