X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=old_C_code%2Fstage2%2Fsrc%2Funused%2Fdescriptive-32K.r;fp=old_C_code%2Fstage2%2Fsrc%2Funused%2Fdescriptive-32K.r;h=0000000000000000000000000000000000000000;hb=14cb6cf8266c0e1299f16a4b2352f54dbae26f44;hp=5e1b29bc2fb5bb9a216ea6cad07866d992ad8eb4;hpb=5edda192f1a634ba284acdea7b6302f60df7b000;p=epclust.git diff --git a/old_C_code/stage2/src/unused/descriptive-32K.r b/old_C_code/stage2/src/unused/descriptive-32K.r deleted file mode 100644 index 5e1b29b..0000000 --- a/old_C_code/stage2/src/unused/descriptive-32K.r +++ /dev/null @@ -1,81 +0,0 @@ -# File: descriptive-32K.r - -rm(list = ls()) -#library(dplyr) - -## Following lines allow to construct the data file -## totconso-par-indiv.txt. -## They are very time&memory-consumming -#library(data.table) -#d10 <- fread("~/tmp/data/2010.csv") -#tot <- d10[, list(tot= sum(CPP_PUISSANCE_BRUTE), -# min= min(CPP_PUISSANCE_BRUTE), -# max= max(CPP_PUISSANCE_BRUTE), -# sd = sd( CPP_PUISSANCE_BRUTE)), -# by = FK_CCU_ID] -# write.table(file = "~/tmp/data/totconso-par-indiv.txt", tot) - -tot <- read.table("~/tmp/data/totconso-par-indiv.txt") -synchro <- read.table("~/tmp/data/syncrone2010.txt") -mat_synchro <- matrix(c(synchro$V1[1:2], synchro$V1) / 1e6, - ncol = 48, - byrow = TRUE) - -xHour <- seq(1/2, 24, length.out = 48) -xDate <- seq.Date(from = as.Date("2010/1/1"), - to = as.Date("2011/1/1"), - length.out = 365 * 48 - 2) - -# Filter infra daily -plot(xDate, filter(synchro$V1 / 1e6, rep(1 / 48, 48)), - type = 'l', - main = 'Synchrone 2010', - ylab = 'Charge (en Mwh)', - xlab = 'Time') - -# Daily -matplot(xHour, scale(t(mat_synchro)), type = 'l', lty = 1, - col = rgb(0, 0, 0, .25), - main = 'Synchrone jounalière (norm.)', - xlab = 'Heures', ylab = 'Charge (en Mwh)') - - -tot_order <- tot[order(tot$tot), ] -max_order <- tot[order(tot$max), ] - -## Mesures aberrantes ? -tail(cbind(max_order[,1], max_order[,-1] / 1e3)) - - -## I want to recuperate ids: 186733, 191819, 193174 -## which corresponds to places 1, 2481, 3478 -# identiants <- read.table('~/tmp/data/identifs.txt') -# match(c(186733, 191819, 193174), identiants$V1) - -#c186733 <- d10[, FK_CCU_ID == 186733] -#c191819 <- d10[, FK_CCU_ID == 191819] -#c193174 <- d10[, FK_CCU_ID == 193174] - -c186733 <- read.csv("~/tmp/data/c186733.csv")[, 4] / 1e3 - -mat_186733 <- matrix(c(c186733[1:2], c186733), - ncol = 48, - byrow = TRUE) - -# Filter infra daily -plot(xDate, filter(c186733, rep(1 / 48, 48)), - type = 'l', - main = "Consommation individuelle (2010)", - ylab = 'Charge (en Mwh)', - xlab = 'Temps') - -# Daily (raw) -matplot(xHour, t(mat_186733), type = 'l', lty = 1, - col = rgb(0, 0, 0, .25), - #main = "Consommation individuelle journalière " - xlab = 'Heures', ylab = 'Charge (en Mwh)') - -# Daily (standarized) -matplot(xHour, scale(t(mat_186733)), type = 'l', lty = 1, - col = rgb(0, 0, 0, .25), - xlab = 'Heures', ylab = 'Charge (en Mwh)')