Re: [R] constrained optimization -which package?

2010-09-28 Thread Paul Smith
On Tue, Sep 28, 2010 at 9:47 PM, Leonardo Monasterio leonardo.monaste...@gmail.com wrote: In the function bellow I  want to find the maximum value of v, subject to the constrain that the sum of x is equal to 1.  I want to maximize: v-t(x)%*%distance%*%x Subject to: sum(x)=1 Where: x is a

Re: [R] efficient equivalent to read.csv / write.csv

2010-09-28 Thread Gabor Grothendieck
On Tue, Sep 28, 2010 at 5:02 PM, statquant2 statqu...@gmail.com wrote: Hello all, the test I provided was just to pinpoint that for loading once a big csv A file that can be read in under 2 seconds is not big. file with read.csv was quicker than read.csv.sql... I have already optimized my

[R] repeat a function

2010-09-28 Thread Michael Larkin
I have R randomly sampling my array made up of 2 columns of data. Here is my code randomly sampling 5 different rows from my dataset to create a new dataset of 8 rows of data: testdat-growth[sample(5,8,replace=T),] Now I want to tell R to repeat this function 50 times and give me the

Re: [R] repeat a function

2010-09-28 Thread Michael Bedward
Hi Michael testdat - replicate( 50, growth[ sample(nrow(growth), 8, rep=TRUE) ] ) testdat will then be a matrix of 8 x 50 = 400 rows where each lot of 8 is a sample. Alternatively you can do... testdat - replicate( 50, growth[ sample(nrow(growth), 8, rep=TRUE) ], simplify=FALSE ) Now testdat

Re: [R] break function execution

2010-09-28 Thread raje...@cse.iitm.ac.in
I'm on windows xp. I use R 2.11.1 GUI - Original Message - From: Greg Snow greg.s...@imail.org To: raje...@cse.iitm.ac.in, r-help r-help@r-project.org Sent: Wed, 29 Sep 2010 00:48:51 +0530 (IST) Subject: RE: [R] break function execution Ctrl-C works on some platforms, it would help us to

[R] boxplot

2010-09-28 Thread Luis Felipe Parra
Hello, does somebody know in a boxplot, what does each element in the boxplot represent? 1. lines at the extremes of the dotted lines? 2. Extremes of the boxes 3. Black line in the middle of the box? 4. notches? Thank you Felipe Parra [[alternative HTML version deleted]]

[R] String split and concatenation

2010-09-28 Thread Steven Kang
Hi R users, I desire to transform the following vector consisting of repeated characters x - rep(letters, 3) into this exact format (i.e a single string containing each characters in quotation mark separated by comma between each; al ). (a, b, c, d, a, b, c, d, ..., a, b, c, d,

Re: [R] String split and concatenation

2010-09-28 Thread Ista Zahn
Hi Steven, This should do it: paste('', unlist(strsplit(x, split=)), c(rep(',', length(x)-1), ), sep=) -Ista On Wed, Sep 29, 2010 at 1:11 AM, Steven Kang stochastick...@gmail.com wrote: Hi R users, I desire to transform the following vector consisting of repeated characters x -

Re: [R] String split and concatenation

2010-09-28 Thread Bill.Venables
dump(x, file = x.R) file.show(x.R) will get you most of the way. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Kang Sent: Wednesday, 29 September 2010 3:11 PM To: r-help@r-project.org Subject: [R] String split and

<    1   2