Re: [R] Newbie Question: Using R with PHP and MySQL

2007-08-24 Thread Ryan
What's the best reference, if there is one, for PHP, MySQL, R integration? It is possible to integrate PHP, R and MySQL, but I don't have a good reference for you. If all you need are a few simple charts, then I think it would be easiest for you to forget about R and use some other

Re: [R] Newbie Question: Using R with PHP and MySQL

2007-08-24 Thread Eric Theise
On 8/22/07 1:31 PM, MASFERFC Team wrote: I'd like to (more or less) simultaneously return to the browser a couple of canned charts and graphs based on the data. Nothing fancy, two pie charts and two simple bar-charts to start. I need to generate these on-the-fly, based on the results of the

Re: [R] Newbie Question: Using R with PHP and MySQL

2007-08-23 Thread Dieter Menne
MASFERFC Team masferfc at gmail.com writes: I'm currently running MySQL 5 queries with PHP 5.2.3 and returning results to the end-user in web-page tables of ca. 50 rows by 5 columns. I'd like to (more or less) simultaneously return to the browser a couple of canned charts and graphs based on

Re: [R] Newbie

2007-08-16 Thread Stefan Grosse
I'm a bit new to the world of R so forgive my ignorance. That has nothing to do with the knowledge of R but with the model. Age has only 2 different values: 0 and 1 and if it is 0 there is no scars, so what exactly have you expected from the model? I would say if you just want to prove that

Re: [R] Newbie

2007-08-16 Thread Stefan Grosse
I would say if you just want to prove that older deer have more scars try the Mann Whitney non parametric test... Forgive me but even that does not really make sense since the values are all 0 so it is to obvious... __ R-help@stat.math.ethz.ch

Re: [R] Newbie creating package with compiled code

2007-07-04 Thread Duncan Murdoch
On 04/07/2007 6:43 PM, Edna Bell wrote: Hi R Gurus! I'm trying to create a test package using the package.skeleton function. I wanted to add some compiled code too. In the src library, I put together a baby subroutine, compiled it and created a test.dll When I use the R cmd build, it

Re: [R] newbie rgl (3d interacting plotting) question

2007-04-16 Thread Duncan Murdoch
On 4/16/2007 1:37 AM, cottrell wrote: I'm looking for a way to 'reuse' existing rgl device windows. Right now, every time I run my script I have to close the preexisting windows and the new windows get assigned ever-increasing numbers. I know how to do it for regular R plotting device

Re: [R] Newbie: Simple loops: complex troubles

2007-04-04 Thread jim holtman
One of the things about R that you have to learn is vector operations. You try to avoid loops and also 'generating' variables -- this is where a list comes in very handy. To relate to Java, it is similar to 'struct'. Here is a program that does what you want to do; it uses lists and vectorized

Re: [R] Newbie: Simple loops: complex troubles

2007-04-04 Thread projection83
This helped a lot. Thank you so much - im now able to get some basic stuff moving around in R! Petr Klasterecky wrote: Not sure whether this is exactly and everything you want, but at least it may give you some ideas how to proceed. You do not need loops at all: Let's try a simplified

Re: [R] (Newbie)Basic Basic global vs. local variables

2007-04-03 Thread Mark Wardle
projection83 wrote: My R code has got too complex to have a non-modular approach. Ive done some coding in other languages before, but I somehow cant figure out R's general rules for global and local variables. I have put a simple code below, if anyone can show me what i need to add to make

Re: [R] (Newbie)Basic Basic global vs. local variables

2007-04-03 Thread projection83
Thank you, I will give this a good think Mark Wardle wrote: projection83 wrote: My R code has got too complex to have a non-modular approach. Ive done some coding in other languages before, but I somehow cant figure out R's general rules for global and local variables. I have put a

Re: [R] Newbie: Simple loops: complex troubles

2007-04-03 Thread Petr Klasterecky
Not sure whether this is exactly and everything you want, but at least it may give you some ideas how to proceed. You do not need loops at all: Let's try a simplified example with 3 samples, each of length 10 (just for printing purposes): m - c(1,2,3) v - c(1,4,9) n - 10 means - rep(m,each=n)

Re: [R] [newbie] mesuring adequation of normal distribution with avariable

2007-04-02 Thread Boks, M.P.M.
I am not sure what you mean with adequation, but maybe ?shapiro.test is what you are looking for? BW, Marco -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens [EMAIL PROTECTED] Verzonden: zondag 1 april 2007 10:55 Aan: r-help@stat.math.ethz.ch Onderwerp:

Re: [R] (Newbie)Basic Basic global vs. local variables

2007-04-02 Thread Alberto Monteiro
Jim Holtman wrote: The following will work, but I would suggest that you redesign your functions so that they do not use 'globals'; It is not nice for functions to have side-effects. Globals are Evil, but, like goto, sometimes they can make a big program become simpler. I don't see a nice

Re: [R] (Newbie)Basic Basic global vs. local variables

2007-04-02 Thread jim holtman
As long as you know what you are doing, and watch out carefully, then you can do it. BTW, I do exactly what you are saying about manipulating large data objects. I will use the 'indices' in functions like 'lapply' and in the body of the function reference that data that is held in the global

Re: [R] (Newbie)Basic Basic global vs. local variables

2007-04-01 Thread jim holtman
The following will work, but I would suggest that you redesign your functions so that they do not use 'globals'; It is not nice for functions to have side-effects. g_Means-numeric() defineSamples- function() { g_Means -5 # check out ?- } runit-function()

Re: [R] Newbie: Combn and scripting

2007-03-27 Thread Michael Kubovy
x - matrix(c('a', 'b', 'c', 'd', 1:4, 'g', 3, 6, 't'), nrow = 3, byrow = T) comb - vector('list', 3) for(i in 1:3) comb[[i]] - combn(x[i,], 3) On Mar 27, 2007, at 1:55 AM, [EMAIL PROTECTED] wrote: I have just installed my R 2.4 (windows) as a test trying to load a data frame and run

Re: [R] Newbie: Combn and scripting

2007-03-27 Thread John Kane
I think Michael K has covered the comb issue. Have a look at ?read.table (you want read.csv for ease of use) ?save --- [EMAIL PROTECTED] wrote: Hello All, I have just installed my R 2.4 (windows) as a test trying to load a data frame and run combn() for each line into another

Re: [R] newbie upgrade from 2.4.0 to 2.4.1 question

2007-03-21 Thread Alberto Monteiro
Mark Fisher wrote: I am new to R. I installed version 2.4.0 some time ago and I find that some packages I want to use require 2.4.1. I am using Windows XP. Do I need to uninstall R first before running the setup file for 2.4.1 or does the setup file do the right thing? You don't have to

Re: [R] newbie upgrade from 2.4.0 to 2.4.1 question

2007-03-21 Thread Prof Brian Ripley
On Wed, 21 Mar 2007, Mark Fisher wrote: I am new to R. I installed version 2.4.0 some time ago and I find that some packages I want to use require 2.4.1. I am using Windows XP. Do I need to uninstall R first before running the setup file for 2.4.1 or does the setup file do the right thing?

Re: [R] Newbie questions about Wireframe

2007-03-04 Thread Takatsugu Kobayashi
Rusers: I have been looking into lattice manual to see how I can delete a plot frame and a box frame. I just want to show x label, y label, and the actual surface only. \Is this something I should define in axis.default? And how can I change the view perspective like persp(phi=, theta=)? I

Re: [R] Newbie: Acf function

2007-02-08 Thread Vincent Goulet
Le Jeudi 8 Février 2007 09:41, Martin Percossi a écrit : Hi, I would like to use acf.plot on a correlogram that is computed externally. In other words, I would like to fake out the acf object. Is this possible?-- any help would be appreciated. Well, essentially plot.acf() makes a plot with

Re: [R] Newbie: Acf function

2007-02-08 Thread rolf
Martin Percossi wrote: Hi, I would like to use acf.plot on a correlogram that is computed externally. In other words, I would like to fake out the acf object. Is this possible?-- any help would be appreciated. (a) Note that it's ``plot.acf'' NOT acf.plot. (b) This is R ---

Re: [R] Newbie: Acf function

2007-02-08 Thread Martin Percossi
Funny enough, but by accident I typed unclass(acf) (I had meant to unclass the *data* obtained as a result of applying this function), and I saw the source code! From there I managed to reproduce your steps below... In any case, many thanks to all for your help. Martin [EMAIL PROTECTED]

Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Abhijit Dasgupta
This is a BibTeX entry for Frank Harrell's book, which can be generated using a variety of software (I use JabRef or emacs/RefTeX or WinEdt, as needed). It is not generated from R, I believe. BibTeX is the bibliography management and citation system that is used within the TeX/LaTeX framework

Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Andrew Perrin
It's BibTeX source -- used for the BibTeX bibliography management system that integrates with LaTeX. http://www.ecst.csuchico.edu/~jacobsd/bib/formats/bibtex.html http://www.ctan.org -- Andrew J Perrin - andrew_perrin (at)

Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Douglas Bates
On 2/8/07, Zembower, Kevin [EMAIL PROTECTED] wrote: In Henric's recent post, he included this output: @BOOK{R:Harrell:2001, AUTHOR = {Frank E. Harrell}, TITLE = {Regression Modeling Strategies, with Applications to Linear Models, Survival Analysis and Logistic

Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Charilaos Skiadas
On Feb 8, 2007, at 11:07 AM, Zembower, Kevin wrote: In Henric's recent post, he included this output: @BOOK{R:Harrell:2001, AUTHOR = {Frank E. Harrell}, TITLE = {Regression Modeling Strategies, with Applications to Linear Models, Survival Analysis and Logistic

Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Abhijit Dasgupta
As an addition, JabRef (which is a Java application) can automatically download citation information from CiteSeer and PubMed and store it in BibTeX format, albeit once you know the appropriate reference number Douglas Bates wrote: On 2/8/07, Zembower, Kevin [EMAIL PROTECTED] wrote: In

Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread David Scott
On Thu, 8 Feb 2007, Andrew Perrin wrote: It's BibTeX source -- used for the BibTeX bibliography management system that integrates with LaTeX. http://www.ecst.csuchico.edu/~jacobsd/bib/formats/bibtex.html http://www.ctan.org A further point is that mathematically oriented databases

Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Abhijit Dasgupta
as can Google Scholar, which isn't as mathematically oriented. I've seen, though, that it isn't quite as accurate as CIS Abhijit David Scott wrote: On Thu, 8 Feb 2007, Andrew Perrin wrote: It's BibTeX source -- used for the BibTeX bibliography management system that integrates with

Re: [R] Newbie question: Statistical functions (e.g., mean, sd) in a transform statement?

2007-01-19 Thread Michael Kubovy
On Jan 19, 2007, at 12:54 PM, Ben Fairbank wrote: Given a data frame such as times time1time2 time3time4 1 70.408543 48.92378 7.399605 95.93050 2 17.231940 27.48530 82.962916 10.20619 3 20.279220 10.33575 66.209290 30.71846 4 NA 53.31993 12.398237 35.65782

Re: [R] Newbie question: Statistical functions (e.g., mean, sd) in a transform statement?

2007-01-19 Thread Gabor Grothendieck
Try this using the builtin data set anscombe: transform(anscombe, rowMeans = rowMeans(anscombe)) On 1/19/07, Ben Fairbank [EMAIL PROTECTED] wrote: Greetings listeRs - Given a data frame such as times time1time2 time3time4 1 70.408543 48.92378 7.399605 95.93050

Re: [R] Newbie question: Statistical functions (e.g., mean, sd) in a transform statement?

2007-01-19 Thread Charles C. Berry
Ben, transform() is probably the wrong tool if what you want is to 'apply a function' to the corresponding elements of time1, time2, ... , and return a vector of results. If this is what you are after, the 'apply' family of functions is what you want. See ?apply and

Re: [R] Newbie question: Statistical functions (e.g., mean, sd) in a transform statement?

2007-01-19 Thread Gavin Simpson
On Fri, 2007-01-19 at 11:54 -0600, Ben Fairbank wrote: Greetings listeRs - Here are two solutions, depending on whether you wanted the NA's or not, and I assume you wanted the row means: times3 - transform(times, meantime = rowMeans(times)) times3 time1time2 time3time4

Re: [R] Newbie question about saving results

2007-01-13 Thread Duncan Murdoch
On 1/14/2007 12:17 AM, David Kaplan wrote: Hi all, When I run a procedure and the results are printed to the console, is there a way to just save the results? When I save to file, it also saves the syntax of the procedure. Thanks in advance, You can redirect results to a file, using the

Re: [R] newbie estimating survival curve w/ survfit for coxph

2006-12-22 Thread Terry Therneau
fit - coxph(Surv(futime,fustat)~ age +strata(rx), data=ovarian, subset=1:23) curves - survfit(fit, newdata=ovarian[24:26,]) I don't think this is mentioned in the documentation (I'll have to fix that!), but subscripting works for survfit objects. In this case there are

Re: [R] : newbie estimating survival curve w/ survfit for coxph

2006-12-21 Thread Charles C. Berry
Spencer, It always helps to look at the documentation for the objects you use. ?survfit.object tells you: --- COMPONENTS strata if there are multiple curves, this component gives the number of elements of the time etc. vectors corresponding to

Re: [R] Newbie data organisation/structures question...

2006-12-20 Thread Marc Schwartz
On Wed, 2006-12-20 at 16:05 +, Gav Wood wrote: Howdo folks, So my data is in this sort of format: P T I 1 1 (1, 2, 3) 2 1 (2, 4) 1 2 (1, 3, 6, 7) 2 2 (6) And I want to be able to quickly get: 1: The I when both P and T are given. e.g.: P = 2, T = 2; I = (6) 2:

Re: [R] Newbie data organisation/structures question...

2006-12-20 Thread Michael Kubovy
On Dec 20, 2006, at 11:05 AM, Gav Wood wrote: So my data is in this sort of format: P T I 1 1 (1, 2, 3) 2 1 (2, 4) 1 2 (1, 3, 6, 7) 2 2 (6) Not knowing why you organized the data as you did, let me suggest another approach: iv - c(1, 2, 3, 2, 4, 1, 3, 6, 7, 6) p - c(1, 1, 1,

Re: [R] newbie: new_data_frame - selected set of rows

2006-12-03 Thread Neuro LeSuperHéros
Subject: Re: [R] newbie: new_data_frame - selected set of rows Date: Fri, 1 Dec 2006 14:52:25 -0800 (PST) Two missing things: distances [1] 13 14 10 11 2 4 6 1 3 9 8 12 7 5 #numbers correspond to rows in my_dataframe my_dataframe V2 V3 V4 V5

Re: [R] newbie: new_data_frame - selected set of rows

2006-12-02 Thread Philipp Pagel
Hi! distances - order(distancevector(scaled_DB, scaled_DB['query',], d=euclid)) Just compute the distances WITHOUT ordering, here. And then 1) create a small top_five frame top = scaled_DB[rank(distances)=5, ] rank() is better for this than order() in case there are ties. 2)

Re: [R] newbie: new_data_frame - selected set of rows

2006-12-01 Thread Darek Kedra
Two missing things: distances [1] 13 14 10 11 2 4 6 1 3 9 8 12 7 5 #numbers correspond to rows in my_dataframe my_dataframe V2 V3 V4 V5 V6 ENSP0354687 35660.45 0.04794521 0.05479452 0.06849315 0.07534247 ENSP0355046

Re: [R] NEWBIE: Help explaining use of lm()?

2006-11-22 Thread Jeff Newmiller
James W. MacDonald wrote: Hi Kevin, The hint here would be the fact that you are coding your 'Groups' variable as a factor, which implies (at least in this situation) that the Groups are unordered levels. Your understanding of a linear model fit is correct when the independent varible

Re: [R] Newbie problem ... Forest plot

2006-11-22 Thread Michael Dewey
At 15:16 22/11/2006, you wrote: When I use studlab parameter I don`t have (don't know how to put) names inside graph, X and Y axis, and I have Black/White forest plot, and I need colored. 1 - please cc to r-help so that others can learn from your experience 2 - when you use the studlab

Re: [R] Newbie problem ... Forest plot

2006-11-17 Thread Michael Dewey
At 15:59 16/11/2006, Peter Bolton wrote: Hello! I have some data stored into 2 separate csv file. 1 file (called A.csv) (12 results named Group1, Group2, Group3, etc...) odds ratios, 2 file (called B.csv) 12 corresponded errors. How to import that data into R and make forest plot like I saw

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Chuck Cleland
Christian Convey wrote: I'm very new to R, so please forgive me if I just missed the answer in existing documentation... I have a data set with at least three columns, X, Y, and Z. I want to produce a chart where one axis shows all the unique values of X, and the other axis shows all the

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Jeffrey Robert Spies
I'm not sure I understand the question, but you might look into the following functions: unique heatmap image Again, if I understand the question, you would create a length(unique (x)) by length(unique(y)) sized matrix, and fill it with appropriate values of z. Then pass that to heatmap or

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Christian Convey
Thanks, let me try to clarify my question with an example. Suppose I have the following data: Gender, Major, Course-Grade F, Psy, 3.5 F, Psy, 3.1 M, Hst, 3.7 F, Hst, 3.6 M, Hst, 2.6 M, Eng, 3.9 I want to compute a table like the following: X-axis: Gender Y-axis: Major Cell(x,y) = mean

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Marc Schwartz
On Wed, 2006-11-15 at 15:03 -0500, Christian Convey wrote: Thanks, let me try to clarify my question with an example. Suppose I have the following data: Gender, Major, Course-Grade F, Psy, 3.5 F, Psy, 3.1 M, Hst, 3.7 F, Hst, 3.6 M, Hst, 2.6 M, Eng, 3.9 I want to compute a

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Gabor Grothendieck
Marc's solution looks a bit easier but here are a few more anyways: # 1 reshape(DF, dir = wide, timevar = Gender, idvar = Major) # 2 library(reshape) DFm - melt(DF, id = 1:2) cast(DFm, Major ~ Gender, fun = mean) On 11/15/06, Christian Convey [EMAIL PROTECTED] wrote: Thanks, let me try to

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Christian Convey
That did it! Thanks Marc. - Christian On 11/15/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2006-11-15 at 15:03 -0500, Christian Convey wrote: Thanks, let me try to clarify my question with an example. Suppose I have the following data: Gender, Major, Course-Grade F, Psy,

Re: [R] Newbie: Better way to do compound conditionals in subset?

2006-10-26 Thread Jeffrey Robert Spies
I would personally use the following method (example using the iris data included with R): data(iris) tSelect - (iris$Sepal.Length 6.0 iris$Sepal.Length 6.2 iris $Sepal.Width == 3.0) tSelectedData - iris[tSelect,] Then you can simply work with tSelectedData for whatever equation you

Re: [R] Newbie: Better way to do compound conditionals in subset?

2006-10-26 Thread Peter Dalgaard
Jeffrey Robert Spies [EMAIL PROTECTED] writes: I would personally use the following method (example using the iris data included with R): data(iris) tSelect - (iris$Sepal.Length 6.0 iris$Sepal.Length 6.2 iris $Sepal.Width == 3.0) tSelectedData - iris[tSelect,] Then you can

Re: [R] Newbie: Better way to do compound conditionals in subset?

2006-10-26 Thread Marc Schwartz
On Thu, 2006-10-26 at 15:55 -0400, Zembower, Kevin wrote: There must be a better way to select the rows after 22-Apr-2004 and before 01-Sep-2004 with a temperature below 65 than this: before2sw1 - subset(energy.data, as.Date(start, format=%d-%b-%y) as.Date(01-Sep-04, format = %d-%b-%y))

Re: [R] newbie question

2006-10-21 Thread Paul Hiemstra
Dear Larry, Data can be filtered in the following manner: a = c(1,2,3,4) b = c(1,2,3,4) b = b[a3] b = b[b3] a b [1] 4 Or if the data is in a data frame: b = data.frame(seq(1:10),seq(1:10) names(b) = c(a,b) b b = b[b$a 5,] b The trailing comma at the end is important. Hopes this helps, Paul

Re: [R] newbie question

2006-10-21 Thread Chuck Cleland
Larry White wrote: Sorry - this must be obvious, but i haven't been able to find the answer in the guides i've searched. The examples seem to assume you always want to look at all the data. I want to be able to filter data in a dataframe before analyzing it. For example, I'd like to

Re: [R] newbie question

2006-10-21 Thread Alberto Vieira Ferreira Monteiro
Larry White wrote: Sorry - this must be obvious, Yes, it is :-) I want to be able to filter data in a dataframe before analyzing it. For example, I'd like to plot(a,b) but only include values where b 1000. If a and b are vectors, then b 1000 is another vector of logical values. You can

Re: [R] Newbie: Selecting data

2006-10-19 Thread Francisco J. Zagmutt
Welcome to the R community! I see you already learned some of the data selection methods using []. You can use the same principles to subset data i.e. dat=read.table(clipboard) #reading the data you posted, after copied to my clipboard dat start therms gas KWHs elect temp days 1

Re: [R] newbie question about index

2006-09-04 Thread sun
Thanks for all these replies, all work perfectly. Sun --- Petr Pikal [EMAIL PROTECTED]写道: Hallo probably there are other options but outer(1:3,a, ==)*1 can do what you want. HTH Petr On 31 Aug 2006 at 22:41, z s wrote: Date sent:Thu, 31 Aug 2006 22:41:27 +0800

Re: [R] newbie question about index

2006-09-01 Thread Jacques VESLOT
(a==1)*1 or ifelse(a == 1, 1, 0) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31 http://www-good.ibl.fr

Re: [R] newbie question about index

2006-09-01 Thread Gabor Grothendieck
Try using outer: outer(1:3, a, ==)+0 On 8/31/06, z s [EMAIL PROTECTED] wrote: Hi, I am trying to convert a variable a = sample(1:3,100,rep = T) represents choices into a 3X100 dummy varible b with corresponding element set to 1 otherwise 0. eg. a: 1 3 2 1 2 3 1 1 b: 1 0 0 1 0 0 1

Re: [R] newbie question about index

2006-09-01 Thread Gabor Grothendieck
Here is an additional way: model.matrix(~ factor(a) - 1) On 9/1/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Try using outer: outer(1:3, a, ==)+0 On 8/31/06, z s [EMAIL PROTECTED] wrote: Hi, I am trying to convert a variable a = sample(1:3,100,rep = T) represents choices into a

Re: [R] newbie question about index

2006-09-01 Thread Joris De Wolf
what about: b - rbind(1*(a==1),1*(a==2),1*(a==3)) z s wrote: Hi, I am trying to convert a variable a = sample(1:3,100,rep = T) represents choices into a 3X100 dummy varible b with corresponding element set to 1 otherwise 0. eg. a: 1 3 2 1 2 3 1 1 b: 1 0 0 1 0 0 1 1.. 0

Re: [R] newbie question about index

2006-09-01 Thread Petr Pikal
Hallo probably there are other options but outer(1:3,a, ==)*1 can do what you want. HTH Petr On 31 Aug 2006 at 22:41, z s wrote: Date sent: Thu, 31 Aug 2006 22:41:27 +0800 (CST) From: z s [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch

Re: [R] newbie question: ROW average

2006-05-29 Thread Dimitris Rizopoulos
look at ?rowMeans; you can also use apply(mat, 1, mean) but rowMeans() is better. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax:

Re: [R] newbie question: ROW average

2006-05-29 Thread Peter Dalgaard
A Ezhil [EMAIL PROTECTED] writes: Hi, I am new to R programming. I have a 992 x 74 matrix. I would like to form a new matrix by averging each 4 rows from the original one. How can I use 'apply' instead of usual mean inside the nested for loop? How about dim(M) - c(4,248,74) mn -

Re: [R] newbie question: ROW average

2006-05-29 Thread Rolf Turner
Peter Dalgaard wrote: How about dim(M) - c(4,248,74) mn - apply(M, c(2,3), mean) Hey! That's sexy! Much better than my kludgy suggestion! cheers, Rolf __

Re: [R] newbie question: ROW average

2006-05-29 Thread Rolf Turner
Dimitris Rizopoulos wrote: look at ?rowMeans; you can also use apply(mat, 1, mean) but rowMeans() is better. By my reading of the question, this is not what Ezhil wants. He said: ``I have a 992 x 74 matrix. I would like to form a new matrix by averaging

Re: [R] newbie question: ROW average

2006-05-29 Thread Dimitris Rizopoulos
/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Rolf Turner [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Monday, May 29, 2006 1:55 PM Subject: Re: [R] newbie question: ROW average Dimitris Rizopoulos

Re: [R] newbie question: ROW average

2006-05-29 Thread Gabor Grothendieck
Try this: rowsum(mat, gl(nrow(mat)/4, 4)) / 4 On 5/29/06, A Ezhil [EMAIL PROTECTED] wrote: Hi, I am new to R programming. I have a 992 x 74 matrix. I would like to form a new matrix by averging each 4 rows from the original one. How can I use 'apply' instead of usual mean inside the

Re: [R] newbie question: ROW average

2006-05-29 Thread A Ezhil
@stat.math.ethz.ch Sent: Monday, May 29, 2006 1:55 PM Subject: Re: [R] newbie question: ROW average Dimitris Rizopoulos wrote: look at ?rowMeans; you can also use apply(mat, 1, mean) but rowMeans() is better. By my reading of the question, this is not what Ezhil wants. He said

Re: [R] newbie question: ROW average

2006-05-29 Thread Peter Dalgaard
A Ezhil [EMAIL PROTECTED] writes: When I tried with (assuming 'M' is my old matrix): dim(M) - c(4,248,74) mn - apply(M, c(2,3), mean) the following error occured: Error: dim- : dims [product 73408] do not match the length of object [74] In that case, M clearly wasn't a 992x74 matrix!

Re: [R] Newbie to R: would like to solve a problem

2006-05-12 Thread Shawn Mikula
Using R for this would be a bit bone-headed since it is not ideally suited for web apps. Look at an active scripting language like PHP. I'm not sure if Geocities provides for server-side active scripting languages, in which case you will have to host your site elsewhere. - Original

Re: [R] Newbie to R: would like to solve a problem

2006-05-12 Thread McGehee, Robert
Not sure I completely followed (especially what a Knockback is), but I'll give this a try. If you want to precisely define the convolution of multiple attacks, you would want to use a language that utilizes symbolic integration, which R currently does not support (e.g. see Mathematica). That

Re: [R] Newbie to R: would like to solve a problem

2006-05-12 Thread percy tiglao
I'm not using R server-side. I'd like to use R to get a (say) Taylor Series polynomial based on the 2nd convolution of the probability distribution . From there, I can make a Javascript function that is a pretty precise estimation of that convolution. PS: Thanks for the S Poetry reccomendation

Re: [R] Newbie to R: would like to solve a problem

2006-05-12 Thread tom wright
I often use R to create graphs for my web applications which are normally developed in PHP. I use the PHP command exec to shell out to the R script, passing any parameters on the command line. The params are then available in R using the commandArgs function. How to get the data back is another

Re: [R] Newbie to R: would like to solve a problem

2006-05-12 Thread McGehee, Robert
, 2006 4:26 PM To: r-help@stat.math.ethz.ch Subject: Re: [R] Newbie to R: would like to solve a problem I'm not using R server-side. I'd like to use R to get a (say) Taylor Series polynomial based on the 2nd convolution of the probability distribution . From there, I can make a Javascript function

Re: [R] Newbie question about read.table

2006-05-11 Thread Steve Miller
Are you prefixing the variable names with the data.frame name, i.e. mydf$col2, or referencing by index mydf[,2]? Steve Miller -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Kaplan Sent: Thursday, May 11, 2006 12:39 PM To: r-help@stat.math.ethz.ch

Re: [R] Newbie question about read.table

2006-05-11 Thread Chuck Cleland
David Kaplan wrote: Hi When I use the read.table function with header = T, I notice that it gives me the variable names along the top as I expect. But, when I then attempt an analysis, e.g. regression, it doesn't recognize the variable names. Am I missing a step. Thank you

Re: [R] Newbie question about read.table

2006-05-11 Thread David Kaplan
@stat.math.ethz.ch Sent: Thursday, May 11, 2006 1:53 PM Subject: Re: [R] Newbie question about read.table David Kaplan wrote: Hi When I use the read.table function with header = T, I notice that it gives me the variable names along the top as I expect. But, when I then attempt an analysis, e.g

Re: [R] Newbie question about read.table

2006-05-11 Thread Chuck Cleland
=birthweight)) Thanks all! - Original Message - From: Chuck Cleland [EMAIL PROTECTED] To: David Kaplan [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Thursday, May 11, 2006 1:53 PM Subject: Re: [R] Newbie question about read.table David Kaplan wrote: Hi When I use

Re: [R] Newbie question about read.table

2006-05-11 Thread Sean O'Riordain
O'Riordain [EMAIL PROTECTED] To: David Kaplan [EMAIL PROTECTED] Sent: Thursday, May 11, 2006 1:46 PM Subject: Re: [R] Newbie question about read.table Hi David, Can you show us the code that you're trying to use? cheers, Sean On 11/05/06, David Kaplan [EMAIL PROTECTED] wrote: Hi When I

Re: [R] Newbie question about read.table

2006-05-11 Thread David Kaplan
Thanks all. I'll give the various suggestions a try. Best David - Original Message - From: Sean O'Riordain [EMAIL PROTECTED] To: David Kaplan [EMAIL PROTECTED]; r-help r-help@stat.math.ethz.ch Sent: Thursday, May 11, 2006 2:05 PM Subject: Re: [R] Newbie question about read.table Hi

Re: [R] Newbie question about read.table

2006-05-11 Thread David Kaplan
This worked! Thanks! - Original Message - From: Chuck Cleland [EMAIL PROTECTED] To: David Kaplan [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Thursday, May 11, 2006 1:58 PM Subject: Re: [R] Newbie question about read.table David Kaplan wrote: Here is what I'm doing

Re: [R] Newbie question: setting rgl.surface plot attributes

2006-04-12 Thread Duncan Murdoch
Joseph Retzer wrote: I don't seem to be able to label the x, y or z axis when creating a 3d chart using rgl.surface. I'd like to have them parallel to the axis line and move with the graph when rotated. Can this be done? rgl.surface is a low level function for drawing a surface. It's more

Re: [R] -newbie | RODBC import query

2006-04-04 Thread Jeff Newmiller
Evan Cooch wrote: [...] OK, so after a bit of reading, seems I need to use RODBC (I'm using [R] 2.2.1 for Windows, at the moment). But, I can't seem to figure out the basics. Suppose the file I need to 'work with' is test.dbf So, I try the following: library(RODBC); import_dat -

Re: [R] -newbie | RODBC import query

2006-04-04 Thread Prof Brian Ripley
Here is real example anyone can use since it ships with R. library(RODBC) con - odbcConnectDbase(system.file(files, sids.dbf, package=foreign)) tmp - sqlFetch(con, sids) close(con) As I have written before, .dbf is not well-defined, and it depends on Microsoft's driver and your database

Re: [R] -newbie | RODBC import query

2006-04-03 Thread ronggui
I just try and it works well for dbase III and dBase IV format database,but if the database is dBase II format,some error comes.I hope this help. library(RODBC) import_dat - odbcConnectDbase(file.choose()) (table_list - sqlTables(import_dat)) TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE

Re: [R] -newbie | RODBC import query

2006-04-03 Thread Prof Brian Ripley
This all depends on the ODBC drivers, and hence on the exact version of the non-R software installed. Note that read.dbf (in package foreign) provides an alternative approach (but again depends on someone's reading of '.dbf format'). On Mon, 3 Apr 2006, ronggui wrote: I just try and it

Re: [R] -newbie | RODBC import query

2006-04-02 Thread Dieter Menne
Gabor Grothendieck ggrothendieck at gmail.com writes: odbcConnectionDbase(c:\\documents and settings\\egc\\desktop\\test.dbf) or use simple forward slashes, which are easier to read and work even under Windows. (Just for the record, looks it was not the problem) Dieter

Re: [R] -newbie | RODBC import query

2006-04-01 Thread Gabor Grothendieck
On 4/1/06, Evan Cooch [EMAIL PROTECTED] wrote: Greetings - After 20+ years of using SAS, for a variety of reasons, I'm using [R] for a bunch of things - while I'm getting a pretty good a handling [R] for script programming, and statistical analysis, I'm struggling with 'pulling data into

Re: [R] -newbie | RODBC import query

2006-04-01 Thread Evan Cooch
At 12:14 PM 4/1/2006, Gabor Grothendieck wrote: OK, so after a bit of reading, seems I need to use RODBC (I'm using [R] 2.2.1 for Windows, at the moment). But, I can't seem to figure out the basics. Suppose the file I need to 'work with' is test.dbf So, I try the following:

Re: [R] Newbie clustering/classification question

2006-03-26 Thread Sean Davis
Mark A. Miller wrote: My laboratory is measuring the abundance of various proteins in the blood from either healthy individuals or from individuals with various diseases. I would like to determine which proteins, if any, have significantly different abundances between the healthy and

Re: [R] Newbie question about SQL and data sources

2006-03-24 Thread David Whiting
Hi Rex, Take a look at the Data Import/Export manual that ships with R to get a feel for some of your options. I use a variety of techniques depending on what I am doing. Quite often I use MySQL, accessing my tables via RODBC. Other times text files are most appropriate. Then on other occasions I

Re: [R] (newbie) Weighted qqplot?

2006-03-15 Thread Duncan Murdoch
On 3/15/2006 8:31 AM, Vivek Satsangi wrote: Folks, Normally, in a data frame, one observation counts as one observation of the distribution. Thus one can easily produce a CDF and (in Splus atleast) use cdf.compare to compare the CDF (BTW: what is the R equivalent of the SPlus cdf.compare()

Re: [R] (newbie) Weighted qqplot?

2006-03-15 Thread Vivek Satsangi
Folks, I am documenting what I finally did, for the next person who comes along... Following Dr. Murdoch's suggestion, I looked at qqplot. The following approach might be helpful to get to the same information as given by qqplot. To summarize the ask: given x, y, xw and yw, show (visually is

Re: [R] (newbie) Weighted qqplot?

2006-03-15 Thread Duncan Murdoch
On 3/15/2006 1:38 PM, Vivek Satsangi wrote: Folks, I am documenting what I finally did, for the next person who comes along... Following Dr. Murdoch's suggestion, I looked at qqplot. The following approach might be helpful to get to the same information as given by qqplot. To summarize the

Re: [R] Newbie error or bug?

2006-03-13 Thread Uwe Ligges
Your error: If you use plot(), the coordinate system of user coordinates is set up each time, but you do want to plot in the coordinate system of your first plot, hence use: plot(time, signal, type = l, col = blue, xaxs = r, yaxs = r, xlab = Time (msec), ylab = Signal, main = Aliasing,

Re: [R] Newbie error or bug?

2006-03-13 Thread Paul Vickers
That also works and is even more concise.Many thanks, Paul Uwe Ligges wrote: Your error: If you use plot(), the coordinate system of user coordinates is set up each time, but you do want to plot in the coordinate system of your first plot, hence use: plot(time, signal, type = l, col =

  1   2   3   >