library(rsconnect)
library(Biobase)
## Loading required package: BiocGenerics
## Loading required package: parallel
##
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
##
## clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
## clusterExport, clusterMap, parApply, parCapply, parLapply,
## parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
##
## anyDuplicated, append, as.data.frame, basename, cbind,
## colMeans, colnames, colSums, dirname, do.call, duplicated,
## eval, evalq, Filter, Find, get, grep, grepl, intersect,
## is.unsorted, lapply, lengths, Map, mapply, match, mget, order,
## paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind,
## Reduce, rowMeans, rownames, rowSums, sapply, setdiff, sort,
## table, tapply, union, unique, unsplit, which, which.max,
## which.min
## Welcome to Bioconductor
##
## Vignettes contain introductory material; view with
## 'browseVignettes()'. To cite Bioconductor, see
## 'citation("Biobase")', and for packages 'citation("pkgname")'.
library(SafeQuant)
library(Ringo)
## Loading required package: RColorBrewer
## Warning: package 'RColorBrewer' was built under R version 3.5.2
## Loading required package: limma
##
## Attaching package: 'limma'
## The following object is masked from 'package:BiocGenerics':
##
## plotMA
## Loading required package: Matrix
## Loading required package: grid
## Loading required package: lattice
## Warning: package 'lattice' was built under R version 3.5.2
library(dplyr)
##
## Attaching package: 'dplyr'
## The following object is masked from 'package:Biobase':
##
## combine
## The following objects are masked from 'package:BiocGenerics':
##
## combine, intersect, setdiff, union
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
library(gridExtra)
## Warning: package 'gridExtra' was built under R version 3.5.2
##
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
##
## combine
## The following object is masked from 'package:Biobase':
##
## combine
## The following object is masked from 'package:BiocGenerics':
##
## combine
library(tweenr)
## Warning: package 'tweenr' was built under R version 3.5.2
library(plotly)
## Warning: package 'plotly' was built under R version 3.5.2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:SafeQuant':
##
## export
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(ggdendro)
## Warning: package 'ggdendro' was built under R version 3.5.2
library(ape)
## Warning: package 'ape' was built under R version 3.5.2
library(RColorBrewer)
library(gplots)
## Warning: package 'gplots' was built under R version 3.5.2
##
## Attaching package: 'gplots'
## The following object is masked from 'package:stats':
##
## lowess
library(graphics)
library(lattice)
library(Rmpfr)
## Warning: package 'Rmpfr' was built under R version 3.5.2
## Loading required package: gmp
## Warning: package 'gmp' was built under R version 3.5.2
##
## Attaching package: 'gmp'
## The following objects are masked from 'package:Matrix':
##
## crossprod, tcrossprod
## The following objects are masked from 'package:base':
##
## %*%, apply, crossprod, matrix, tcrossprod
## C code of R package 'Rmpfr': GMP using 64 bits per limb
##
## Attaching package: 'Rmpfr'
## The following objects are masked from 'package:BiocGenerics':
##
## cbind, pmax, pmin, rbind
## The following objects are masked from 'package:stats':
##
## dbinom, dnorm, dpois, pnorm
## The following objects are masked from 'package:base':
##
## cbind, pmax, pmin, rbind
library(HH)
## Warning: package 'HH' was built under R version 3.5.2
## Loading required package: latticeExtra
## Warning: package 'latticeExtra' was built under R version 3.5.2
##
## Attaching package: 'latticeExtra'
## The following object is masked from 'package:ggplot2':
##
## layer
## Loading required package: multcomp
## Warning: package 'multcomp' was built under R version 3.5.2
## Loading required package: mvtnorm
## Warning: package 'mvtnorm' was built under R version 3.5.2
## Loading required package: survival
## Loading required package: TH.data
## Warning: package 'TH.data' was built under R version 3.5.2
## Loading required package: MASS
## Warning: package 'MASS' was built under R version 3.5.2
##
## Attaching package: 'MASS'
## The following object is masked from 'package:plotly':
##
## select
## The following object is masked from 'package:dplyr':
##
## select
##
## Attaching package: 'TH.data'
## The following object is masked from 'package:MASS':
##
## geyser
##
## Attaching package: 'HH'
## The following object is masked from 'package:gplots':
##
## residplot
library(lawstat)
## Warning: package 'lawstat' was built under R version 3.5.2
## Loading required package: Kendall
## Warning: package 'Kendall' was built under R version 3.5.2
## Loading required package: VGAM
## Warning: package 'VGAM' was built under R version 3.5.2
## Loading required package: stats4
## Loading required package: splines
##
## Attaching package: 'VGAM'
## The following object is masked from 'package:HH':
##
## logit
## The following objects are masked from 'package:Rmpfr':
##
## erf, erfc, zeta
library(agricolae)
## Warning: package 'agricolae' was built under R version 3.5.2
##
## Attaching package: 'agricolae'
## The following object is masked from 'package:ape':
##
## consensus
library(MASS)
library(gapminder)
## Warning: package 'gapminder' was built under R version 3.5.2
library(highcharter)
## Warning: package 'highcharter' was built under R version 3.5.2
## Highcharts (www.highcharts.com) is a Highsoft software product which is
## not free for commercial and Governmental use
library(readxl)
PS <- read_excel("N:/TSever/20181218_vsaka_frakcija_scx_posebaj_kidney_ko+wt/combined/txt/Phospho (STY)Sites.xlsx")
#View(PS)
library(readr)
## Warning: package 'readr' was built under R version 3.5.2
Phospho_STY_Sites <- read_delim("N:/TSever/20181218_vsaka_frakcija_scx_posebaj_kidney_ko+wt/combined/txt/Phospho (STY)Sites.txt",
"\t", escape_double = FALSE, trim_ws = TRUE)
## Parsed with column specification:
## cols(
## .default = col_logical(),
## Proteins = col_character(),
## `Positions within proteins` = col_character(),
## `Leading proteins` = col_character(),
## Protein = col_character(),
## `Fasta headers` = col_character(),
## `Localization prob` = col_double(),
## `Score diff` = col_double(),
## PEP = col_double(),
## Score = col_double(),
## `Delta score` = col_double(),
## `Score for localization` = col_double(),
## `Localization prob KO_015` = col_double(),
## `Score diff KO_015` = col_double(),
## `PEP KO_015` = col_double(),
## `Score KO_015` = col_double(),
## `Localization prob WT_000` = col_double(),
## `Score diff WT_000` = col_double(),
## `PEP WT_000` = col_double(),
## `Score WT_000` = col_double(),
## `Localization prob WT_035` = col_double()
## # ... with 193 more columns
## )
## See spec(...) for full column specifications.
#View(Phospho_STY_Sites)
KO_005 <-rowMeans(Phospho_STY_Sites[c('Intensity KO_005' )])
ggplot(Phospho_STY_Sites, aes(Phospho_STY_Sites$`Intensity WT_000`)) +
geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

a <- data.frame(intensity = c(0, 0, 192040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 348255787, 0, 0, 0, 0, 0, 715160, 0, 0, 5337080, 0, 0, 0, 0, 0))
a[,2]<- c('Intensity KO_005', 'Intensity KO_010', 'Intensity KO_015', 'Intensity KO_020', 'Intensity KO_025', 'Intensity KO_030', 'Intensity KO_035', 'Intensity KO_040', 'Intensity KO_045', 'Intensity KO_050','Intensity KO_060', 'Intensity KO_070', 'Intensity KO_080', 'Intensity KO_090', 'Intensity KO_100', 'Intensity WT_000', 'Intensity Wt_010', 'Intensity WT_015', 'Intensity WT_020', 'Intensity WT_025', 'Intensity WT_030', 'Intensity WT_035', 'Intensity WT_040', 'Intensity WT_045', 'Intensity WT_050', 'Intensity WT_060', 'Intensity WT_070', 'Intensity WT_080', 'Intensity WT_090', 'Intensity WT_100')
Phospho_STY_Sites2<- filter(Phospho_STY_Sites,
Score > 40)
Phospho_STY_Sites2<- filter(Phospho_STY_Sites2,
`Localization prob` > 0.75)
Phospho_STY_Sites2 <-Phospho_STY_Sites2 [ ! (Phospho_STY_Sites2$Reverse %in% '+'), ]
Phospho_STY_Sites2 <-Phospho_STY_Sites2 [ ! (Phospho_STY_Sites2$`Potential contaminant` %in% '+'), ]
wt000<-
ggplot(Phospho_STY_Sites2, aes(`Intensity WT_000`, 1:length(Score))) +
geom_point(color='#77b800', size=2)+
labs(y='Leading protein')+
scale_y_continuous(breaks=c(1:88),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))
wt000

ggplot(Phospho_STY_Sites2, aes( 1:length(Score),`Intensity WT_000`)) +
geom_line(color='#77b800', size=0.7)+
labs(y='Leading protein')+
scale_x_continuous(breaks=c(1:88),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
#coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))

plot(Phospho_STY_Sites2$`Intensity WT_000`, 1:88)

wt050<-
ggplot(Phospho_STY_Sites2, aes(`Intensity WT_050`, 1:length(Score))) +
geom_point(color='#77b800')+
labs(y='Leading protein')+
scale_y_continuous(breaks=c(1:length(Phospho_STY_Sites2$`Leading proteins`)),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))
wt010<-
ggplot(Phospho_STY_Sites2, aes(`Intensity WT_010`, 1:length(Score))) +
geom_point(color='#77b800', size=2)+
labs(y='Leading protein')+
scale_y_continuous(breaks=c(1:length(Phospho_STY_Sites2$`Leading proteins`)),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))
wt015<-
ggplot(Phospho_STY_Sites2, aes(`Intensity WT_015`, 1:length(Score))) +
geom_point(color='#77b800', size=2)+
labs(y='Leading protein')+
scale_y_continuous(breaks=c(1:length(Phospho_STY_Sites2$`Leading proteins`)),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
coord_flip()+
theme_minimal()+
theme(axis.text.x=element_text(angle=80, hjust=1))
wt_unique<-c(
length(unique(c(Phospho_STY_Sites2$`Intensity WT_000`))),
1,
length(unique(c(Phospho_STY_Sites2$`Intensity Wt_010`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_015`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_020`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_025`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_030`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_035`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_040`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_045`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_050`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_060`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_070`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_080`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_090`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_100`)))
)-1
ko_unique<-c(
1,
length(unique(c(Phospho_STY_Sites2$`Intensity KO_005`))),
length(unique(c(Phospho_STY_Sites2$`Intensity KO_010`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_015`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_020`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_025`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_030`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_035`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_040`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_045`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_050`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_060`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_070`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_080`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_090`))),
length(unique(c(Phospho_STY_Sites2$`Intensity WT_100`)))
)-1
ggplot()+
geom_bar(stat='identity',
aes(1:length(wt_unique),wt_unique), fill='#00cfcf', alpha=0.5, size=1.5)+
geom_bar(stat='identity',
aes(1:length(wt_unique),ko_unique), fill='#cf0000', alpha=0.5, size=1.5)+
theme_light()+
scale_x_continuous(breaks = c(1:length(ko_unique)),
labels=c('0 M','0.05 M','0.10 M','0.15 M', '0.20 M', '0.25 M', '0.30 M', '0.35 M', '0.40 M', '0.45 M', '0.50 M', '0.60 M', '0.70 M', '0.80 M', '0.90 M',' 1 M' ))+
labs(x='NaCl fraction', y='number of proteins')+
theme(legend.position = 'right')+
ggtitle('number of phophoprylated protein in each scx fraction')+
ylim(0,90)+
theme(plot.title = element_text(hjust=0.5))+
geom_rect(aes(xmin=13, xmax=16, ymin=60,ymax=83),color='#000000', fill='#ffffff', alpha=1)+
geom_rect(aes(xmin=13.5, xmax=14, ymin=63,ymax=66),color='#000000', fill='#00cfcf', alpha=0.5)+
geom_rect(aes(xmin=13.5, xmax=14, ymin=70,ymax=73),color='#000000', fill='#cf0000', alpha=0.5)+
geom_rect(aes(xmin=13.5, xmax=14, ymin=77,ymax=80),color='#000000', fill='#844B4B', alpha=0.5)+
annotate("text", x = 15, y = 65, label = "WT",color='#000000')+
annotate("text", x = 15, y = 72, label = "KO",color='#000000')+
annotate("text", x = 15, y = 79, label = "overlap",color='#000000')+
theme(axis.text.x=element_text(angle=45, hjust=1))

#ggsave("haha.pdf")
multiplot <- function(..., plotlist = NULL, file, cols = 1, layout = NULL) {
require(grid)
plots <- c(list(...), plotlist)
numPlots = length(plots)
if (is.null(layout)) {
layout <- matrix(seq(1, cols * ceiling(numPlots/cols)),
ncol = cols, nrow = ceiling(numPlots/cols))
}
if (numPlots == 1) {
print(plots[[1]])
} else {
grid.newpage()
pushViewport(viewport(layout = grid.layout(nrow(layout), ncol(layout))))
for (i in 1:numPlots) {
matchidx <- as.data.frame(which(layout == i, arr.ind = TRUE))
print(plots[[i]], vp = viewport(layout.pos.row = matchidx$row,
layout.pos.col = matchidx$col))
}
}
}
wk1<-
ggplot(Phospho_STY_Sites2, aes( 1:length(Score),`Intensity WT_000`)) +
geom_line(color='#77b800', size=0.7)+
labs(y='Leading protein')+
scale_x_continuous (breaks=c(1:length(Phospho_STY_Sites2$`Leading proteins`)),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
theme_classic()+
theme(axis.text.x=element_text(angle=80, hjust=1))+
geom_line(aes( 1:length(Score),`Intensity WT_035`), color='#EC0030')+
geom_line(aes( 1:length(Score),`Intensity WT_050`), color='#07B1BC')+
geom_line(aes( 1:length(Score),`Intensity KO_035`), color='#AB00FF')+
geom_line(aes( 1:length(Score),`Intensity KO_050`), color='#FB6277')
wk2<-
ggplot(Phospho_STY_Sites2, aes( 1:length(Score),`Intensity WT_000`)) +
geom_point(color='#77b800', size=1)+
labs(y='Leading protein')+
scale_x_continuous (breaks=c(1:length(Phospho_STY_Sites2$`Leading proteins`)),
labels=c(Phospho_STY_Sites2$`Leading proteins`))+
theme_classic()+
theme(axis.text.x=element_text(angle=80, hjust=1))+
geom_point(aes( 1:length(Score),`Intensity WT_035`), color='#EC0030', size=1)+
geom_point(aes( 1:length(Score),`Intensity WT_050`), color='#07B1BC', size=1)+
geom_point(aes( 1:length(Score),`Intensity KO_035`), color='#AB00FF', size=1)+
geom_point(aes( 1:length(Score),`Intensity KO_050`), color='#FB6277', size=1)
multiplot(wk1, wk2, cols=2)

grid.arrange(wk1, wk2, nrow=1)

wk2

library(readxl)
proteinGroups <- read_excel("N:/TSever/20181218_vsaka_frakcija_scx_posebaj_kidney_ko+wt/combined/txt/proteinGroups.xlsx")
#View(proteinGroups)
proteinGroups2<- filter(proteinGroups,
Score > 40)
#proteinGroups2<- filter(proteinGroups, `Localization prob` > 0.75)
proteinGroups2 <- proteinGroups2 [ ! (proteinGroups2$Reverse %in% '+'), ]
proteinGroups2 <- proteinGroups2 [ ! (proteinGroups2$`Potential contaminant` %in% '+'), ]
proteinGroups2 <- proteinGroups2 [ ! (proteinGroups2$`Only identified by site` %in% '+'), ]
pg<-
ggplot(proteinGroups2, aes(`Majority protein IDs`, Intensity))+
geom_point()
kop<-c(
0,
sum(proteinGroups2$`Peptides KO_005`),
sum(proteinGroups2$`Peptides KO_010`),
sum(proteinGroups2$`Peptides KO_015`),
sum(proteinGroups2$`Peptides KO_020`),
sum(proteinGroups2$`Peptides KO_025`),
sum(proteinGroups2$`Peptides KO_030`),
sum(proteinGroups2$`Peptides KO_035`),
sum(proteinGroups2$`Peptides KO_040`),
sum(proteinGroups2$`Peptides KO_045`),
sum(proteinGroups2$`Peptides KO_050`),
sum(proteinGroups2$`Peptides KO_060`),
sum(proteinGroups2$`Peptides KO_070`),
sum(proteinGroups2$`Peptides KO_080`),
sum(proteinGroups2$`Peptides KO_090`),
sum(proteinGroups2$`Peptides KO_100`)
)
wtp<-c(
sum(proteinGroups2$`Peptides WT_000`),
sum(proteinGroups2$`Peptides WT_050`),
sum(proteinGroups2$`Peptides Wt_010`),
sum(proteinGroups2$`Peptides WT_015`),
sum(proteinGroups2$`Peptides WT_020`),
sum(proteinGroups2$`Peptides WT_025`),
sum(proteinGroups2$`Peptides WT_030`),
sum(proteinGroups2$`Peptides WT_035`),
sum(proteinGroups2$`Peptides WT_040`),
sum(proteinGroups2$`Peptides WT_045`),
0,
sum(proteinGroups2$`Peptides WT_060`),
sum(proteinGroups2$`Peptides WT_070`),
sum(proteinGroups2$`Peptides WT_080`),
sum(proteinGroups2$`Peptides WT_090`),
sum(proteinGroups2$`Peptides WT_100`)
)
ggplot()+
geom_bar(stat='identity',
aes(1:length(kop),kop), fill='#00cfcf', alpha=0.5, size=1.5)+
geom_rect(xmin=0, xmax= 0, ymin= 00, ymax=00, aes(fill='ko'), alpha=0.4)+
geom_bar(stat='identity',
aes(1:length(kop),wtp), fill='#cf0000', alpha=0.4, size=1.5)+
theme_classic()+
scale_x_continuous(breaks = c(1:length(kop)),
labels=c('0 M','0.05 M','0.10 M','0.15 M', '0.20 M', '0.25 M', '0.30 M', '0.35 M', '0.40 M', '0.45 M', '0.50 M', '0.60 M', '0.70 M', '0.80 M', '0.90 M',' 1 M' ))+
labs(x='NaCl fraction', y='number of proteins')+
theme(axis.text.x=element_text(angle=45, hjust=1))+
geom_rect(xmin=0, xmax= 0, ymin= 00, ymax=00, aes(fill='wt', name = NULL), alpha=0.4)+
theme(legend.title =element_blank())

ggplotly(pg)
ggplotly(wk2)
df <- data.frame(
x= 1:length(kop),
y= kop,
f=c('0 M','0.05 M','0.10 M','0.15 M', '0.20 M', '0.25 M', '0.30 M', '0.35 M', '0.40 M', '0.45 M', '0.50 M', '0.60 M', '0.70 M', '0.80 M', '0.90 M',' 1 M' )
)
p <- ggplot(df, aes(x, y)) +
geom_point(aes(frame = f))
## Warning: Ignoring unknown aesthetics: frame
p <- ggplotly(p)
p
p <- ggplot(gapminder, aes(gdpPercap, lifeExp, color = continent)) +
geom_point(aes(size = pop, frame = year, ids = country)) +
scale_x_log10()
## Warning: Ignoring unknown aesthetics: frame, ids
p <- ggplotly(p)
p
df <- data.frame(
x = c(1,2,3,4),
y = c(1,2,3,4),
f = c(1,2,3,4)
)
p <- ggplot(df, aes(x, y)) +
geom_point(aes(frame = f))
## Warning: Ignoring unknown aesthetics: frame
p <- ggplotly(p)
df1<- data.frame(
ak = c( seq( 0 ,length.out=wt_unique[1])),
yak = c (rep(0, each=85)),
fak = c(seq(length.out=wt_unique[1]))
)
df2<- data.frame(
kk = c(seq(0,length.out=wt_unique[11])),
ykk = c (rep(0.50, each=wt_unique[11])),
fkk = c(seq(length.out=wt_unique[11]))
)
df3<- data.frame(
hk = c(0,1),
yhk = c (0.35,0.35),
fhk = c(1,2)
)
p<-ggplot() +
geom_point( aes(x= df1$yak, y= df1$ak, frame= df1$fak))+
geom_point( aes(x= df2$ykk, y= df2$kk, frame= df2$fkk))+
geom_point( aes(x= df3$yhk, y= df3$hk, frame= df3$fhk))+
geom_point( aes(x= 0.05, y= 0, frame= 1))+
geom_point( aes(x= 0.1, y= 0, frame= 1))+
geom_point( aes(x= 0.15, y= 0, frame= 1))+
geom_point( aes(x= 0.20, y= 0, frame= 1))+
geom_point( aes(x= 0.25, y= 0, frame= 1))+
geom_point( aes(x= 0.30, y= 0, frame= 1))+
geom_point( aes(x= 0.40, y= 0, frame= 1))+
geom_point( aes(x= 0.45, y= 0, frame= 1))+
geom_point( aes(x= 0.60, y= 0, frame= 1))+
geom_point( aes(x= 0.70, y= 0, frame= 1))+
geom_point( aes(x= 0.80, y= 0, frame= 1))+
geom_point( aes(x= 0.90, y= 0, frame= 1))+
geom_point( aes(x= 0.10, y= 0, frame= 1))
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
## Warning: Ignoring unknown aesthetics: frame
ggplotly(p)
## Warning: Only one `frame` variable is allowed
accumulate_by <- function(dat, var) {
var <- lazyeval::f_eval(var, dat)
lvls <- plotly:::getLevels(var)
dats <- lapply(seq_along(lvls), function(x) {
cbind(dat[var %in% lvls[seq(1, x)], ], frame = lvls[[x]])
})
dplyr::bind_rows(dats)
}
df <- df %>%
accumulate_by(~df1$ak)
p <- ggplot(df1,aes(x=yak,y= ak, frame = fak)) +
geom_line()
ggplotly(p)