The issue has nothing to do with fPortfolio.  You are not parsing your
input file correctly, run:

indices <- read.table("indices.csv", sep = ";", dec = ",", header = TRUE)
head(indices)
sapply(indices, class)

Notice that your variable types are not numeric, such that it is impossible
to take an average of them.  Additionally, it looks like you have some
extraneous columns.  Once you fix the input data (either in R or in
whatever program you used to come up with the csv) try again.



On Tue, Jul 29, 2014 at 3:17 PM, walmir-rodrigues <
walmir-rodrigues@uol.com.br> wrote:

> Mr. Harlow,
>
> Very sorry. And thanks for your attention, isn´t my intention be rude.
>
>  > library(xts)
> > library(fPortfolio)
> > indices <- read.table("C:\\Funpresp\\indices.csv", sep=";", dec=",",
> header = TRUE)
> > Spec = portfolioSpec()
> >  setTargetReturn(Spec) = mean(colMeans(indices))
> Error in base::colMeans(x, na.rm = na.rm, dims = dims, ...) :
>   'x' must be numeric
>
> ------------------------------
>
> *De:* rharlow86@gmail.com
> *Enviada:* Terça-feira, 29 de Julho de 2014 15:01
> *Para:* walmir-rodrigues@uol.com.br
> *Assunto:* [R-SIG-Finance] Optimization
>
> Walmir,
>   In order for anyone to help you, please follow the posting guide (see
> link below).  You need to put a reproducable example in your question and
> attaching .csv files is generally not necessary, so try to avoid it if
> possible.  What did you try? Which specific function "didn't work"? Be
> specific.
>
> http://www.r-project.org/posting-guide.html
>
> Bob
>
>
>
> On Tue, Jul 29, 2014 at 1:44 PM, walmir-rodrigues <
> walmir-rodrigues@uol.com.br
> <http://../../../undefined/compose?to=walmir-rodrigues@uol.com.br>> wrote:
>
>> Hey everyone I tried, but don´t work, transform file to use in fPortfolio
>> package, someone can help.
>>
>> _______________________________________________
>> R-SIG-Finance@r-project.org
>> <http://../../../undefined/compose?to=R-SIG-Finance@r-project.org>
>> mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions
>> should go.
>
>
>

	[[alternative HTML version deleted]]

