0

I'm unable to define period 1 month 5 months 1 year 5 year in a variable so that i can plot a trend line for each fund

EQUITY FUNDS            1 M     6 M     1 Y     3 Y     5 Y
Axis Bluechip Fund      4.00%   5.50%   14.30%  16.70%  15.70%


t<- c("4","5.50","24.30","26.70","15.70")
z<- c("Axis Bluechip Fund - D (G)")
plot(t,z, type="l", col="green", lwd=5, xlab="Period wise Return", 
ylab="Fund Name")
lines(t, z, col="red", lwd=2)
Hector Haffenden
  • 1,360
  • 10
  • 25
  • Can you provide your sample data in a format that is more easily used? For instance, the output from `dput(head(x))` provides completely unambiguous data (with respect to data types) and is very easy for us to copy then paste into our R console. Thanks! – r2evans Mar 28 '19 at 18:25
  • Hi, Now it's in proper format. – Sudhakshi Gupta Mar 29 '19 at 02:28
  • *Please* post code that does not error out for reasons unrelated to your question. In this case, your `t` and `z` vectors are different lengths, so both `plot` and `lines` error with *"'x' and 'y' lengths differ"*. It may help to briefly read about how to ask good questions here on SO, including the use of `dput` for unambiguous data and some other techniques (which are less critical in this question): https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. – r2evans Mar 29 '19 at 12:51

0 Answers0