Editing the plots/visualization on a timeline.

0 votes

I have a 1000*10 matrix showing cashflow of 10 years. For analytical purposes I want to examine the different percentiles/quantiles in terms of a variable

Part of my R-code

plot(timeline, TOTKS[1,], ylim=range(-15000000,100000000), type="l", ylab="Cash Flow", xlab="year")
for (i in 1:total.simulations){
lines(timeline, TOTKS[i,])}

I want to color the 10 % lowest cash flows in the plot above.

Nov 16, 2018 in Data Analytics by Ali
• 10,430 points
19 views

1 answer to this question.

0 votes

find the ten lowest total cash flows. Add up the columns:

total.cashflow <- drop(colSums(TOTKS, na.rm=TRUE))

Then find which are the 10% lowest:

rank.cashflow.le10 <- which(
    total.cashflow <= qualtile(total.cashflow, 0.1)
    )

Add them to the plot:

matlines(timeline, TOTKS[,rank.cashflow.le10], col="red")

To examine those as a separate matrix (but you might not need to, with a vector of indicies)

low10TOTKS <- TOTKS[,rank.cashflow.le10]

answered Nov 16, 2018 by Maverick
• 10,040 points

Related Questions In Data Analytics

0 votes
1 answer

Save a plot as image on the disk using R

Consider for both the situations: 1. Image will ...READ MORE

answered Apr 13, 2018 in Data Analytics by darklord
• 6,170 points
134 views
0 votes
1 answer
0 votes
1 answer

Plotting multiple graphs on the same page in R

If you want to plot 4 graphs ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,550 points
60 views
0 votes
2 answers
0 votes
1 answer

Parallel programming In R using GPU

Check out the CRAN Task View on High-Performance ...READ MORE

answered Feb 4 in Data Analytics by Tyrion anex
• 8,270 points
70 views
0 votes
1 answer

R programming: Naming the output file using a variable

Use the paste command: write.csv(max.hsi, paste0("Index_", i,".csv" ...READ MORE

answered Mar 25 in Data Analytics by Sophie may
• 9,850 points
35 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer