segment.complement: Complement of Investment Segments

Description Usage Arguments Details Value Author(s) Examples

Description

This function returns a vector of investments that are in a portfolio with n investments but not in the given investment segments

Usage

1

Arguments

n

A positive integer for the number of investments in a portfolio

segments

A vector or list of vectors that defines the investment segments

Details

If the investments in the given segment are for the entire portfolio, a NULL value is returned. If the segments argument is NULL, then the entire portfolio of n investments is returned.

Value

A vector of investments or a NULL value.

Author(s)

Frederick Novomestky fn334@nyu.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
###
### define the segments
###
    I <- list()
    I[[1]] <- c( 1, 2, 3 )
    I[[2]] <- c( 4, 5 )
    I[[3]] <- c( 6, 7 )
    I[[4]] <- c( 8, 9, 10 )
    segment.complement( 10, I )
    segment.complement( 10, NULL )
    segment.complement( 10, I[[1]] )
    segment.complement( 10, I[[2]] )
    segment.complement( 10, I[[3]] )
    segment.complement( 10, I[[4]] )

rportfolios documentation built on May 2, 2019, 3:40 p.m.