Hello,
I have data of Body length and Body weight of 8 boys and 7 girls.
I want to draw the plot of Body length (for X) and Body weight (for Y)
based on sex.
Then the two plots want to be overlapped for comparison.
I used the code below but found the unit length of X axis of boy and
girl plot ar
Hi
Instead of two plots with par(new = TRUE) try to put boys and girls together
(quite natural thing, they will be pleased 8-)
together <- rbind(boy, girl)
together$sex <- factor(rep(c("boy", "girl"), c(8,7)))
plot(together$body_length, together$body_weight, ,
col=c("firebrick3","saddlebro
Hi, arun
I'm so sorry for that isn't helpful.
One of question is that I don't know how to subset a small part as it
is a 3-dimension array so I just show the structure of that.
I tried dput() to a file , then what should I do for subsetting it?
Another question is :
My rawdata is a "melt" data
Hello together,
i want to round some numbers in my data.frame.
How can i round a number to values like 0.5; 1.0; 1.5; 2.0; etc.
It should look like this one
before
2.2 ; 2.3; 2.26; 1.11
after
2.0; 2.5; 2.5; 1.0
thanks.
Mat
--
View this message in context:
http://r.789695.n4.nabble.com/rou
R-64 latest
Hi. I am trying to plot a set of csv data, which looks like
> head(interval)
date inteval
1 2012-07-01 00:57:54 +0900 156
2 2012-07-01 01:07:41 +0900 587
3 2012-07-01 01:09:31 +0900 110
4 2012-07-01 01:18:42 +0900 551
5 2012-07-01 01:39:01 +0900
Dear Brian,
At the moment, the various forest() functions are not meant to accept 'col' as
an argument. While it is indeed possible to specify a 'col' argument, it will
be passed on via the ... argument to further functions within forest() and this
is where things can go awry.
To give a more
On 07.01.2013 09:59, Mat wrote:
Hello together,
i want to round some numbers in my data.frame.
How can i round a number to values like 0.5; 1.0; 1.5; 2.0; etc.
It should look like this one
before
2.2 ; 2.3; 2.26; 1.11
after
2.0; 2.5; 2.5; 1.0
round(2*x)/2
Uwe Ligges
thanks.
Mat
--
On 07.01.2013 09:55, ishi soichi wrote:
R-64 latest
Hi. I am trying to plot a set of csv data, which looks like
head(interval)
date inteval
1 2012-07-01 00:57:54 +0900 156
2 2012-07-01 01:07:41 +0900 587
3 2012-07-01 01:09:31 +0900 110
4 2012-07-01 01:18:
On 07.01.2013 07:00, Michael Rennie wrote:
Hi all,
I have read through the archives, but can't find a solution to this
problem.
I need the text direction on "dependent B", plotted in margin 4, to go
top to bottom (opposite what it is now). Here's some sample code:
#plot with mtext example
Thanks a lot.
Please kindly indicate the meaning of the c(8,7).
> together <- rbind(boy, girl)
> together$sex <- factor(rep(c("boy", "girl"), c(8,7)))
Elaine
On Mon, Jan 7, 2013 at 4:55 PM, PIKAL Petr wrote:
> Hi
>
> Instead of two plots with par(new = TRUE) try to put boys and girls together
Thank you Petr, the code is wonderful.
One more question,
you used [as.numeric(together$sex)] to drawing plots many times (Par(new)).
Please kindly advise if there is a similar method to replace drawing
ablines many times.
If not, I am afraid that the ablines will not follow the same Y and
X-axis
Brilliant, this works very well. Thank you for explaining this so clearly,
all your points are well taken.
Sincerely,
Brian
Brian Z Ring PhD
Professor, Director
Institute of Personalized and Genomic Medicine
College of Life Science
Huazhong University of Science and Technology
Wuhan, China
Hi
> -Original Message-
> From: Elaine Kuo [mailto:elaine.kuo...@gmail.com]
> Sent: Monday, January 07, 2013 1:45 PM
> To: PIKAL Petr
> Cc: r-help@r-project.org
> Subject: Re: [R] plot xaxp issue
>
> Thank you Petr, the code is wonderful.
>
> One more question,
> you used [as.numeric(tog
Windows 7
R 2.12.1
I am trying to write a function (see sample code below) that will take the
output of a t-test and produce results suitable for a table.
I have two questions
(1) You will note that the name of the outcome variable, which is "value" in
the input is replaced by the string "outcome
Hi All,
is there a reasonably simple way of using a black and white chequer/checker
board pattern as a colour:
barplot(mydata, col = c('red', 'blue' 'checkerboard'))
?
BW
F
--
Federico C. F. Calboli
Neuroepidemiology and Ageing Research
Imperial College, St. Mary's Campus
Norfolk Place, Lond
John:
R2.12 ??? Time to update.
1. ?t.test and note the last entry in the Value section.
2. ?with
-- Bert
On Mon, Jan 7, 2013 at 6:44 AM, John Sorkin wrote:
> Windows 7
> R 2.12.1
> I am trying to write a function (see sample code below) that will take the
> output of a t-test and produce r
Hello,
A simple change to your function partly answers to both questions.
Table2 <- function(formula, data) {
temp <- t.test(formula, data)
mydf <- data.frame(dep=temp$data.name,
female=temp$estimate[1],male=temp$estimate[2],
p=temp$p.value,
CI
I've just realized that you're swapping female and male in the creation
of the results data frame.
It should be
Table2 <- function(formula, data) {
dname <- rownames(attr(terms(formula), "factors"))[1]
temp <- t.test(formula, data)
mydf <- data.frame(dep=temp$data.name,
Hi,arun
Yes , I just want to do the t.test
I think maybe it is not necessary to generate a 3D array from the raw
data.frame by acast() at first
Thanks a lot
2013/1/7 arun :
> Hi Yao,
>
> It's okay.
>
> How did you generate the 3 D array?
> Using ?acast()
>
> I am not sure I understand your ques
dear R family,
[a text file has been attached for better understanding]
i have a list of 16 and each of of that is further subdivided into variable
number of lists. So, i have a kind of list into lists phenomenon.
[[1]]$'1'
1 2 3 4 5 6
7 8 9
[[1]]$'2'
1 2
Hello R-helpers,
I need to generate standard variates normal to 'create' chi-squared variates.
To make you more understand,
(1) a<-rnorm(3,0,1)
*after do (1), I need to squared and summed the three values. My problem is,
how am I going to continue the programming if I had to repeat the proce
Hi Agnes,
I think this is likely homework, right? If that's the case, we're
really not supposed to give you help.
If not, why not simply use rchisq to generate chi-sq variates exactly?
MW
On Mon, Jan 7, 2013 at 4:13 PM, Agnes Ayang wrote:
> Hello R-helpers,
>
> I need to generate standard vari
Greetings R users,
I am trying to renumber my groups within the file shown below. The groups
are currently set as 8,9,10,etc. I would like to renumber this as
1,2,3,etc. I have searched the help files and only come across using the
rownames to renumber the values but I need to match values. An
Something like
do.call(cbind, lists)
?
MW
On Mon, Jan 7, 2013 at 4:13 PM, eliza botto wrote:
>
> dear R family,
> [a text file has been attached for better understanding]
> i have a list of 16 and each of of that is further subdivided into variable
> number of lists. So, i have a kind of list
Thanks arun and weylandt,it perfectly worked out..
elisa
> From: michael.weyla...@gmail.com
> Date: Mon, 7 Jan 2013 16:37:53 +
> Subject: Re: [R] list of lists to matrix
> To: eliza_bo...@hotmail.com
> CC: r-help@r-project.org
>
> Something like
>
> do.call(cbind, lists)
>
> ?
>
> MW
>
>
Hi A.K
Below is the comment I get, not sure why.
BP.sub3 is the stacked data without the missing values.
BP.geese3 <- geese(HiBP~time*MaternalAge,data=BP.sub3,id=CODEA,
family=binomial, corstr="unstructured", na.action=na.omit)Error in
`contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
thx, works perfektly :-)
--
View this message in context:
http://r.789695.n4.nabble.com/round-2-3-to-2-5-and-2-2-to-2-0-tp4654813p4654829.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.
Hello all,
I would like to make a parallel coordinate plot with lattice. The plot
should have vertical log scale axes, and should in principle look like
this one (I put less chemical elements in my example below):
http://www.geokem.com/images/scans/epr-and-N_Chile_Ridge.gif
The data I am try
Uwe Ligges-3 wrote
> Hard to debug given we neither have the formula nor the data.
All I can give is that the data is in the form y, x1, x2, x3,... and the
formula is y ~ x1+x2+x3+...
Maybe it's because I'm not explicitly specifying the base learners.
--
View this message in context:
http://r.
Hi all,
I have a very basic doubt -- but still, I am a newby!
My question is about referring to the previous row: in a sample as the
following...
ID X1 X2
1 A 12
2 A 6
3 A 10
1 B 17
2 B 19
1 C 22
1 D 13
2 D 19
3 D 21
... I would like to create a dummy varia
Hi,
Try this:
dat1<-read.table(text="1 2012-07-01 00:57:54 +0900 156
2 2012-07-01 01:07:41 +0900 587
3 2012-07-01 01:09:31 +0900 110
4 2012-07-01 01:18:42 +0900 551
5 2012-07-01 01:39:01 +0900 1219
6 2012-07-01 01:40:40 +0900 99",sep="",header=FALSE,stringsAsFactors=FALSE)
dat2
Hello,
I wanted to post this question below, on the R-help forum, but I'm not sure
I succeeded because it said that I wasn't subscribed to the mailing list
yet.
Now I am subscribed, but will my question be accepted now automatically, or
should I submit it again?
Thanks in advance,
Violet Swakman
Hi Yao,
It's okay.
How did you generate the 3 D array?
Using ?acast()
I am not sure I understand your question "
if you meet a t-test task as I described , is that generate a
high-dimension array a good way ?"
Do you want to do the t-test in the melt dataset?
b<- read.table(text="
ID O2
Sorry, but your current information doesn't help to solve your problem. Not
having explicit base-learners is not the cause of your problem, especially
as for glmboost() there are no explicit base-learners. You should definitely
provide a minimal example that helps to reproduce your error/problem.
Hi,
I have explored many of the R packages that construct Bayesian trees including
the tgp, bart, BMA and maptree packages. I have also searched through some
other packages but they do not seem to be suitable for the type of analysis I
need to do. I need to construct Bayesian CART that have ter
Hello,
In my simulation I use the try()-function to catch possible errors when
fitting models. I run the simulationon a Linux-server using the command
" R CMD BATCH nameOfFile.R &". When executing the code as batch-job I
get the problem that the execution is halted without giving an error
me
Hi Yao,
You could also have the results in a wide format:
res<-do.call(rbind,lapply(lapply(split(b,b$variable),function(x)
t.test(x$value[x$O2=="13%"],x$value[x$O2=="21%"])),function(x)
data.frame(mean13=x$estimate[1],mean21=x$estimate[2],p.value=x$p.value,CILow=x$conf.int[1],CIHigh=x$conf.int[2
Any thoughts on what that dirty hack might be or any leads on where to
start? Perhaps a whole new plot region in the margin or something? Is
that even possible? I'm having a difficult time imagining how I can do this.
Mike
Uwe Ligges wrote:
On 07.01.2013 07:00, Michael Rennie wrote:
Hi
Thank you for your response, I didn't do the -7 because this is just a
small part of the dataset and the number are not all consistent (ie skip
some numbers occasionally). However, I did not think of the
as.numeric(as.factor()) sequence. That did the trick, simple lapse in my
thoughts that cost m
Hi,
It isn't entirely clear what you want, because it seems too simple.
And most of your sample data are irrelevant, aren't they?
Why not just use:
testdata$Event_name2 <- testdata$Event_name - 7
Or you could try:
testdata$Event_name3 <- as.numeric(as.factor(testdata$Event_name))
which will m
Hello,
Try the following.
dat$X3 <- c(0L, dat$ID[-1] <= dat$ID[-nrow(dat)])
Hope this helps,
Rui Barradas
Em 07-01-2013 13:33, Paolo Donatelli escreveu:
Hi all,
I have a very basic doubt -- but still, I am a newby!
My question is about referring to the previous row: in a sample as the
foll
On 07/01/2013 14:50, Yongjie wrote:
Dear Sir/Madam,
After installing R, I saw this warning message in red when I open the R...
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Setting LC_MESS
try this
> x <- read.table(text = 'ID X1 X2
+ 1 A 12
+ 2 A 6
+ 3 A 10
+ 1 B 17
+ 2 B 19
+ 1 C 22
+ 1 D 13
+ 2 D 19
+ 3 D 21', header = TRUE, as.is = TRUE)
> x$X3 <- c(0, diff(x$ID) <= 0)
> x
ID X1 X2 X3
1 1 A 12 0
2 2 A 6 0
3 3 A 10 0
4 1 B 17
I'd suggest you do as the following message suggests and follow the
R-MAC-FAQ section 9 notes on locales and whatnot. If you need specific
advice on following this, we'll need to know what version of OS X
you're running and what your local settings are.
That said, I don't think you'll actually hit
On Jan 7, 2013, at 5:33 AM, Paolo Donatelli wrote:
Hi all,
I have a very basic doubt -- but still, I am a newby!
My question is about referring to the previous row: in a sample as the
following...
ID X1 X2
1 A 12
2 A 6
3 A 10
1 B 17
2 B 19
1 C 22
1 D 13
2 D
On 07-01-2013, at 14:33, Paolo Donatelli wrote:
> Hi all,
>
> I have a very basic doubt -- but still, I am a newby!
>
> My question is about referring to the previous row: in a sample as the
> following...
>
> ID X1 X2
> 1 A 12
> 2 A 6
> 3 A 10
> 1 B 17
> 2 B 19
> 1 C
On 07.01.2013 17:06, Michael Rennie wrote:
Any thoughts on what that dirty hack might be or any leads on where to
start? Perhaps a whole new plot region in the margin or something? Is
that even possible? I'm having a difficult time imagining how I can do
this.
Ideas fir ugly hacks:
Either u
Hello,
I'm not sure I understand. Do you want to renumber column Event_name
starting at 1? If so the following does the job.
dat$Event_name <- dat$Event_name - min(dat$Event_name) + 1
Hope this helps,
Rui Barradas
Em 07-01-2013 16:41, Charles Determan Jr escreveu:
Greetings R users,
I am
On Jan 7, 2013, at 6:50 AM, Yongjie wrote:
Dear Sir/Madam,
After installing R, I saw this warning message in red when I open
the R...
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Set
On Jan 7, 2013, at 8:41 AM, Charles Determan Jr wrote:
Greetings R users,
I am trying to renumber my groups within the file shown below. The
groups
are currently set as 8,9,10,etc. I would like to renumber this as
1,2,3,etc. I have searched the help files and only come across
using the
On 07/01/2013 8:33 AM, Paolo Donatelli wrote:
Hi all,
I have a very basic doubt -- but still, I am a newby!
My question is about referring to the previous row: in a sample as the
following...
ID X1 X2
1 A 12
2 A 6
3 A 10
1 B 17
2 B 19
1 C 22
1 D 13
2 D 19
3
On Jan 7, 2013, at 10:13 AM, David Winsemius wrote:
On Jan 7, 2013, at 8:41 AM, Charles Determan Jr wrote:
Greetings R users,
I am trying to renumber my groups within the file shown below. The
groups
are currently set as 8,9,10,etc. I would like to renumber this as
1,2,3,etc. I have s
It works!
The rationale, if I have understood well, is to take my vector of N elements,
ask to remove the first/last element, and replace the blank space with a given
value.
Thank you all for the support!
-Original Message-
From: Duncan Murdoch
Date: Mon, 07 Jan 2013 13:16:50
To:
Cc:
On Jan 7, 2013, at 8:06 AM, Michael Rennie wrote:
Any thoughts on what that dirty hack might be or any leads on where
to start? Perhaps a whole new plot region in the margin or
something? Is that even possible? I'm having a difficult time
imagining how I can do this.
The `text` functio
> I suppose it is just some basic matter of indexing language, something like
>
> X3<- as.numeric ( ID[n] <= ID[n-1])
>
> but it is not so simple!
If you first define 'n' as
n <- seq_along(ID)[-1] # 2:length(ID)
then that code works.
> with(Data, { n <- seq_along(ID)[-1] ; as.numeric ( ID[n]
Right- I think the issue is getting a text() command (which does accept
srt) to work outside the plot region, and in the margin where I need it
to appear. This is easy to "hack" in a single plot, but not so clear how
to do it in a multi-panel environment with an outer margin.
I suspect going
On Jan 7, 2013, at 10:45 AM, Michael Rennie wrote:
Right- I think the issue is getting a text() command (which does
accept srt) to work outside the plot region, and in the margin where
I need it to appear. This is easy to "hack" in a single plot, but
not so clear how to do it in a multi-
On Mon, Jan 7, 2013 at 11:52 AM, David Winsemius wrote:
>
> If you are going that route you may want to look at the gridBase package.
>
> Yes for mixing base and grid graphics but IMHO overkill here. Replacing
the last mtext line with
grid::grid.text('dependent B', 0.985 , 0.5 , rot = 270)
shoul
Hi,
I have a simple question. Suppose I have a string "x$Expensive". I want
to find the position of the $ in this string; i.e., I want a function
that returns 2. I tried grep, regexpr, etc with no luck, unless I'm
just using them incorrectly. Any suggestions?
Thanks,
Walt
__
This is due to long-staning issue in methods internals, which are
involved because loading Matrix shadows base::mean with Matrix::mean.
A work-around has been in place in R_devel for some time; a proper fix
may come at some point in the future. So if your real code doesn't
need the moficied mean f
HI,
Regarding question:2) Have you checked summary(m1)?
data(seizure)
## Diggle, Liang, and Zeger (1994) pp166-168, compare Table 8.10
seiz.l <- reshape(seizure,
varying=list(c("base","y1", "y2", "y3", "y4")),
v.names="y", times=0:4, directio
HI,
Just to add:
fit3<-geese(hibp~MaternalAge*time,id=CODEA,data=BP.stack5,family=binomial,corstr="exch",scale.fix=TRUE)
#works
summary(fit3)$mean["p"]
# p
#(Intercept) 0.
#MaternalAge4 0.49099242
#MaternalAge5 0.04686295
#time21
HA! Works perfectly!!! Thanks so much ilai.
ilai wrote:
On Mon, Jan 7, 2013 at 11:52 AM, David Winsemius
mailto:dwinsem...@comcast.net>> wrote:
If you are going that route you may want to look at the gridBase
package.
Yes for mixing base and grid graphics but IMHO overkill here.
On Jan 7, 2013, at 3:22 PM, Data Analytics Corp.
wrote:
> Hi,
>
> I have a simple question. Suppose I have a string "x$Expensive". I want to
> find the position of the $ in this string; i.e., I want a function that
> returns 2. I tried grep, regexpr, etc with no luck, unless I'm just using
"$" has a special meaning (end-of-string) in regular expressions, so you can
either escape it with "\\" or not use regular expressions in regexpr():
> regexpr("\\$", "x$Expensive")
[1] 2
attr(,"match.length")
[1] 1
attr(,"useBytes")
[1] TRUE
> regexpr("$", "x$Expensive", fixed=TRUE)
[1] 2
attr(,"
HI,
str1<-"x$Expensive"
regexpr("\\$",str1)[1]
#[1] 2
str2<-"x$Exp$Expression"
unlist(gregexpr("\\$",str2))
#[1] 2 6
A.K.
- Original Message -
From: Data Analytics Corp.
To: "r-help@R-project.org"
Cc:
Sent: Monday, January 7, 2013 4:22 PM
Subject: [R] pattern matching
Hi,
I have
Dear all.
First of all, my english isn't verry good, but I hope I can convey my concern.
I've a general question about the Amelia algorithm. I'm no mathematician or
statistician, but I had to use R and impute and analyse some data, and Amelia
showed results that fitted my expectations. I'll have t
Not as a simple color, but you can use the rasterImage function to add a
rectangle with a checkerboard pattern to a an existing plot, the examples
for the function use a simple checkerboard pattern.
Be careful of overusing something like this, too many patterned areas in a
plot can be more distrac
And look at the grconvertX and grconvertY functions for possibly ways to
compute positioning information when using text with base graphics.
On Mon, Jan 7, 2013 at 11:35 AM, David Winsemius wrote:
>
> On Jan 7, 2013, at 8:06 AM, Michael Rennie wrote:
>
>
>> Any thoughts on what that dirty hack m
On 7 Jan 2013, at 21:53, Greg Snow <538...@gmail.com> wrote:
> Not as a simple color, but you can use the rasterImage function to add a
> rectangle with a checkerboard pattern to a an existing plot, the examples for
> the function use a simple checkerboard pattern.
>
> Be careful of overusing
Or use the "ugly hack" with a bit of locator() trial and error.
Replace the last mtext() call with
text(17.9, 31.9, "dependent B", srt=-90, xpd=NA, cex=1.25)
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX
Yes, thanks a lot for your help!
Regards
2013/1/8 arun :
> Hi Yao,
>
> You could also have the results in a wide format:
> res<-do.call(rbind,lapply(lapply(split(b,b$variable),function(x)
> t.test(x$value[x$O2=="13%"],x$value[x$O2=="21%"])),function(x)
> data.frame(mean13=x$estimate[1],mean21=x
On Mon, Jan 7, 2013 at 4:29 PM, Martin wrote:
> Dear all.
>
> First of all, my english isn't verry good, but I hope I can convey my concern.
> I've a general question about the Amelia algorithm. I'm no mathematician or
> statistician, but I had to use R and impute and analyse some data, and Amelia
HI,
BP.stack5 is the one without missing values.
na.omit(). Otherwise, I have to use the option na.action=.. in the
?geese() statement
You need to read about the correlation structures. IN unstructured option,
more number of parameters needs to be estimated, In repeated measures design,
dear R experts:
I want to define a function the calculates the black-scholes value.
it takes 5 named parameters, BS <- function(S,K,dt,rf,sigma) {} .
let's presume I want to be able to call this not only with my 5
numeric vectors BS( sigma=0.3, S=100, K=100, dt=1, rf=0.1 ) and BS(
100, 100, 1, 0.1
On Jan 7, 2013, at 3:57 PM, ivo welch wrote:
> dear R experts:
>
> I want to define a function the calculates the black-scholes value.
> it takes 5 named parameters, BS <- function(S,K,dt,rf,sigma) {} .
> let's presume I want to be able to call this not only with my 5
> numeric vectors BS( sigma
Hello,
Thanks again.
But something wrong with the subset after lm
>
> It is not about drawing plot many times but coding points or graphic objects
> by some factor. In your case sex.
>
> Instead of
> boyline<-lm(body_weight ~ body_length, boy)
>
> use collective data frame together and subset on
Hello,
I figured out that the code should be
boyline<-lm(body_weight ~ body_length, data=subset (together,,sex=="boy"))
However, the "" could be omitted if the field name happened to be
numeric, such as 1, 2, or 3.
Please kindly explain why the "" could be omitted for numbers.
Thanks again.
Ela
Hello
I have data of body length and body weight of people of different skin colors.
I tried to write a code to plot body length and body weight according
to the skin colors.
(Thanks for Petr's advice so far.)
A loop is used but an error shows up in the following code.
It says:
unexpected '}' i
Hello,
A ")" is missing.
I guess your code should be
for (i in 1:7){
subs <- data$skin_color==levels(data$skin_color)[i]
line <-lm(body_weight~body_length, data=subset(data, subset=subs))
abline(line,col=c("yellow","chocolate1","darkorange2","red3","saddlebrown","coral4","grey38")[i],lwd=2)
}
Hello
Thanks.
It is right a ) is missing for lm.
With the modification, I ran the code but the command seems not
closed, with + instead of >.
Please kindly help.
The code modified
for (i in 1:7) {
subs <- data$skin_color==levels(data$skin_color)[i]
line<-lm(body_weight~body_length, data=s
Hi,
Now, you have too many ")" in the code. The last line should be (as
written in the code I sent you):
> abline(line,col=c("yellow","chocolate1","darkorange2",
> "red3","saddlebrown","coral4","grey38")[i],lwd=2)
HTH,
Pascal
Le 08/01/2013 11:24, Elaine Kuo a écrit :
Hello
Thanks.
It is r
hi david---can you give just a little more of an example? the
function should work with call by order, call by name, and data frame
whose columns are the names. /iaw
Ivo Welch (ivo.we...@gmail.com)
On Mon, Jan 7, 2013 at 4:25 PM, David Winsemius wrote:
>
> On Jan 7, 2013, at 3:57 PM, iv
HI,
A possible guess ( with no data):
for (i in 1:7) {
subs <- data$skin_color==levels(data$skin_color)[i]
line<-lm(body_weight~body_length, data=subset(data, subset=subs)) #closing
parentheses
abline(line,col=c("yellow","chocolate1","darkorange2",
"red3","saddlebrown","coral4","grey
Hello,
I am a new user of R. I am coming from SAS and do statistics on stock
market data, economic data, and social data. My question is this: How
can you get the mean, standard dev, etc. of a variable based on a
conditional statement on either the same variable or a different
variable in the same
You can use the tapply function to do this. You can't type a line into
the mean statement. (See ?mean for what you can type in there). The
general approach is to have a vector of data (stock prices) and a
categorical variable (day of week). Then break up the data vector
according to the levels
Hi
I actually do not know what you are talking about. I believe that the code I
provided works (if i did not make typing mistake), but you failed to provide
data to test so I made my own data and subset inside lm works as expected.
fake<-data.frame(weight<-rnorm(15), length=weight*3+rnorm(15),
Homework? We don't do people's homework for them.
cheers,
Rolf Turner
On 01/08/2013 05:13 AM, Agnes Ayang wrote:
Hello R-helpers,
I need to generate standard variates normal to 'create' chi-squared variates.
To make you more understand,
(1) a<-rnorm(3,0,1)
*after do (1), I
88 matches
Mail list logo