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

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

2007-08-23 Thread MASFERFC Team
First, I should admit that I didn't do a lot of searching beforehand, I'm just cutting to the chase to ask the experts: 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)

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

[R] Newbie

2007-08-16 Thread Alan Harrison
Hello, I'm a bit new to the world of R so forgive my ignorance. I'm trying to do a zero-inflated negative binomial regression and have received an error message and i'm not sure what it means. I'm running R 2.5.1 on XP. I have just tried a really simple version of the model to see if it

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

[R] Newbie creating package with compiled code

2007-07-04 Thread Edna Bell
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 works fine. But I get into trouble with the R CMD

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

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

2007-04-15 Thread cottrell
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 windows but can not find a solution for rgl.

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

[R] Newbie: Simple loops: complex troubles

2007-04-03 Thread projection83
I am used to java (well, i dont remember it really well, but anyway) I have having a really difficult time making simple loops to work. I got the following to work: ## ##Creates objects Ux1, Ux2, Ux2 etc. that all contain n numbers in a random distribution ##

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: [R

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

[R] [newbie] mesuring adequation of normal distribution with a variable

2007-04-01 Thread sloiseau
Hello, I'm looking for a way of mesuring the adequation of a given variable with the normal distribution. Does R provide a standard test for this purpose, or is there a statistical methodology? Best, Sylvain Loiseau __ R-help@stat.math.ethz.ch mailing

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

2007-04-01 Thread projection83
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 this work, i would greatly

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

[R] Newbie: Combn and scripting

2007-03-26 Thread Zamikhaya . Mbalu
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 file. How do I do this? data.csv: a,b,c,d 1,2,3.4 g,3,6,t etc x=data.csv, m=3 Thank you Zam

[R] newbie upgrade from 2.4.0 to 2.4.1 question

2007-03-21 Thread Mark Fisher
Hi, 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? --Mark.

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

[R] Newbie: Acf function

2007-02-08 Thread Martin Percossi
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. TIA Martin __ R-help@stat.math.ethz.ch mailing list

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]

[R] NEWBIE: @BOOK help?

2007-02-08 Thread Zembower, Kevin
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 Regression}, PUBLISHER = {Springer}, YEAR =

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

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

2007-01-19 Thread Ben Fairbank
Greetings listeRs - 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 5 9.295965 NA

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

[R] Newbie question about saving results

2007-01-13 Thread David Kaplan
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, David -- === David

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

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

2006-12-21 Thread sj
I am wondering how to estimate the survival curve for a particular case(s) given a coxph model using this example code: #fit a cox proportional hazards model and plot the #predicted survival curve fit - coxph( Surv(futime,fustat)~resid.ds+strata(rx)+ecog.ps+age,data=ovarian[1:23,])

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

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

2006-12-20 Thread Gav Wood
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: The concatenated vector of Is when P and a subset of T is given,

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

[R] newbie: new_data_frame - selected set of rows

2006-11-30 Thread Darek Kedra
Hello, this is probably trivial but I failed to find this particular snippet of code. What I got: my_dataframe (contains say a 40k rows and 4 columns) distances (vector with euclidean distances between a query vector and each of the rows of my_dataframe) What I do: after scaling data

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

[R] Newbie problem ... Forest plot

2006-11-16 Thread Peter Bolton
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 inside help file Rmeta and meta with

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

2006-11-15 Thread Christian Convey
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 unique values of Y. Each cell

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,

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

2006-10-26 Thread Zembower, Kevin
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)) before2sw2 - subset(before2sw1, as.Date(start, format=%d-%b-%y)

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))

[R] newbie question

2006-10-21 Thread Larry White
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 plot(a,b) but only include

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

[R] Newbie: Selecting data

2006-10-19 Thread Zembower, Kevin
I've been working with R for all of about 8 hours, so anyone with more experience than this should be able to help me. General comments about my methods of work are also welcomed. I have a table that I've imported thusly: w - read.table(woodford.data, header=T) w start thermsgas KWHs

Re: [R] Newbie: Selecting data

2006-10-19 Thread Francisco J. Zagmutt
this helps Francisco Dr. Francisco J. Zagmutt College of Veterinary Medicine and Biomedical Sciences Colorado State University From: Zembower, Kevin [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] Newbie: Selecting data Date: Thu, 19 Oct 2006 16:12:54 -0400 I've been working

Re: [R] newbie question about index

2006-09-04 Thread sun
(CST) From: z s [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] newbie question about index Hi, I am trying to convert a variable a = sample(1:3,100,rep = T) represents choices into a 3X100 dummy varible b

[R] newbie question about index

2006-09-01 Thread z s
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 0 1 0 1 0 0 0... 0 1 0 0 0 1 0 0... Is there something like b[a] =1

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
Subject:[R] newbie question about index 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 0 1 0 1 0

Re: [R] R newbie: logical subsets

2006-07-12 Thread Greg Snow
, 2006 1:06 PM To: Joshua Tokle Cc: r-help@stat.math.ethz.ch Subject: Re: [R] R newbie: logical subsets Try this, using the built in anscombe data set: anscombe[!rowSums(abs(scale(anscombe)) 2),] On 7/11/06, Joshua Tokle [EMAIL PROTECTED] wrote: Hello! I'm a newcomer to R hoping to replace

[R] R newbie: logical subsets

2006-07-11 Thread Joshua Tokle
Hello! I'm a newcomer to R hoping to replace some convoluted database code with an R script. Unfortunately, I haven't been able to figure out how to implement the following logic. Essentially, we have a database of transactions that are coded with a geographic locale and a type. These are

Re: [R] R newbie: logical subsets

2006-07-11 Thread Gabor Grothendieck
Try this, using the built in anscombe data set: anscombe[!rowSums(abs(scale(anscombe)) 2),] On 7/11/06, Joshua Tokle [EMAIL PROTECTED] wrote: Hello! I'm a newcomer to R hoping to replace some convoluted database code with an R script. Unfortunately, I haven't been able to figure out how

[R] R newbie

2006-07-10 Thread kannaiah
Hello, I am new to R and still feeling my way thru it. I am trying to plot the values from this file below on the X-axis of a plot. I have attached the graph to the email...the one i am trying to recreate. Exonstart end 5'UTR 2254006022540121 1 22540122

Re: [R] R newbie

2006-07-10 Thread jim holtman
Does this do what you want: x - Exonstart end 5'UTR 2254006022540121 1 2254012222540140 2 2254030322540493 3 2254155222541565 4 2254237322542519 5 2254426522544432 3'UTR 2254443322544856 y -

[R] newbie question: ROW average

2006-05-29 Thread A Ezhil
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? Thanks in advance. regards, ezhil __

Re: [R] newbie question: ROW average

2006-05-29 Thread Dimitris Rizopoulos
/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: A Ezhil [EMAIL PROTECTED] To: r-help r-help@stat.math.ethz.ch Sent: Monday, May 29, 2006 1:24 PM Subject: [R] newbie question: ROW average Hi, I am new

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

  1   2   3   4   >