Hi R-Gurus,
I've been cutting along quite nicely with nlm, until
I threw in the following condition in the function that nlm is
minimising:
if (((term*bexp) 0.0001)) {
#warning(term*bexp, =term*bexp,psi,=psi)
theta-2000
}
Now when I run this function anywhere
On Mon, 2 Jun 2008, Tokuyasu, Taku wrote:
Hello,
I am interested in performing a 2D loess smooth on microarray data, i.e.
log2 ratios on a 2D grid, using different spans in the horizontal and
vertical directions (the immediate reason being that replicate spots are
laid out in the horizontal
Either you have a corrupt .RData file in the directory you are starting R
in or the file is being read incorrectly (e.g. because of a corrupted file
system or hardware issues).
Reinstalling etc will not remove the .RData file, and you need to do so
yourself.
Starting R with --vanilla is
It says the value is *missing* (NA), not that the length is wrong.
My quess is that term*bexp is NaN, but you have given us no context to go
on.
On Tue, 3 Jun 2008, Redding, Matthew wrote:
Hi R-Gurus,
I've been cutting along quite nicely with nlm, until
I threw in the following condition
c == cgenolin [EMAIL PROTECTED]
on Tue, 03 Jun 2008 00:32:13 +0200 writes:
c Hi the list.
c I got a probleme with R CMD check. I run a package.skeleton on a very
c simple code (four toy function, no probleme with the R CMD build). But
c on the R CMD check packClassique, I
provide commented, minimal, self-contained, reproducible code.
Please do -- both --
Sorry... Usualy, I do...
--- 8
userA - function(x)x+1
privateA - function(x)x+2
.userB - function(x)x+10
.privateB - function(x)x+20
userC- function(x)userA(privateA(x))
privateC -
Please, can someone suggest me where to find a description for the
attributes of the summary of regsubsets,
that is:
which rsqrssadjr2 cp bicoutmat obj ??
Thank you so much.
--
Maura E.M
[[alternative HTML version deleted]]
hello
dear sir,
Inbsp;wonder whether ifnbsp;anybody try to
constructnbsp;acontinous parameternbsp;AR(P)
from the discrete parameter AR(P)
execuse me for my bad english lang.
and thank you for your helpful.
On Tue, Jun 03, 2008 at 10:37:33AM +1000, Jason Lee wrote:
Hi,
If there are more than one item having the same value, how can i use R to
take the average of the position. E.g:-
X Y Z
131 22.2 3.4 4.4
132 20.0 3.4 4.4==Position 2 if queried
150 20.0 12.2 4.5 =Position
Thank everybody for the answers! The stop and quit functions are what I
need (it is a script, not a function what needs to be terminated. I was
talking about an exit function, what can be confusing).
Best,
Federico
Gregory. R. Warnes wrote:
Since Frederico indeicated he was running a script,
Hi Chip
Maybe some more experienced users can direct you to proper source of
information but in case of programming there are several books which can
be of some use (I do not have any of them so its only my guess from their
names). See items 1, 3 and 5 from CRAN Books page.
Regards
Petr
c == cgenolin [EMAIL PROTECTED]
on Tue, 03 Jun 2008 09:55:15 +0200 writes:
provide commented, minimal, self-contained, reproducible code.
Please do -- both --
c Sorry... Usualy, I do...
c --- 8
c userA - function(x)x+1
c privateA -
I can't get rpart accept case weights defined inside a function.
It keeps using the copy defined in the global environment (if they
exists) instead of the function-defined ones.
Here is what I do:
test.function - function (formula, data) {
weights - rep(.1, 100)
rpart(formula, data,
Dear all,
I'm trying to generate latex-formatted tables for panel data regressions
using the mtable function of the memisc package, which is quite good. I
use the plm package for panel data regression. Unfortunately, it seems
that mtable works very well when using either lm or glm, but it
Hello
Does anybody know how one can compute d largest eigenvalues/eigenvectors in
R, like in MATLAB eigs function ? eigen function computes all
eigenvectors/eigenvalues, and they are slightly different than those
generated by matlab eigs.
Thanks in advance
--
View this message in context:
Hello, this is the first time I send a mail to r-help mailing list.
I'm developing a program in java with calls in R and I can`t use jri 0.4-1
with R 2.7 or 2.6 .but it runs with 2.4.
The problem that I get when using the latest version of R is as follows:
Cannot find JRI native library!
Please
'weights' should be a column in your 'data': that is the standard way to
specify weights to a model-fitting function.
On Tue, 3 Jun 2008, Xavier Robin wrote:
I can't get rpart accept case weights defined inside a function.
It keeps using the copy defined in the global environment (if they
At 03:07 03/06/2008, john.polo wrote:
hello all,
i want to split a list into smaller lists. the list looks like this:
CW-W730 CW-W720 CW-W710 CW-W700 CW-W690 CW-W680 CW-W670
CW-W660
CE-W997 CE-W987 CE-W977 CE-W967 CE-W956 CE-W944 CE-W934
CE-W924 7W-W760 7W-W750 7W-967W-941
A bit of fiddling suggests that the problem is less to do with rpart
(which will quite happily acept weights defined inside a function) and
more to do with the formula argument to the test function.
This is probably because defining the formula in the global environment
(as you implicitly do by
I noticed that both in the fArma and fracdiff packages it is not possible to
predict an object fitted with an ARFIMA model. Moreover, the ox link is no
more available.
However, is it possible to find the coefficient d of differentiation of a
time series, and then predict the time series by
Dear all,
I would like to perform a clustering analysis on a data frame with two
coordinate variables (X and Y) and a categorical variable where only a != b can
be established. As far as I understood classification analyses, they are not
an option as they partition the training set only in k
Birgit Lemcke wrote:
I have a dataframe and two of my variables are in the wrong position
and I would like to swap those variables.
In addition to the other solutions posted, if you prefer to reference
the columns by name rather than by index, you could use subset()
dat - data.frame(a =
Maura E Monville maura.monville at gmail.com writes:
Please, can someone suggest me where to find a description for the
attributes of the summary of regsubsets,
that is:
which rsqrssadjr2 cp bicoutmat obj ??
The docs say:
An object of class regsubsets containing no
Dear kayteck,
Function eigen (see ?eigen) will do what you want.
HTH,
Jorge
On Tue, Jun 3, 2008 at 5:42 AM, kayteck_master [EMAIL PROTECTED] wrote:
Hello
Does anybody know how one can compute d largest eigenvalues/eigenvectors in
R, like in MATLAB eigs function ? eigen function computes
Paul,
Thanks very much! Your example code below shows exactly how to do what I wanted.
-Ben
p.s., For the record,
transRight - current.transform()
after the second call to pushViewport() seems to have gotten deleted from you
example code below, but that was obvious.
-Original Message-
Dear Miha,
a general way to do this is as follows:
Define a distance measure by aggregating the
Euclidean distance on the (X,Y)-space and the trivial 0-1 distance (0 if
category is the same) on the categorial variable. Perform cluster analysis
(whichever you want) on the resulting distance
Hi all,
i'm trying to install JGR on linux (see bottom), but it runs into errors.
The bottom of the sequence below shows JavaJD could not be found
Any suggestion, please?
$ sudo apt-get install sun-java6-jdk
$ sudo update-alternatives --config java
There are 5 alternatives which provide
Jorge Ivan Velez [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
Dear kayteck,
Function eigen (see ?eigen) will do what you want.
HTH,
He had looked, but since eigen returns both eigenvalues and
eigenvectors, and does so in a list, perhaps he needs advice about how
to extract his
S Ellison a écrit :
As a work-round, try something lik
test.function - function (formula.str, data) {
weights - rep(.1, 8)
rpart(as.formula(formula.str), data, weights)
}
which works if formula.str is a string instead of a formula object.
Ok, I think I got the point. The only problem
Thanks might be easier in my case because I have so many variables.
Could have found this solution on my own.
Birgit
Rogers, James A [PGRD Groton] wrote:
Birgit Lemcke wrote:
I have a dataframe and two of my variables are in the wrong position
and I would like to swap those
Your R is way too old: please follow the advice in the posting guide.
I suspect the current JavaJD requires R = 2.7.0 from the errors you are
getting below.
On Tue, 3 Jun 2008, g-h-d wrote:
Hi all,
i'm trying to install JGR on linux (see bottom), but it runs into errors.
The bottom of the
Hi,
I noticed the following fortune in R 2.7 and 2.6.2:
fortune('Spreads')
If anything, there should be a Law: Thou Shalt Not Even Think Of Producing A
Graph That Looks Like Anything From A Spreadsheet.
-- Ted Harding (in a discussion about producing graphics)
R-help (August 2008)
Thanks.
I basically followed the steps in http://lib.stat.cmu.edu/R/CRAN/, and those
below for JGR and it worked.
...but there are problems with help files e.g. ?matrix generates the
following message:
/tmp/RtmpvxsnQa/.R/doc/html/packages.html (No such file or directory)
g-h-d wrote:
Hi
Dear Prof Ripley,
Hello,
I am interested in performing a 2D loess smooth on microarray data, i.e.
log2 ratios on a 2D grid, using different spans in the horizontal and
vertical directions (the immediate reason being that replicate spots are
laid out in the horizontal direction). Is
That is actually from August 2007 (typo in the fortunes package).
If you do
RSiteSearch('Thou Shalt Not Even Think Graph Spreadsheet')
Then it will bring up the actual post and you can read it in context (along
with the posts that lead to it and those that followed).
Basically, Ted was
Hi.
I am running a gam for covariate forward inclusions/ backward exclusions,
using the weight options as follow.
library(gam)
gam.object1-gam(ET~1, data=nonp.dat, weights=PROBA)
summary(gam.object1)
step.object1-step.gam(gam.object1, direction=both , trace=T,
Dear R users
I tried a lot to solve the following problem but could not. I have two arrays
having same order i.e 1 by 150.
j=10; ss=150; r=array(0 , c( j , ss )); rr=array(0 , c( j , ss )); r1=array(0 ,
c( j-1 , ss )); r2=array(0 , c( j-1 , ss ));
r3=array(0 , c( 2 , ss ))
for(i in 1:j-1){
Michael Dewey wrote:
split() where the f variable =
c(1E-*,1W-*,2E-*,2W-*,5E-*,5W-*,7E-*,7W-*,CE-*,CW-*),
but * doesn't work as a wildcard as i had hoped. can someone tell me
the appropriate wildcard character/symbol to use, please
Did you really use split()?
yes, i did. the output looked
Presumably the original poster was looking for a function that would compute
just the largest five eigenvalues and associated vectors, because that is
enormously more efficient for a large matrix than computing all of them.
eigen() computes all of them.
One way to compute just a few is to use
Jorge Ivan Velez wrote:
Dear John,
Assuming that your information is in the list x, does
substr(x,1,2)
work for you?
HTH,
Jorge
thanks for your reply Jorge. i will try substr().
john
__
R-help@r-project.org mailing list
attempting to install rJava on R-2.7.0, x86_64 platform, config.log shows the
following error:
configure:3880: checking whether JNI programs can be compiled
configure:3898: gcc -m64 -std=gnu99 -o conftest -g -O2
-I/path/to/x86-64-linux/jdk-1.6.0_06/jre/../include
hi ladyes and gentlemans of the R comunity.
i have the following graphical issue:
# say y is a matrix or a dataframe with
dim(51,nrow=17),hence 3 columns;
l-51
# now the 3 colums represents 3 different aspects of
my continuous variable (3 factors),plotted against a
categorical one;
Hi,
I have a data frame that I want to split into two based on the values of a
variable in it.
The variable Y has numeric values ranging between 0 through 70. I want to
plot the frequencies of another variable X in two different cases:
- When Y = 0 and
- When Y 0
How does one go about doing
On 3 June 2008 at 08:42, g-h-d wrote:
| I basically followed the steps in http://lib.stat.cmu.edu/R/CRAN/, and those
| below for JGR and it worked.
|
| ...but there are problems with help files e.g. ?matrix generates the
| following message:
|
| /tmp/RtmpvxsnQa/.R/doc/html/packages.html (No
Hello to everyone,
I have a general question about how to add a column to a table.I have a table
that has 62 columns and 2000 rows.I am wanting to add a column on the left most
row.I am wanting to label the rows g1 to g2000 I have the code of
(g,c(1:nrow(dat)),sep=) for the right side of the
?by may be helpful here
eg if dat is your data.frame and yf is a factor (created using ifelse)
use by(dat,yf,mean) to compute the means for each level of yf
hth, Ingmar
On Jun 3, 2008, at 8:37 PM, Marvin Lists wrote:
Hi,
I have a data frame that I want to split into two based on the
values
Dear Michael,
I don't think that anyone else has suggested a fix, so here's one:
snip ---
# Mahalanobis Dsq for a matrix of variables
dsq - function(x, Sigma) {
if (missing(Sigma)) Sigma - cov(x, use=complete.obs)
dev - scale(x, scale=FALSE)
# DSQ - dev %*% solve(Sigma)
Dear Thomas
Yes, you're right. But I'm looking for this not only for computational cost
reasons.
eigen function from R has identical behavior to matlab function eig, but not
to eigs.
Even in matlab you can check that those function are not giving identical
results.
Here you have a short example
Paul
It is not entirely clear to me what you want to do. However, if you are
wanting to add row names then try
row.names(dat) - paste('g', 1:nrow(dat), sep='')
First twenty rows of columns 1:3 are obtained by
dat[1:20,1:3]
Regarding putting all the points in a column onto a scatterplot. One
Dear R-list members,
I've had a hard time trying to solve a non-linear system (nls) of equations
which structure for the equation i, i=1,...,4, is as follows:
f_i(d_1,d_2,d_3,d_4)-k_i(l,m,s) = 0(1)
In the expression above, both f_i and k_i are known functions and l, m and
Hi Jorge,
Have you tried to use systemfit package. In this package, this is a
function call nlsystemfit . This might help.
Chunhao
Quoting Jorge Ivan Velez [EMAIL PROTECTED]:
Dear R-list members,
I've had a hard time trying to solve a non-linear system (nls) of equations
which
I have been using separate environments to partition my data and functions
into logical groups but I have been having an odd (to me) problem.
To load and manipulate the data environments, I wrote a couple of small
functions (see below). The problem seems to be that when I initially try to
load
hello, useRs-
i have a function that i wrote myself, for example, lag(x). however, when
i load 'zoo' packages and try to lag 'zoo' object, it gave me error. (R try
to
pass 'zoo' object into my function.)
i typed 'lag.zoo' in R, but it can't find it. how can i access 'lag.zoo'
function?
and in
Hello,
I am fairly new to using R and am trying to install it on my Linux
machine, running Scientific Linux. I get through running 'configure'
and 'make' OK, but when I run 'make check', I get the following error:
make check
make[1]: Entering directory
Dirk Eddelbuettel wrote:
On 3 June 2008 at 08:42, g-h-d wrote:
| I basically followed the steps in http://lib.stat.cmu.edu/R/CRAN/, and
those
| below for JGR and it worked.
|
| ...but there are problems with help files e.g. ?matrix generates the
| following message:
|
|
Greetings,
I am working in the sem package on a model with 3 exogenous variables (2
are nominal-categorical), and 4 endogenous, continuous variables. To
use sem with the nominal variables, I created dummy variables. Now, in
my sem output I have estimates for path coefficients for the
zoo has a namespace and lag.zoo is not exported so zoo:::lag.zoo
is how to access it directly.
See
help(:::)
On Tue, Jun 3, 2008 at 4:31 PM, jiho.han [EMAIL PROTECTED] wrote:
hello, useRs-
i have a function that i wrote myself, for example, lag(x). however, when
i load 'zoo' packages and
I find the problem: the name of my base directory (the one that contain
R, man and test) was not the same than the name of the package...
I thaught this was allowed, I guess I was wrong.
Christophe
c == cgenolin [EMAIL PROTECTED]
on Tue, 03 Jun 2008 09:55:15 +0200 writes:
provide
From: Nathan Coulter
It looks like the command above could use /lib64/libc.so.6, but running R
CMD
javareconf shows that JNI linker flags don't contain any entry similar to
'-L/lib64':
It turns out that /usr/lib64/libc.so is what is needed. I was able to install
rJava after adding
c == cgenolin [EMAIL PROTECTED]
on Wed, 04 Jun 2008 00:30:08 +0200 writes:
c I find the problem: the name of my base directory (the
c one that contain R, man and test) was not the same than
c the name of the package...
Aha!
c I thaught this was allowed, I guess I was
Thanks for your reply.
In your last step If I create a duplicate ( two similar records )
# create a duplicate
vv[8,1] - 7
vv[8,2]-'g'
and then I merge vv with vv2 ,both duplicates are merged. Is there a way to
tell R to merge only the unique records.
Thanks and appreciate your help.
--
Hi,
The following error occurs while executing 'make' after the successful
configuration (./configure) on IBM-AIX 5.2 (GCC 4.2.4 installed):
gcc -std=gnu99 -I../../src/extra/zlib -I../../src/extra/bzip2
-I../../src/extra/pcre -I. -I../../src/include -I../../src/include
Dirk Eddelbuettel wrote:
On 3 June 2008 at 13:44, g-h-d wrote:
| | $ sudo apt-get install sun-java6-jdk
| |
| | $ sudo update-alternatives --config java
| |
| | There are 5 alternatives which provide `java'.
| |
| | Selection Alternative
| |
Also check ?aggregate
--- On Wed, 4/6/08, Ingmar Visser [EMAIL PROTECTED] wrote:
From: Ingmar Visser [EMAIL PROTECTED]
Subject: Re: [R] splitting data frame based on a criteria
To: Marvin Lists [EMAIL PROTECTED]
Cc: r-help@r-project.org
Received: Wednesday, 4 June, 2008, 5:11 AM
?by may
Hi,
I'm trying to plot time-series data where each sample breaks down the
percentage of CPU time spent in each of four states (usr, nice, sys,
idle)
19:08:15 %usr %nice %sys %idle
19:08:165 0 10 86
19:08:17 17 0 14 69
19:08:185 0 8
On Tue, 3 Jun 2008, Demetri S. Mouratis wrote:
Hi,
I'm trying to plot time-series data where each sample breaks down the
percentage of CPU time spent in each of four states (usr, nice, sys, idle)
19:08:15 %usr %nice %sys %idle
19:08:165 0 10 86
19:08:17 17 0
Since k_i(l,m,s) are known constants, you actually have a system of four
non-linear equations with 4 unknowns.
One possibility is to use optim (check ?optim).
Another one is to use the very recently released package - look at
Hi,
Installed GCC 4.2.4 on IBM-AIX 5.2 and configured 'R' successfully. Although
the below error was resolved after installing GCC 4.2.4, the 'make' failed
in another step (related msg posted on June 03).
Senthilkumaran wrote:
Hi,
Thanks for the response.
We do have a IBM XL Fortran
Hi everyone,
I use R to plot my data set (x,y) in Windows XP, but keep getting error message
like follows,
...
plot(x, y)
Error in windows() : unable to start device devWindows
How can I solve this problem? Thanks for any suggestion or help.
CC
Hi,
Added -Wl,-bnoquiet in Makeconf and executed 'make'. The following error
occured:
gcc -std=gnu99 -I. -I../../../src/include -I../../../src/include
-I/usr/local/include -DHAVE_CONFIG_H -mno-fp-in-toc -g -O2 -c Lapack.c -o
Lapack.o
gcc -std=gnu99 -Wl,-brtl -Wl,-G
I would like to merge “data1 “that contains 100 unique ID’s with another
data set “data 2” with 150 ID’s and the age of those individuals ( the ID in
data1 is a subset of the ID in data 2) I would like to merge these data1
with data2 and have the result of the merge to have the ID ordered as in
Hello all,
I've become confused by the output produced by a call to
anova(model1,model2). First a brief background. My model used to predict
final tree height is summarised here:
Df Sum Sq Mean Sq F valuePr(F)
Treatment 2 748.35 374.17
Here is a variation of the example below which uses
your data. Paste this into an R session:
Lines - 19:08:15 %usr %nice %sys %idle
19:08:165 0 10 86
19:08:17 17 0 14 69
19:08:185 0 8 87
19:08:19 10 0 10 81
19:08:203
On 03/06/2008 6:53 PM, Chin-Cheng Su wrote:
Hi everyone,
I use R to plot my data set (x,y) in Windows XP, but keep getting error message
like follows,
...
plot(x, y)
Error in windows() : unable to start device devWindows
How can I solve this problem? Thanks for any suggestion or help.
I have a data set(Bill) of with 1 variable (var1), with 100 obs that are in
ascending order. I want to sample every 10 observations and save them in 10
different groups such as
Group1 is obs 1-10
Group 2 is obs-11-20
and so on.
First step is to subset them into the 10 groups, then
On Sat, May 31, 2008 at 2:45 PM, Peter Dalgaard
[EMAIL PROTECTED] wrote:
Paul Johnson wrote:
Hell
(1) par(xpd=TRUE) allows you to write outside the plotting region
O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B
As usual, PD right on the money. Here's a working demo
Hey,
The following is a function I wrote which generates random variables from a
Kappa (2-parameter) distribution.
rkappa - function(n,beta,alpha){
if(alpha = 0)
stop(alpha must be greater than zero!)
if(beta = 0)
stop(beta must be greater than zero!)
Vec -
Where do you want to place ID's which are in data2 but NOT in data1?
--- On Wed, 4/6/08, kayj [EMAIL PROTECTED] wrote:
From: kayj [EMAIL PROTECTED]
Subject: [R] merge two data sets
To: r-help@r-project.org
Received: Wednesday, 4 June, 2008, 9:45 AM
I would like to merge “data1 “that
One possibility is:
x - ceiling((1:100)/10)
aggregate(var1,by=list(x),mean)
--- On Wed, 4/6/08, William Pepe [EMAIL PROTECTED] wrote:
From: William Pepe [EMAIL PROTECTED]
Subject: [R] Question about subsetting data
To: r-help@r-project.org
Received: Wednesday, 4 June, 2008, 10:35 AM
I
Will this do it for you:
Bill - 1:100 # test data
# partition
Bill.p - split(Bill, rep(1:10, each=10))
Bill.p
$`1`
[1] 1 2 3 4 5 6 7 8 9 10
$`2`
[1] 11 12 13 14 15 16 17 18 19 20
$`3`
[1] 21 22 23 24 25 26 27 28 29 30
$`4`
[1] 31 32 33 34 35 36 37 38 39 40
$`5`
[1] 41 42 43 44
Hello R users and developers,
I am trying to write several functions (fairly new at this) in order
to avoid using loops on large data frames (because they are slow). I
wrote the function below and it seems to get hung on the first part of
the if statement and then applies that condition to rest
-fit1$coefficients
y.control y.lowy.high
(Intercept)19.628713 21.883999 20.023814
log(1 + (age - 45)/10) -7.383725 -6.017342 -5.084431
here is my outcome,I need one vector say b1=first row without the intercept
,like:(19.628713, 21.883999, 20.023814)
and
This is an FAQ (although it doesn't seem to be listed in the official
FAQs.
The ``if'' command compares scalars (only, in effect).
See ?if
You need to use the ifelse() function:
folds - function(x,y) ifelse(x-y=0,2^(x-y),-2^(y-x))
This if for illustrative purposes only. The foregoing
Use ifelse() rather than if () {} else {}. It's vectorized and very
useful for applying to elements along vectors. The latter idiom is much
better for control of flow in programs and functions.
folds - function (x, y) ifelse(x-y = 0, 2^(x-y), -(2^abs(x-y)))
z - folds(x, y)
z
[1] 161
Alan -
ALAN SMITH wrote:
Hello R users and developers,
I am trying to write several functions (fairly new at this) in order
to avoid using loops on large data frames (because they are slow). I
wrote the function below and it seems to get hung on the first part of
the if statement and then
Hi Alan,
-Original Message-
From: [EMAIL PROTECTED] on behalf of ALAN SMITH
Sent: Tue 6/3/2008 6:47 PM
To: r-help@r-project.org
Subject: [R] help understanding why #function(x,y) (if((x-y)=0) {2^(x-y)}
else{-(2^abs(x-y))})# doesn't work likeI think it should
Hello R users and
This is just a slight modification of a question I asked earlier. Thanks to all
the responders.
I have a data set(Bill) of with 1 variable (var1), with 100 obs that are in
ascending order. I want to sample every 10 observations and save them in 10
different groups such as Group1 is obs
Try this:
data.frame(x, y, folds = (x == y) + sign(x - y) * 2 ^ abs(x - y))
or replace data.frame with cbind if you prefer a matrix result.
On Tue, Jun 3, 2008 at 9:47 PM, ALAN SMITH [EMAIL PROTECTED] wrote:
Hello R users and developers,
I am trying to write several functions (fairly new at
a table with three varialbe:treatment
(low,high),size(large,small),response y
I want all response y with treatment=low and size=large,
I try to write as :
treatment-c(low,low,high,high)
size-c(small,large,small,large)
y-c(1,2,4,5)
table1-data.frame(treatment,size,y)
Dear Manli,
Try this:
table1[table1$treatment==low table1$size==large,]
HTH,
Jorge
On Tue, Jun 3, 2008 at 11:19 PM, Manli Yan [EMAIL PROTECTED] wrote:
a table with three varialbe:treatment
(low,high),size(large,small),response y
I want all response y with treatment=low and
Dear William,
Following Jim Holtman's solution to your previous post, you can do something
similar to
Bill - 1:100 # test data
Bill.p - split(Bill, rep(1:10, each=10))
sapply(Bill.p, function(x) mean(x)/0.8)
1 2 3 4 5 6 7 8 9 10
6.875
Greetings,
I am wondering if anyone has written programs to automate model fitting
with the sem package, where one could specify a 'saturated' model and
sequentially fit models with different combinations of parameters
removed, while outputting fit data/parameters involved for each model.
Hello,
I would like to apply the EF function (a goodness of fit test between
predicted (ts2) and observed (Tw) values in the qualV package) to
each of the Sites in my data frame. However, when I try the following
script, R gives an error message that lists unused arguments, which
include
Please look at what I tried,
attach(my.data)
options(device=windows)
plot(x,y)
Error in windows() : unable to start device devWindows
However, as i tried something else, it went like
options(device=devWindows)
plot(x,y)
Error in plot.new() : no active or default device
Any idea?
here is the data:
y-c(5,2,3,7,9,0,1,4,5)
id-c(1,1,6,6,7,8,15,15,19)
t-c(50,56,50,56,50,50,50,60,50)
table1-data.frame(y,id,t)//longitudinal data
what I want to do is to use the linear model for each id ,then get the
estimate value,like:
fit1-lm(y~t,data=table1,subset=(id==1))
but ,you can
Or ?gsummary
Quoting Moshe Olshansky [EMAIL PROTECTED]:
Also check ?aggregate
--- On Wed, 4/6/08, Ingmar Visser [EMAIL PROTECTED] wrote:
From: Ingmar Visser [EMAIL PROTECTED]
Subject: Re: [R] splitting data frame based on a criteria
To: Marvin Lists [EMAIL PROTECTED]
Cc:
How about
library(nlme)
allFits - lmList(y ~ t|id, data=table1, pool=FALSE)
or
allFits - by(table1, table1$id, function(x) lm(y ~ t, data=x))
Both ways store the results as a list, so you can access individual results
using list extraction.
--Matt
-Original Message-
From: [EMAIL
Try something like this:
fits - list(500)
for (i in 1:500)
{
if (sum(table1$id == i) == 0) fits[[i]] - NA
else fits[[i]] - lm(y~t,data=table1,subset=(id==i))
}
--- On Wed, 4/6/08, Manli Yan [EMAIL PROTECTED] wrote:
From: Manli Yan [EMAIL PROTECTED]
Subject: [R] linear model in the repeated
Suppose I have a string of objects names:
name - c(foo, bar, baz)
and I would like to use a for loop to automatically create three
objects called foo, bar and baz accordingly. Then how can this
be done (so that in the workspace, foo = 1, bar = 2 and baz=3)
for (i in name) {
.
}
You can use either assign or eval.
Something like
name - c(foo, bar, baz)
for (i in 1:length(name)) assign(name[i],i)
--- On Wed, 4/6/08, Mark Farnell [EMAIL PROTECTED] wrote:
From: Mark Farnell [EMAIL PROTECTED]
Subject: [R] how to automatically create objects with names from a string
100 matches
Mail list logo