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
• 11,360 points
476 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,840 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 14, 2018 in Data Analytics by Sahiti
• 6,370 points
2,092 views
0 votes
1 answer

R language has several packages for solving a problem. How do you make a decision on which one is the best to use?

CRAN package ecosystem has more than 6000 ...READ MORE

answered Jun 5, 2018 in Data Analytics by zombie
• 3,790 points
1,114 views
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,660 points
1,383 views
+1 vote
3 answers

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

Try this: df$symbol <- as.character(df$symbol) df$symbol[df$sym ...READ MORE

answered Jan 11, 2019 in Data Analytics by Tyrion anex
• 8,700 points
35,688 views
+1 vote
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,700 points
1,355 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 26, 2019 in Data Analytics by Sophie may
• 10,620 points
6,393 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP