[R] portfolio, portfolio.optim function not found

2011-09-14 Thread James Splinter
) dim(x) <- c(500,2) res <- portfolio.optim(x) res$pw the error I get is: Error: could not find function "portfolio.optim" Any thoughts on how this could be? Thanks James Splinter [[alternative HTML version deleted]] __ R-he

Re: [R] Keeping Leading Zeros, Treating numbers as text

2010-12-22 Thread James Splinter
e: num 0 23 > > or > > > data <- read.csv(textConnection(txt), header=TRUE, > colClasses=c("factor","character","numeric"),sep=" ") > > str(data) > 'data.frame': 2 obs. of 3 variables: > $ City : Factor w/ 2 lev

[R] Keeping Leading Zeros, Treating numbers as text

2010-12-21 Thread James Splinter
Hello, I have a data set, with some numerical values, some non-numerical data, my issue is that I need to preserve my ID numbers (numerics) with the leading zeros, but when I import the data into R (it's in .csv format) using the read.csv(" ") command, it turns all the ID numbers (Example: 00210)

[R] Problem with Aggregate - Sum, limit on number of criteria

2010-10-22 Thread James Splinter
Hello, It appears there is a limit in the number of criteria that can be put into the Aggregate sum function. (It looks like it is 32). My code is; HSfirst=aggregate(count, list(P2010W,P2009S,P2009W,P2008S,P2008W,P2007S,P2007W,P2006S,P2006W,pcom,W2010W,W2009S,W2009W,W2008S,W2008W,W2007S,W2007W,W