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,660 points
28 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,800 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 Sahiti
• 6,290 points
201 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,560 points
84 views
0 votes
2 answers

How to change the value of a variable using R programming in a data frame?

You are getting this error since the ...READ MORE

answered Aug 16, 2019 in Data Analytics by anonymous
• 32,440 points
1,192 views
0 votes
1 answer

Parallel programming In R using GPU

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

answered Feb 4, 2019 in Data Analytics by Tyrion anex
• 8,330 points
91 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, 2019 in Data Analytics by Sophie may
• 9,920 points
49 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer