Thanks,

Is there a way to transform this data in numeric data with r?
 
Att


De: rharlo...@gmail.com
Enviada: Terça-feira, 29 de Julho de 2014 15:50
Para: walmir-rodrig...@uol.com.br
Assunto: [R-SIG-Finance] Optimization

The issue has nothing to do with fPortfolio.  You are not parsing your input file correctly, run:
 
indices
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-rodrig...@uol.com.br> wrote:
Mr. Harlow,

Very sorry. And thanks for your attention, isn´t my intention be rude.
 
> library(xts)
> library(fPortfolio)
> indices
> Spec = portfolioSpec()
>  setTargetReturn(Spec) = mean(colMeans(indices))
Error in base::colMeans(x, na.rm = na.rm, dims = dims, ...) : 
  'x' must be numeric
 


De: rharlo...@gmail.com
Enviada: Terça-feira, 29 de Julho de 2014 15:01
Para: walmir-rodrig...@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.
 
 
Bob
 


On Tue, Jul 29, 2014 at 1:44 PM, walmir-rodrigues <walmir-rodrig...@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 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.
 
_______________________________________________
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.

Reply via email to