subset(3f) - [M_datapac:VECTOR_OPERATION] extract the elements of a vector which fall into a user-specified subset (one subset variable)
Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
SUBROUTINE SUBSET(X,N,D,Dmin,Dmax,Newn)
REAL(kind=wp) :: D(:), Dmax ,Dmin, X(:) INTEGER :: N , Newn
This subroutine retains all observations in the vector X for which the corresponding elements in the vector D are inside the closed (inclusive) interval defined by DMIN and DMAX, while deleting all observations in X corresponding to elements of D outside of this interval.
Thus all observations in X which correspond to elements in D which are smaller than DMIN or larger than DMAX are deleted from X.
The use of subset(3f) gives the data analyst the capability to easily extract subsets of the data prior to data analysis on each subset.
x the vector of (unsorted or sorted) observations. n the integer number of observations in the vector x. d the vector which defines the various possible subsets of x. dmin the value which defines the lower limit (inclusively) of the particular subset of interest to be retained. dmax the value which defines the upper limit (inclusively) of the particular subset of interest to be retained.
newn the integer number of observations remaining (retained) in x after all of the observations in x have been deleted which correspond to values in the vector d outside the interval of interest.
Sample program:
program demo_subset use M_datapac, only : subset implicit none ! call subset(x,y) end program demo_subsetResults:
The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.
John Urban, 2022.05.31
CC0-1.0
Nemo Release 3.1 | subset (3) | February 23, 2025 |