[R] Data Manipulation

2010-01-20 Thread Peter Rote
Dear All, I would like to to group the Ticker by Industry and create file names from the Industry Factor and export to a txt file. I have tried the folowing ind=finvizAllexETF$Industry ind is then Aluminum Business Services Regional Airlines ind2=gsub( ,,ind) ind3 [1] Aluminum

Re: [R] Please Please Please Help me (Changed to: calling a function with a list of parameters)

2010-01-20 Thread Dieter Menne
Please, do not write Help, Help but give a meaningful header. Most people here a specialized and check the posts they understand best. Madhavi Bhave wrote:   (I have already written the required R code which is giving me correct results for a given single set of data. I just wish to wish

Re: [R] Data Manipulation

2010-01-20 Thread Dieter Menne
Peter Rote wrote: I would like to to group the Ticker by Industry and create file names from the Industry Factor and export to a txt file. I have tried the folowing ind=finvizAllexETF$Industry ind is then Aluminum Business Services Regional Airlines ind2=gsub(

Re: [R] permutations from vectors out of a matrix

2010-01-20 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Etienne, I don't see the point in avoiding some 'special' packages. If you are willing to change your mind in this regard, try something like library() -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Etienne Stockhausen

Re: [R] permutations from vectors out of a matrix

2010-01-20 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Sorry, wrong button. Below a hopefully more helpful solution... Etienne, I don't see the point in avoiding some 'special' packages. If you are willing to change your mind in this regard, try one of the following solutions that work for me: library(combinat) apply(mat, 2, function(x)

Re: [R] OT: Software for specific visualisation of data...ideas?

2010-01-20 Thread Gavin Simpson
On Tue, 2010-01-19 at 16:27 +, Gavin Simpson wrote: Dear List, A student in the Department where I work would like to produce a graphic similar to this one: http://image.guardian.co.uk/sys-files/Guardian/documents/2009/09/16/Public_spending_160909.pdf Does anyone know if the figure

[R] Error meaning

2010-01-20 Thread Roslina Zakaria
Hi r-users,   I have the following code to solve 4 simultaneous eqns with 4 unknowns using newton iteration method.  But I got the error message:   pars - c(1.15, 40, 50, 0.78) newton.input2 - function(pars) {  ## parameters to estimate      alp - pars[1]    b1  - pars[2]     b2  - pars[3]   

[R] question on runif

2010-01-20 Thread Wolfgang Amadeus
Hello! I have a question on uniform distribution. I want to plot n, say 20, points, uniformly distributed, in a circle, with radius=0.1 and center,say, (0.4, 0.8) I do not know how~ Thank you for your time. Yours Wolfgang Amadeus [[alternative HTML version deleted]]

Re: [R] Please Please Please Help me!!

2010-01-20 Thread Liviu Andronic
Hello On Wed, Jan 20, 2010 at 7:00 AM, Madhavi Bhave madhavi_bh...@yahoo.com wrote: Sir, I am not asking for the modification of existing code as it is running fine with a single set of data (and I have checked that the output tallies with other methods). I just want to use this code for

[R] R help for read.table()

2010-01-20 Thread Gaurav Kumar
I've a table containing two columns seperated by space, as shown below. S:C 2.011085038928 S:A 21.496800549900762 S:J 0.183181039138149 P:E 9.641984304606304 I'm reading this table inside a loop but unable to access the first column

[R] Quantmod error

2010-01-20 Thread Jose Narillos de Santos
Hi all I have installed quantmod package but when I try to obtain GOOG data appers this message: Can anyone inform why itappears? I type getSymbols(GOOG,src=google) Thanks and Best Regards for all Error en download.file(paste(google.URL, q=, Symbols.name, startdate=, : no fue posible abrir la

[R] RES: R help for read.table()

2010-01-20 Thread Leandro Marino
Hi, You didnt put the parameter sep=' ' in the read.table. If you try to see str(file), i think you are going to see only one column. read.table(data.txt,header=FALSE,sep=' ') Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio

Re: [R] R help for read.table()

2010-01-20 Thread Dennis Murphy
R does vectorized arithmetic. Your loop was superfluous. Observe: x - read.table(textConnection( + S:C 2.011085038928 + S:A 21.496800549900762 + S:J 0.183181039138149 + P:E 9.641984304606304)) x V1 V2 1 S:C 2.0110850 2 S:A 21.4968005 3 S:J 0.1831810 4 P:E 9.6419843 transform(x,

Re: [R] question on runif

2010-01-20 Thread Alfredo
ang-runif(20,0,2*pi) x-cos(ang) +0.4 y-sin(ang) +0.8 plot(x,y,ylim=c(-3,3),xlim=c(-3,3)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Wolfgang Amadeus Sent: Wednesday, January 20, 2010 5:26 AM To: r-help Subject: [R] question on

Re: [R] RES: R help for read.table()

2010-01-20 Thread Gaurav Kumar
Hi Leonard, Thanks for your quick response. i tired using the sep= in read.table() function, but still can't access the first column. checked , str(file), showing the $V1 variable...but can't access the first column inside the loop. regards Gaurav Kumar www.gauravkumar.org PhD Student,

Re: [R] question on runif

2010-01-20 Thread Alfredo
Oops forgot to include the radius ang-runif(200,0,2*pi) x-cos(ang)*.1 +0.4 y-sin(ang)*.1 +0.8 plot(x,y) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Wolfgang Amadeus Sent: Wednesday, January 20, 2010 5:26 AM To: r-help Subject:

Re: [R] R help for read.table()

2010-01-20 Thread Gaurav Kumar
Thank Dennis!!!.it works regards Gaurav Kumar www.gauravkumar.org PhD Student, Chemistry and Biomolecular Sciences, Macquarie , Sydney, Australia. MS (Computational Biology), NCBS-TIFR, Bangalore, India. --- On Wed, 20/1/10, Dennis Murphy djmu...@gmail.com wrote: From: Dennis Murphy

[R] Beginner questions (plot circle)

2010-01-20 Thread Nachtwind
Hi, I have finally managed to set up a basic diagram for my needs and would now like to make that a bit nicer but dont find the appropiate answers through wiki or the manual. First of all i have a plot for the X and Y axis - and would like to show the ticks in 2 steps, not in 5 steps, but dont

Re: [R] question on runif

2010-01-20 Thread Ted Harding
Alfredo's solution will provide n (=200 in his case) points uniformly distributed along the *circumference* of the circle. Wolfgang_Amadeus(!), you wanted them *in* a circle. If what you mean is uniformly distributed over the area within the circle, then you also need to generate the radii at

[R] sum column by colnames

2010-01-20 Thread Alfredo Alessandrini
Hi, I've this dataframes: data1 12 3 4 56 50.4963017 0 0 0.2481509 1.9852069 0.4963017 10 0.000 0 0 0.000 0.6317266 0.000 15 0.000 0 0 0.000 0.000 0.000 20 0.000 0 0 3.3955301 0.000

Re: [R] sum column by colnames

2010-01-20 Thread Henrique Dallazuanna
Try this: m - merge(data1, data2, by = 0, all = TRUE, sort = FALSE) sapply(unique(union(names(data1), names(data2))), function(n)Reduce('+', m[grep(n, names(m))])) On Wed, Jan 20, 2010 at 10:59 AM, Alfredo Alessandrini alfreal...@gmail.com wrote: Hi, I've this dataframes: data1        

Re: [R] problem of data manipulation

2010-01-20 Thread Matthew Dowle
The user wrote in their first post : I have a lot of observations in my dataset Heres one way to do it with a data.table : a=data.table(a) ans = a[ , list(dt=dt[dt-min(dt)7]) , by=var1,var2,var3] class(ans$dt) = Date Timings are below comparing the 3 methods. In this

Re: [R] problem of data manipulation

2010-01-20 Thread hadley wickham
Note that in the documentaton ?[.data.table where I say that 'by' is slow, I mean relative to how fast it could be.  Its seems, in this specific example anyway, and with the code posted so far, to be significantly faster than sqldf and plyr. Of course the best of both worlds would be to use

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-20 Thread Marc Schwartz
On Jan 19, 2010, at 10:04 PM, Eric Ma wrote: I am having the exact same error, and the suggested work-around does not help. My env is: 64-bit SUSE Linux v 10.1 on Xeon processors. gcc and gfortran version is 4.1.2 64-bit R 2.10.1 compiled from soure using CC=gcc -m64 etc. 64-bit

Re: [R] Quantmod error

2010-01-20 Thread Cedrick Johnson
Can you ping the host 'finance.google.com' ?? The error msg is right there, Unable to Resolve -c I just tried it now: getSymbols(GOOG, src=google) [1] GOOG head(GOOG) GOOG.Open GOOG.High GOOG.Low GOOG.Close GOOG.Volume 2007-01-03466.00476.66 461.11 467.59 7527500

Re: [R] Error meaning

2010-01-20 Thread David Winsemius
When I look at this line: f4 - pars[1]*pars[2]*pars[3](pars[1]+pars[4]) It appears to my wet-brain interpreter that you are trying to apply a function par[3] to the argument (pars[1]+pars[4]) When I insert a *, I then get output but I don't know if it is correct. newton.input2(pars)

[R] question on plot in R with mac

2010-01-20 Thread khazaei
Hello all My computer is MacBook and I want to draw a plot in R, for example for x - c(1,3,6,9,12) y - c(1.5,2,7,8,15) I use this command plot(x,y) to do but I see this massage: Erreur dans plot(Di, g) : argument(s) inutilisé(s) (c(1, 2, 3), c(12, 23, 34)) Could you please help me? Thank

Re: [R] problem of data manipulation

2010-01-20 Thread Matthew Dowle
Sounds like a good idea. Would it be possible to give an example of how to combine plyr with data.table, and why that is better than a data.table only solution ? hadley wickham h.wick...@gmail.com wrote in message news:f8e6ff051001200624r2175e38xf558dc8fa3fb6...@mail.gmail.com... Note that in

Re: [R] question on plot in R with mac

2010-01-20 Thread Mario Valle
You have redefined the plot function somewhere. Check your saved environment. mario On 20-Jan-10 15:36, khaz...@ceremade.dauphine.fr wrote: Hello all My computer is MacBook and I want to draw a plot in R, for example for x- c(1,3,6,9,12) y- c(1.5,2,7,8,15) I use

[R] Write.dbf ... problem

2010-01-20 Thread Arnaud Mosnier
Hello, I am trying to manually choose the width (i.e. number of character allowed) of columns containing text when creating dbf. files using write.dbf (library foreign). In particular, I want to define this width when the column have to contain text but is empty. By default, write.dbf give a

Re: [R] bootstrapping

2010-01-20 Thread aaron.foley
Hello, I was able to bootstrap 1000 times, 20 times (20 columns of 1000 values). Is there a way to get mean for each column? Thanks! Aaron Date: Sat, 16 Jan 2010 00:04:59 +0100 From: stephan.kola...@gmx.de To: aaron.fo...@students.tamuk.edu CC: r-help@r-project.org

Re: [R] Error meaning

2010-01-20 Thread Berend Hasselman
Roslina Zakaria wrote: I have the following code to solve 4 simultaneous eqns with 4 unknowns using newton iteration method.  But I got the error message:   pars - c(1.15, 40, 50, 0.78) newton.input2 - function(pars) {  ## parameters to estimate ...   f1 - pars[1]*pars[2] f2 -

[R] R.oo installation warnings?

2010-01-20 Thread Peng Yu
I got the following warnings when I install R.oo. Are these warnings normal? Should I reinstall the package as mentioned in the warnings? How to reinstall? The sessionInfo() is at the end. install.packages(R.oo, dependencies=T) Warning in install.packages(R.oo, dependencies = T) : argument

[R] Problem in NMDS

2010-01-20 Thread Bingzhang Chen
Hi, I am stuck in one problem when doing nonmetric multidimensional scaling. I use the function 'metaMDS' in the package 'vegan' to work on the presence/absence community data. The problem is when two samples are identical (dissimilarity = 0), metaMDS cannot work with zero dissimilarity. I

[R] Current R.oo tutorial

2010-01-20 Thread Peng Yu
Apparently, Bengtsson.pdf is not current any more. For example, the installation method is outdated. R.oo.pdf is a reference manual rather than a tutorial. I'm wondering if there is a better and more current R.oo tutorial so that I can quickly get started on R.oo.

Re: [R] bootstrapping

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 10:23 AM, aaron.fo...@students.tamuk.edu aaron.fo...@students.tamuk.edu wrote: Hello, I was able to bootstrap 1000 times, 20 times (20 columns of 1000 values). Is there a way to get mean for each column? ?colMeans Thanks! Aaron Date: Sat, 16 Jan

[R] barchart with stacked and beside bars

2010-01-20 Thread chris20
Hi, Is there a way to stack bars in a barchart as well as beside bars for the same treatment? eg I have one barchart like this: bio-matrix(c(10,23,9,25),nrow=2,byrow=T) ntreat-c(n0,n96) colnames(bio)-ntreat barplot(bio,beside=T) now i want a similar barchart but with stacked bars:

[R] problem with origin of a plot

2010-01-20 Thread jpardila
Dear list, I have somewhat a small problem with a plot in R. I want to produce a plot with the two axis intersection being the exact values of ( 5,6). The code i am using is

[R] Reshaping data with xtabs giving me 'extra' data

2010-01-20 Thread Tony B
Dear all, Lets say I have several data frames as follows: set.seed(42) dates - as.Date(c(2010-01-19, 2010-01-20)) times - c(09:30:00, 11:30:00, 13:30:00, 15:30:00) shows - c(Red Dwarf, Being Human, Doctor Who) df1 - data.frame(Date = dates[1], Time = times[1], Show = shows, Score = 1:3)

Re: [R] problem with origin of a plot

2010-01-20 Thread Dimitris Rizopoulos
try this: plot(BN, xlim=c(5,10),ylim=c(6,14), xaxs = i, yaxs = i) I hope it helps. Best, Dimitris jpardila wrote: Dear list, I have somewhat a small problem with a plot in R. I want to produce a plot with the two axis intersection being the exact values of ( 5,6). The code i am using is

Re: [R] problem with origin of a plot

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 6:42 AM, jpardila wrote: Dear list, I have somewhat a small problem with a plot in R. I want to produce a plot with the two axis intersection being the exact values of ( 5,6). The code i am using is BN- c

Re: [R] coping with a warning in if()

2010-01-20 Thread Héctor Villalobos
Thanks to all who responded. I've learn a lot from your comments. The best solution I can see is to use both 'missing()' and 'match.arg()' in my function. Héctor Hi, I'm sure this one is very easy I am trying to write a function where one of its arguments has two posible (strings)

Re: [R] problem of data manipulation

2010-01-20 Thread hadley wickham
On Wed, Jan 20, 2010 at 8:43 AM, Matthew Dowle mdo...@mdowle.plus.com wrote: Sounds like a good idea. Would it be possible to give an example of how to combine plyr with data.table, and why that is better than a data.table only solution ? Well, ideally, you'd do: adt - data.table(a) ans2 -

Re: [R] Reshaping data with xtabs giving me 'extra' data

2010-01-20 Thread Henrique Dallazuanna
Try with tapply: with(do.call(rbind, df.list), tapply(Score, list(Date, Time, Show), length)) On Wed, Jan 20, 2010 at 10:20 AM, Tony B tony.bre...@googlemail.com wrote: Dear all, Lets say I have several data frames as follows: set.seed(42) dates - as.Date(c(2010-01-19, 2010-01-20)) times

Re: [R] restricted permutations in permutest()?

2010-01-20 Thread Kay Cichini
...original data and design were posted at r-forge vegan forum today. greetings, kay -- View this message in context: http://n4.nabble.com/restricted-permutations-in-permtest-tp1017422p1018531.html Sent from the R help mailing list archive at Nabble.com.

[R] legend in multiple plot

2010-01-20 Thread Lars Skjærven
Dear R users, I'm making multiple plots within the same pdf page (par(mfcol = c(5,1)), and want a legend for this at the bottom of all the plots. From previous mails it has been suggested to use par(xpd=TRUE), increase the margin at the last plot, and then draw the legend. However, when I do this,

[R] min and max operations on matrix

2010-01-20 Thread Murali.MENON
Folks, I've got a matrix x as follows: x - matrix(c(1,2,3,5,3,4,3,2,1), ncol = 3, byrow = TRUE) x [,1] [,2] [,3] [1,]123 [2,]534 [3,]321 In each row of x, I want to replace the minimum value by -1, the maximum value by +1 and all other values by 0.

Re: [R] problem of data manipulation

2010-01-20 Thread Matthew Dowle
I see now, thanks for explaining that. Would it be for you to add data.table methods to ddply then, for this to happen? Or does a ddply method need to be added to data.table? hadley wickham h.wick...@gmail.com wrote in message

[R] simulation of binary data

2010-01-20 Thread omar kairan
Hi, could someone help me with dilemma on the simulation of logistic regressiondata with multicollinearity effect and high leverage point.. Thank you [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread BioStudent
Hi I'm hoping someone can help me I am a relative newbie to R. I have data that is in a similar format to this... Experiment Score1 Score2 X -0.85 -0.02 X -1.21 -0.02 X 1.05 0.09 Y -1.12 -0.07 Y -0.27 -0.07 Y -0.93 -0.08 Z 1.1 -0.03 Z 2.4 0.09 Z -1.0 0.09 Now I can easily have a look at the

Re: [R] problem with origin of a plot

2010-01-20 Thread jpardila
Thanks so much for your assistance. In fact I did not read the documentation carefully. -- View this message in context: http://n4.nabble.com/problem-with-origin-of-a-plot-tp1018339p1018518.html Sent from the R help mailing list archive at Nabble.com.

[R] Change an array into a dataset of four variables, dim1, dim2, dim3 and its elements

2010-01-20 Thread rusers.sh
Hi, See my example below. a-array(1:12,c(2,3,2)) a , , 1 [,1] [,2] [,3] [1,]135 [2,]246 , , 2 [,1] [,2] [,3] [1,]79 11 [2,]8 10 12 I want to get a result something like dim1 dim2 dim3 elements 111 121 1

Re: [R] Reshaping data with xtabs giving me 'extra' data

2010-01-20 Thread Tony B
Thank you for taking the time to reply Henrique. Although your solution does take away the zeroes and replaces them with NA's (which i prefer), it unfortunately seems to reduce all of the other scores to just '1': x - with(do.call(rbind, df.list), tapply(Score, list(Date, Show, Time), length))

Re: [R] Reshaping data with xtabs giving me 'extra' data

2010-01-20 Thread Henrique Dallazuanna
You can use this instead: with(do.call(rbind, df.list), tapply(Score, list(Date, Show, Time), invisible)) On Wed, Jan 20, 2010 at 3:02 PM, Tony B tony.bre...@googlemail.com wrote: Thank you for taking the time to reply Henrique. Although your solution does take away the zeroes and replaces

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 11:07 AM, BioStudent wrote: Hi I'm hoping someone can help me I am a relative newbie to R. I have data that is in a similar format to this... Experiment Score1 Score2 X -0.85 -0.02 X -1.21 -0.02 X 1.05 0.09 Y -1.12 -0.07 Y -0.27 -0.07 Y -0.93 -0.08 Z 1.1 -0.03 Z 2.4

Re: [R] Reducing augmented matrices

2010-01-20 Thread Charles C. Berry
On Tue, 19 Jan 2010, jshort wrote: Hi How does one tell R that one is using an augmented matrix as appose to an non-augmented matrix? Explicitly creating an augmented matrix is unnecessary and awkward if the object is to solve a system of linear equations. See: ?solve HTH,

Re: [R] Change an array into a dataset of four variables, dim1, dim2, dim3 and its elements

2010-01-20 Thread Henrique Dallazuanna
Try this: sapply(as.data.frame.table(a), as.numeric) On Wed, Jan 20, 2010 at 3:18 PM, rusers.sh rusers...@gmail.com wrote: Hi,  See my example below. a-array(1:12,c(2,3,2)) a , , 1     [,1] [,2] [,3] [1,]    1    3    5 [2,]    2    4    6 , , 2     [,1] [,2] [,3] [1,]    7    9  

[R] How do I juxtapose two lattice graphs with common X axes such that the X axes line up?

2010-01-20 Thread George Chen
Hello, I would like to juxtapose two lattice graphs with common X axes such that the X axes line up. I am using plot right now but the edges are not neat and it would be nice if I could just draw 1 X axis and not both of them. Here is my code:

Re: [R] How do I juxtapose two lattice graphs with common X axes such that the X axes line up?

2010-01-20 Thread baptiste auguie
Hi, try c.trellis() from the latticeExtra package. HTH, baptiste 2010/1/20 George Chen glc...@stanford.edu: Hello, I would like to juxtapose two lattice graphs with common X axes such that the X axes line up.  I am using plot right now but the edges are not neat and it would be nice if

Re: [R] How do I juxtapose two lattice graphs with common X axes such that the X axes line up?

2010-01-20 Thread Sundar Dorai-Raj
Try googling latticeExtra x.same for some examples. Here's one: http://www.mail-archive.com/r-help@r-project.org/msg39048.html On Wed, Jan 20, 2010 at 9:44 AM, George Chen glc...@stanford.edu wrote: Hello, I would like to juxtapose two lattice graphs with common X axes such that the X axes

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread David Freedman
You'll probably want to look at the 'by' function d=data.frame(sex=rep(1:2,50),x=rnorm(100)) d$y=d$x+rnorm(100) head(d) cor(d) by(d[,-1],d['sex'],function(df)cor(df)) You might also want to look at the doBy package -- View this message in context:

[R] Line Plot with Dates on X-axis

2010-01-20 Thread mah
I am trying to generate a line graph with quarterly time buckets (with nice labels) on the x-axis. The first block of code below will generate the graph with nicely formatted x-axis labels, but the type= and col= options are not recognized when factors are used for the x-axis. The second block,

Re: [R] Line Plot with Dates on X-axis

2010-01-20 Thread Henrique Dallazuanna
Try the zoo package: plot(as.yearqtr(time.val), inc, col = 'red', type = 'l') On Wed, Jan 20, 2010 at 3:41 PM, mah harwood...@gmail.com wrote: I am trying to generate a line graph with quarterly time buckets (with nice labels) on the x-axis.  The first block of code below will generate the

Re: [R] permutations from vectors out of a matrix

2010-01-20 Thread Etienne Stockhausen
Meyners,Michael,LAUSANNE,AppliedMathematics schrieb: Sorry, wrong button. Below a hopefully more helpful solution... Etienne, I don't see the point in avoiding some 'special' packages. If you are willing to change your mind in this regard, try one of the following solutions that work for me:

Re: [R] Problem in NMDS

2010-01-20 Thread Gavin Simpson
On Wed, 2010-01-20 at 23:28 +0800, Bingzhang Chen wrote: Hi, I am stuck in one problem when doing nonmetric multidimensional scaling. I use the function 'metaMDS' in the package 'vegan' to work on the presence/absence community data. The problem is when two samples are identical

[R] Greek letters on a multi-line plot title

2010-01-20 Thread Jason Rupert
I have an instance where I need to include Greek letters on a plot title that is multiple lines.   I've searched the forums for an approach to do this, but most of the previous posts and replies seem to just address instances of single line examples and problems:, e.g.  

Re: [R] question on runif

2010-01-20 Thread Rolf Turner
Ted, Alfredo, et al: Please stop doing this expletive deleted jerk's homework for him!!! cheers, Rolf Turner ## Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

Re: [R] bootstrapping

2010-01-20 Thread aaron.foley
Got it. Thanks CC: r-help@r-project.org From: dwinsem...@comcast.net To: aaron.fo...@students.tamuk.edu Subject: Re: [R] bootstrapping Date: Wed, 20 Jan 2010 10:34:20 -0500 On Jan 20, 2010, at 10:23 AM, aaron.fo...@students.tamuk.edu aaron.fo...@students.tamuk.edu wrote:

Re: [R] simulation of binary data

2010-01-20 Thread Rolf Turner
On 21/01/2010, at 4:41 AM, omar kairan wrote: Hi, could someone help me with dilemma on the simulation of logistic regressiondata with multicollinearity effect and high leverage point.. If that is the clearest way in which you can phrase your question then I doubt that *anyone* can help

Re: [R] barchart with stacked and beside bars

2010-01-20 Thread RICHARD M. HEIBERGER
I don't understand what you are looking for. The line barplot(t(ld)) is placing the four treatments side by side, and is also stacking the three values of typ. Please indicate what you would like the figure to look like. Rich __

Re: [R] legend in multiple plot

2010-01-20 Thread Uwe Ligges
Use outer margins around the whole thing, see argument oma in ?par. Uwe Ligges On 20.01.2010 17:53, Lars Skjærven wrote: Dear R users, I'm making multiple plots within the same pdf page (par(mfcol = c(5,1)), and want a legend for this at the bottom of all the plots. From previous mails it has

[R] Retrieving data through bbg or excel, what is faster?

2010-01-20 Thread anna
Hello, I need to retrieve datas from bloomberg. I want to retrieve those datas in the fastest way as possible. I have two options: writing the datas from bbg to excel and reading from r the excel sheet or directly read the datas from from r with a Rbbg connection. Which connection is faster?

[R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Jerry Floren
Six times a year labs submit individual Excel spreadsheets to me. There are usually around 60 labs and the spreadsheets have 12 columns with 20 rows. Chapter 8 of the R Data Import/Export manual recommends converting .xls files, to a text file. I have been manually converting the individual

Re: [R] min and max operations on matrix

2010-01-20 Thread Gabor Grothendieck
Try this: t(apply(x, 1, function(x) (x == max(x)) - (x == min(x [,1] [,2] [,3] [1,] -101 [2,]1 -10 [3,]10 -1 You can avoid the transpose using plyr: library(plyr) aaply(x, 1, function(x) (x == max(x)) - (x == min(x))) Var1 1 2 3 1 -1 0 1 2

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread Glen Sargeant
One way to plot subsets of data identified by a grouping variable is to use lapply() on a list of subsets. The approach is worth mentioning because similar tactics are useful for many problems. #List of unique values for grouping variable #that is not necessarily a factor names -

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Gabor Grothendieck
1. read.xls in gdata has the capability of - reading an xls file starting from the first row with a given pattern - converting an xls file to a csv file - converting an xls file to a data frame Would those capabilities be sufficient for the input side? See examples in ?read.xls 2. If you do a

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-20 Thread Eric Ma
Thanks Marc for the quick reply. I confirmed the R binary I built is indeed 64-bit. sqlplus works fine, so is the odbcConnect() call. Any idea the error is thrown by RODBC or R? Eric -- View this message in context:

[R] Growth Mixture Modeling

2010-01-20 Thread Rhoderick Machekano
Is there a package for growth mixture modeling in R? Rhoderick [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Merge and join data

2010-01-20 Thread Sean M. Lucey
Hi, I'm looking to combine two data frames. Several of the columns are in common while the others need to be summed up. The apply functions and the merge functions don't seem to be working. I've included a basic example of what I'm trying to do below. Thanks! Sean

Re: [R] Line Plot with Dates on X-axis

2010-01-20 Thread mah
Thank you - zoo did exactly what I needed... On Jan 20, 12:20 pm, Henrique Dallazuanna www...@gmail.com wrote: Try the zoo package: plot(as.yearqtr(time.val), inc, col = 'red', type = 'l') On Wed, Jan 20, 2010 at 3:41 PM, mah harwood...@gmail.com wrote: I am trying to generate a line

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Jerry Floren
Hi Gabor, Thanks for your insights and suggestions. There was a post on the Wiki you mentioned that makes me think this will work. Unfortunately, the spreadsheet was designed to make it easy for lab staff to enter their results, but not so easy for another program to read in the data. That is

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Gabor Grothendieck
Try this: U - http://www.mda.state.mn.us/en/sitecore/content/Global/MDADocs/licensing/map/mapreportform.aspx; library(gdata) DF - read.xls(U, pattern = SAMPLE, as.is = TRUE) and now write an R program to create the desired data frame from DF. On Wed, Jan 20, 2010 at 3:56 PM, Jerry Floren

Re: [R] Merge and join data

2010-01-20 Thread Peter Alspach
Tena koe Sean I suspect the apply() and merge() functions are working, but they may not be doing what you expect :-) You could try rbind() and aggregate(): data.frame1$HAD - as.numeric(NA) data.both - rbind(data.frame1, data.frame2) aggregate(data.both[,-(1:3)], data.both[,1:3], sum,

[R] Printing RVector

2010-01-20 Thread Bhanu Mangipudi
Hi All, I am new to python, R and rpy2. I am trying to print an Rvector say v and I want to print 1st element so the statement will be *print (v[0])* and this gives me *output [1] 876* but the real value I should get is 876. Can any one can help how to get rid of [1] while printing. I am using

Re: [R] Greek letters on a multi-line plot title

2010-01-20 Thread David Scott
Jason Rupert wrote: I have an instance where I need to include Greek letters on a plot title that is multiple lines. I've searched the forums for an approach to do this, but most of the previous posts and replies seem to just address instances of single line examples and problems:, e.g.

[R] Matrices with randomly generated entries

2010-01-20 Thread jshort
I'm attempting to generate matrices where the entries are randomly generated numbers of specified distribution. The following code was an attempt to create a 3 by 3 matrix, where my entries where randomly generated from a uniform (0,1) distribution. x = matrix(0,ncol = 3, byrow = T) for(i in

Re: [R] Matrices with randomly generated entries

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 4:55 PM, jshort wrote: I'm attempting to generate matrices where the entries are randomly generated numbers of specified distribution. The following code was an attempt to create a 3 by 3 matrix, where my entries where randomly generated from a uniform (0,1)

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Jerry Floren
Thanks a million Gabor. I was able to quickly import 21 test files. This will save me hours, and should eliminate some errors. Thanks, Jerry Floren Minnesota Department of Agriculture -- View this message in context:

[R] standardizing one variable by dividing each value by the mean - but within levels of a factor

2010-01-20 Thread Dimitri Liakhovitski
Hello! I have a data frame with a factor and a numeric variable: x-data.frame(factor=c(b,b,d,d,e,e),values=c(1,2,10,20,100,200)) For each level of factor - I would like to divide each value of values by the mean of values that corresponds to the level of factor In other words, I would like to

[R] Unclear documentation on 'numeric' and 'integer' (R-lang.pdf)

2010-01-20 Thread Peng Yu
R-lang.pdf has the following description in Section 3.1.1. Any number typed directly at the prompt is a constant and is evaluated. 1 [1] 1 Perhaps unexpectedly, the number returned from the expression 1 is a numeric. In most cases, the difference between an integer and a numeric value will be

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread David Scott
Jerry Floren wrote: Hi Gabor, Thanks for your insights and suggestions. There was a post on the Wiki you mentioned that makes me think this will work. Unfortunately, the spreadsheet was designed to make it easy for lab staff to enter their results, but not so easy for another program to read

Re: [R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

2010-01-20 Thread Marc Schwartz
On Jan 20, 2010, at 1:36 PM, Eric Ma wrote: Thanks Marc for the quick reply. I confirmed the R binary I built is indeed 64-bit. sqlplus works fine, so is the odbcConnect() call. Any idea the error is thrown by RODBC or R? Eric If you are getting the same error as in the original

[R] Why are there typeof(), mode() and storage.mode()?

2010-01-20 Thread Peng Yu
According to R-lang.pdf (Section 2): Function mode gives information about the mode of an object in the sense of Becker, Chambers Wilks (1988), and is more compatible with other implementations of the S language. Finally, the function storage.mode returns the storage mode of its argument in the

Re: [R] Unclear documentation on 'numeric' and 'integer' (R-lang.pdf)

2010-01-20 Thread Steve Lianoglou
Hi Peng, On Wed, Jan 20, 2010 at 5:37 PM, Peng Yu pengyu...@gmail.com wrote: R-lang.pdf has the following description in Section 3.1.1. Any number typed directly at the prompt is a constant and is evaluated. 1 [1] 1 Perhaps unexpectedly, the number returned from the expression 1 is a

Re: [R] question on runif

2010-01-20 Thread Carl Witthoft
While I agree that this is someone's homework, it occur to me that we can mess him up a little more. He asked for 200 points *uniformly* distributed on (or in) a circle. Well, he did NOT say uniform random distribution. So in fact the plot, on a circle would be theta -seq(0,2*pi, by =

Re: [R] standardizing one variable by dividing each value by the mean - but within levels of a factor

2010-01-20 Thread Chuck Cleland
On 1/20/2010 5:37 PM, Dimitri Liakhovitski wrote: Hello! I have a data frame with a factor and a numeric variable: x-data.frame(factor=c(b,b,d,d,e,e),values=c(1,2,10,20,100,200)) For each level of factor - I would like to divide each value of values by the mean of values that

Re: [R] Yet another question about importing Excel *.xls files

2010-01-20 Thread Jerry Floren
Sorry Gabor, but I am not quite there yet. Thanks David for your suggestion on xlsReadWrite. Your message was posted while I was composing this one. The Excel worksheet I want to read in is named Paste Special I started with this code and thought it worked: ### Start of Code ###

[R] S3 tutorial

2010-01-20 Thread Peng Yu
I don't find a tutorial on S3. Bengtsson.pdf cites MASS (1999 edition). However, I don't think that MASS (2002 edition) clearly explain what S3 is and help a user who knew very little about S3 to quickly understand it. Could somebody let me know if there are some better learning materials to help

Re: [R] S3 tutorial

2010-01-20 Thread Peng Yu
On Wed, Jan 20, 2010 at 5:04 PM, Peng Yu pengyu...@gmail.com wrote: I don't find a tutorial on S3. Bengtsson.pdf cites MASS (1999 edition). However, I don't think that MASS (2002 edition) clearly explain what S3 is and help a user who knew very little about S3 to quickly understand it. Could

[R] Error on using blpGetData() function from RBloomberg package

2010-01-20 Thread anna
Hello, I am using te blpGetData() function to retrieve closing prices from bloomberg on r. This is the code that I wrote: library(RBloomberg) conn=blpConnect blpGetData(conn,ANF UN Equity,PX_LAST,2009/09/01,2009/09/10) and I get the following error: Error in substring(paste(0, v$day, sep = ),

  1   2   >