digi | R Documentation |
1. This function returns a 2 column dataframe with columns X and Y.
2. The Y column is mostly 1( inv = F (default)) or 0( inv = T) with specific *windows* wherein the function is toggled in the opposite direction .
3. These *windows* are defined by the *win_df* dataframe called a window dataframe
digi(X, win_df = win_d, inv = T)
digi(X, win_df = win_d, inv = F)
digi(X, win_df = win_d)
X |
The X axis values for which the Y values need to be defined |
win_df |
1. This is referred to as the *windows* dataframe. |
inv |
1. A boolean bit, set to FALSE by deafult. |
The returned value is a 2 column dataframe with names 'X' and 'Y'
Chitran Ghosal
#Let's create a sequence within X = 0 and X = 20 with windows at (12, 14) and (18, 19)
X <- seq(10, 20, by = 0.01)
win_d <- data.frame(c(12, 18), c(14, 19))
names(win_d) <- c('min', 'max')
#Call the digi function
df <- digi(X, win_df = win_d)
df1 <- digi(X, win_df = win_d, inv = T)
#plot the data
subplot(c(2,1))
plot(df$X, df$Y, type = 'l', col = 'red')
plot(df1$X, df1$Y, type = 'l', col = 'blue')
subplot(c(1,1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.