Hi!

I'm trying to use the weightsLinePlot function of the fPortfolio library.

it seems to call the function getWeights(fPortfolioObject), which is not
returning a matrix, but a single vector(a single line). Thus the
weightsLinePlot is not working.

Can you point me to a solution?

 

Below some specs, the code and the output.

> version

               _                            

platform       x86_64-pc-mingw32            

arch           x86_64                       

os             mingw32                      

system         x86_64, mingw32              

status                                      

major          2                            

minor          13.2                         

year           2011                         

month          09                           

day            30                           

svn rev        57111                        

language       R                            

version.string R version 2.13.2 (2011-09-30)

 

>library(fPortfolio)

>Data = SMALLCAP.RET

>Data = Data[, c("BKE", "GG", "GYMB", "KRON")]

>head(Data)

>Spec = portfolioSpec();

>frontier = portfolioFrontier(Data,Spec)

>getWeights(frontier)

>weightsLinePlot(frontier)

 

##OUTPUT:

> frontier = portfolioFrontier(Data,Spec)

> getWeights(frontier)

[1] 0.000000e+00 1.805789e-08 1.000000e+00 0.000000e+00

attr(,"invest")

[1] 1

>  weightsLinePlot(frontier)

Error in plot.window(xlim, ylim, log, ...) : 'xlim' value not valid

> 

 


	[[alternative HTML version deleted]]

