C Library Functions  - subset (3)

NAME

subset(3f) - [M_datapac:VECTOR_OPERATION] extract the elements of a vector which fall into a user-specified subset (one subset variable)

CONTENTS

Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License

SYNOPSIS

SUBROUTINE SUBSET(X,N,D,Dmin,Dmax,Newn)

     REAL(kind=wp) :: D(:), Dmax ,Dmin, X(:)
     INTEGER       :: N , Newn

DESCRIPTION

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.

INPUT ARGUMENTS

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.

OUTPUT ARGUMENTS

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.

EXAMPLES

Sample program:

   program demo_subset
   use M_datapac, only : subset
   implicit none
   ! call subset(x,y)
   end program demo_subset

Results:

AUTHOR

The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.

MAINTAINER

John Urban, 2022.05.31

LICENSE

CC0-1.0


Nemo Release 3.1 subset (3) July 22, 2023
Generated by manServer 1.08 from 915b96a8-96b9-4d27-933a-a85c218f539f using man macros.