• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版9df1ef9d4cbf6a6a1a4cf96e130b8218a644df2f (tree)
时间2022-04-26 03:29:55
作者Lorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

Now the fragments are sorted in decreasing order.

更改概述

差异

diff -r f610d2243c4f -r 9df1ef9d4cbf R-codes/read_plot_aggregate_shiny.R
--- a/R-codes/read_plot_aggregate_shiny.R Mon Apr 25 19:35:26 2022 +0200
+++ b/R-codes/read_plot_aggregate_shiny.R Mon Apr 25 20:29:55 2022 +0200
@@ -14,7 +14,7 @@
1414
1515 ## rm(tt)
1616
17-generate_two_fragments2 <- function(g){
17+generate_two_fragments2 <- function(g, new_order){
1818
1919 n_edges <- length(E(g))
2020 link_rem <- seq(n_edges)
@@ -26,6 +26,9 @@
2626 agg_list[[i]] <- g2
2727
2828 }
29+
30+ agg_list <- agg_list[new_order]
31+
2932
3033 return(agg_list)
3134
@@ -72,6 +75,8 @@
7275 link_rem <- seq(n_edges)
7376 agg_list1 <- list()
7477 agg_list2 <- list()
78+
79+ ll <- rep(-1, n_edges)
7580
7681 for (i in link_rem){
7782 g2 <- delete.edges(g, E(g)[i])
@@ -85,6 +90,7 @@
8590 agg1 <- agg[mm==1,]
8691 agg2 <- agg[mm==2,]
8792
93+ ll[i] <- nrow(agg1)
8894 ## print(agg1)
8995 ## print(agg2)
9096
@@ -93,9 +99,14 @@
9399 agg_list1[[i]] <- agg1
94100 agg_list2[[i]] <- agg2
95101
96- }
102+ }
103+
104+ ss <- sort(ll, index.return=T)$ix
97105
98- return(list("agg1"=agg_list1, "agg2"=agg_list2))
106+ agg_list1 <- agg_list1[ss]
107+ agg_list2 <- agg_list2[ss]
108+
109+ return(list("agg1"=agg_list1, "agg2"=agg_list2, "myorder"=ss))
99110
100111 }
101112
@@ -816,6 +827,8 @@
816827 })
817828
818829
830+ order_frag <- reactive({chunks()$myorder})
831+
819832 chunk1 <- reactive({
820833 chunks()$agg1[[as.numeric(input$choose_event)]]
821834 })
@@ -824,7 +837,7 @@
824837 chunks()$agg2[[as.numeric(input$choose_event)]]
825838 })
826839
827-fragment_inventory <- reactive({generate_two_fragments2(g())})
840+fragment_inventory <- reactive({generate_two_fragments2(g(), order_frag())})
828841 ## col_list <- reactive({fragment_membership(g)})
829842
830843 g_new <- reactive({fragment_inventory()[[as.numeric(input$choose_event)]]})