knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(tibble)
library(dplyr)
library(ggplot2)
library(svglite)
library(here)

len = 51
#Ensure that len is even
len = len + len%%2

intensities = c(rep(6,len/2),rep(3,len/2))
obs = rpois(n = len, lambda = intensities)

tib = tibble(x = 1:len, intensities, obs)
by_intense = tib %>%
  group_by(intensities)

first_grp <- by_intense %>%
  filter(intensities == 6)

second_grp <- by_intense %>%
  filter(intensities == 3)

p = ggplot(by_intense, aes( x = x , y = obs , color = as.character(intensities) ) ) +
  geom_point() +
  geom_line(data = first_grp ,aes(x = x , y = intensities , color = as.character(intensities) )) +
  geom_line(data = second_grp ,aes(x = x , y = intensities , color = as.character(intensities) )) +
  expand_limits(y = 0) +
  theme(axis.line=element_blank(),axis.text.x=element_blank(),
          axis.text.y=element_blank(),axis.ticks=element_blank(),
          axis.title.x=element_blank(),
          axis.title.y=element_blank(),legend.position="none",
          panel.grid.minor=element_blank(),plot.background=element_blank(),
          panel.border = element_rect(colour = "black", fill=NA, size=5))

 logo = p + annotate("text", x=len/3, y=7, label= "change", size = 16 , color = "#55BCC2" ) + 
   annotate("text", x=len*0.6, y=4, label= "POI", size = 16 , color = "coral1" ) +
   annotate("text", x=len*0.763, y=4, label= "sso", size = 16 ) + 
   annotate("text", x=len*0.91, y=4, label= "NT", size = 16 , color = "coral1") +
   xlim(8, len) +
   ylim(0,10) 
   #theme( panel.border = element_rect(colour = "black", fill=NA, size=5) )

ggsave(file=here("man","figures","logo.svg"), plot=logo, width=6, height=4)

changePOIssoNT changePOIssoNT logo

Overview

changePOIssoNT is a package for detecting changepoints in 1-dimensional poisson count data.

summary(cars)

Installation

Usage

Learning changePOIssoNT

Getting help



lewkrr/changePOIssoNT documentation built on May 25, 2019, 9:31 p.m.