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
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
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)
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
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
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
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
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
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
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
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.
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
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
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
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
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
##
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)
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
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
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
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
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
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()
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
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
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
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.
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
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?
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
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
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
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 ---
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]
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 =
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
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)
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
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
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
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
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
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
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
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
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
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
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
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
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
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,])
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
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,
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:
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,
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
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)
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
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
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
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
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
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
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
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
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
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
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
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
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,
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)
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
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
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))
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
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
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
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
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
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
(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
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
(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
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
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
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
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
, 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
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
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
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
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 -
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
__
/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
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 -
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
__
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
/
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
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
@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 - 100 of 333 matches
Mail list logo