Hi,
I have obstacles in changing list to variable,
if I have
name=names(x)
name --> contain "Sales1", "Sales2"
and then I want to call:
model$stability$name
The list name above will refer to Sales1 and Sales2
How can I do that? thanks
__
On 14/09/2009, Steve Lianoglou wrote:
> Hi,
>
> On Sep 14, 2009, at 9:47 AM, e-letter wrote:
>
>> Readers,
>>
>> I have been reading the r book (Crawley) and tried to use the
>> influence measures function for linear regression, as described. I
>> have one datum that I wish to show in the graph bu
Some hints:The reshape works on the small set of data provided.
The answer looks like this:
> reshape(rl, idvar=c("sil_cf","sil_pi"), timevar="prog", direction="wide")
sil_pi sil_cf id_rl.1 sil_dat_avv.1 id_rl.2 sil_dat_avv.2
1 04567XX NLMDRE64A5XX 6382000-08-03
Thanks Peter.
I have tried your approach, and it does not work. I guess it is because the
format of the x-axis (and its associated data) has the format of date while
numbers like 1998, 2003 etc. are treated as numeric (i.e. not the date
format).
Thank you for your time anyway. :)
Cheers,
Chris
Hello all,
I'm trying to use the package qvalue. Upon trying to install it I'm running
into trouble. I re-downloaded and installed the most recent CRAN
distribution of R which announced itself to have tcltk included. Now when I
try to load qvalue I'm getting errors that seem to indicate that I need
On Mon, Sep 14, 2009 at 3:55 PM, Jacob Wegelin wrote:
> How would I create the following plot using lattice?
>
> symbols( combPsummary$pastRate, combPsummary$finRate,
> circles=sqrt(combPsummary$N) )
>
> The idea is to plot finRate vs pastRate using circles whose areas are
> proportional to the nu
As already suggested, you're (much) better off if you specify colClasses, e.g.
tab <- read.table("~/20090708.tab", colClasses=c("factor", "double", "double"));
Otherwise, R has to load all the data, make a best guess of the column
classes, and then coerce (which requires a copy).
/Henrik
On Mon
Tena koe Chris
?axis
e.g.,
plot(yourX, yourY, xlim=c(1998,2008), xaxt='n')
axis(1, c(1998,2003,2008))
HTH
Peter Alspach
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Chris Li
> Sent: Tuesday, 15 September 2009 3:22 p
> its 32-bit representation. This seems like it might be too
> conservative for me, since it implies that R allocated exactly as much
> memory for the lists as there were numbers in the list (e.g. typically
> in an interpreter like this you'd be allocating on order-of-two
> boundaries, i.e. sizeof(
> I think this is just because you picked short strings. If the factor
> is mapping the string to a native integer type, the strings would have
> to be larger for you to notice:
>
>> object.size(sample(c("a pretty long string", "another pretty long string"),
>> 1000, replace=TRUE))
> 8184 bytes
>>
On Mon, Sep 14, 2009 at 8:58 PM, Eduardo Leoni wrote:
> And, by the way, factors take up _more_ memory than character vectors.
>
>> object.size(sample(c("a","b"), 1000, replace=TRUE))
> 4088 bytes
>> object.size(factor(sample(c("a","b"), 1000, replace=TRUE)))
> 4296 bytes
I think this is just bec
On Mon, Sep 14, 2009 at 8:35 PM, jim holtman wrote:
> When you read your file into R, show the structure of the object:
...
Here's the data I get:
> tab <- read.table("~/20090708.tab")
> str(tab)
'data.frame': 1797601 obs. of 3 variables:
$ V1: Factor w/ 6 levels "biz_details",..: 4 4 4 4 4
And, by the way, factors take up _more_ memory than character vectors.
> object.size(sample(c("a","b"), 1000, replace=TRUE))
4088 bytes
> object.size(factor(sample(c("a","b"), 1000, replace=TRUE)))
4296 bytes
On Mon, Sep 14, 2009 at 11:35 PM, jim holtman wrote:
> When you read your file into R,
Hi all,
I would like to change the x-axis of my graphs from year 1998 to 2008 with
an interval of 5 (i.e. 1998, 2003, 2008). Any help would be greatly
appreciated.
http://www.nabble.com/file/p25447219/model_hydrographs.txt
model_hydrographs.txt http://www.nabble.com/file/p25447219/bore_sample.t
When you read your file into R, show the structure of the object:
str(tab)
also the size of the object:
object.size(tab)
This will tell you what your data looks like and the size taken in R.
Also in read.table, use colClasses to define what the format of the
data is; may make it faster. You mi
Dear Sir,
rcom is a great package of R. Yet it seems that there is some problem of
Chinese character supporting.
comGetPropery() always get the part of the Chinese character.
Any suggestion would be appreciated.
Thanks.
Michael
> library(rcom)
Loading required package: rscproxy
> txe<-comCrea
Hi, all
I happen to a question about multivariate meta-analysis. I found the
function of mvmeta in gap package, but I don't know for sure how to
construct a covariance matrix. Now, I have 20 studies, each having 6
coefficients for the basis functions from an additive model. I can extract
the covar
Hello all,
To start with, these measurements are on Linux with R 2.9.2 (64-bit
build) and Python 2.6 (also 64-bit).
I've been investigating R for some log file analysis that I've been
doing. I'm coming at this from the angle of a programmer whose
primarily worked in Python. As I've been playing a
Section 11.1 and 11.4 of "An Introduction to R" gives a pretty thorough start
for aov models (does not get into mixed/survival and others).
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> From: r
In a sense, the syntax is easy. Both left and right hand sides must be valid R
expressions.
What you are probably looking for is a complete description of the semantics.
That's quite a different issue. The meaning of terms in a formula, and even the
allowable forms, vary from function to func
Hi,
I am looking for a complete description of the syntax of the formula
that shall be specified in, for example, aov. But I can't find a
complete description. Can somebody point to me if there is such a
resource?
Regards,
Peng
__
R-help@r-project.org
See the check.names= argument to read.table.
On Mon, Sep 14, 2009 at 9:40 PM, Steven Kang wrote:
> Dear R users,
>
>
> Suppose the csv file contains header names such as *"Nike, dunk"*, *"Converse,
> All stars"* etc
>
> When imported to R (with header = T option), the column names are given by:
>
Dear R users,
Suppose the csv file contains header names such as *"Nike, dunk"*, *"Converse,
All stars"* etc
When imported to R (with header = T option), the column names are given by:
*"Nike..dunk"* *"Converse..All.stars"*
I have tried the following command to convert these c
You understand what I meant. I should say it more clearly in my original post.
Regards,
Peng
On Mon, Sep 14, 2009 at 7:30 PM, Greg Snow wrote:
> I think Penkyu is not asking for the statistical definitions, but rather some
> help for what the different parts of the object are. Elements like
>
Not the most beautiful solution: start your message with carriage return, e.g.
> stop("\rA long enough message");
A long enough message
> stop("\rfoo");
fooor:
/H
On Mon, Sep 14, 2009 at 5:06 PM, Bert Gunter wrote:
> I don't believe the solution proposed below works and anyway misses the
> whol
The symbols function is base graphics which does not play nicely with lattice
graphics (without extra work).
Here is one approximation that works with lattice:
x <- runif(10)
y <- rnorm(10)
z <- runif(10, 1,5)
library(lattice)
library(TeachingDemos) # for panel.my.symbols and friends
xyplot( y
I think Penkyu is not asking for the statistical definitions, but rather some
help for what the different parts of the object are. Elements like
coefficients and residuals seem fairly obvious (but could still be somewhat
ambiguous, are the residuals raw/standardized/studentized/etc.). Objects
I don't believe the solution proposed below works and anyway misses the
whole point of tryCatch(), which is **not** to test manually:
f <- function(i){
val <- tryCatch(get("i"), error = function(e)"input error")
val ## can test val and carry on if not an error
}
## testit
> f()
[1] "input erro
On 15/09/2009, at 9:11 AM, Maria Sagot wrote:
Dear all,
I'm performing poisson regressions using the glm(family=poisson) and
zero-inflated regressions using the zeroinfl from the package pscl.
However
any of those give an R^2 and I was wondering if there is a way to
get it.
R^2 is meaning
On Sep 14, 2009, at 6:25 PM, Santosh wrote:
Dear R'sians..
I apologize if this topic has been beaten to death and hope that
hawks don't
pounce on me!
Could you please suggest an efficient way to filter rows from 500+
text
files (some with 3+ rows with multiple section table headers)
Dear all,
I'm performing poisson regressions using the glm(family=poisson) and
zero-inflated regressions using the zeroinfl from the package pscl. However
any of those give an R^2 and I was wondering if there is a way to get it.
Thanks
--
Maria Sagot
Graduate Student
107 Life Sciences Building
On 14/09/2009 6:53 PM, Henrique Dallazuanna wrote:
From the instalation instructions in CRAN:
"
R 2.9.2 for Windows
===
This distribution contains a binary distribution of R-2.9.2 to run on
Windows 2000 and later (including 64-bit versions of Windows) on ix86
and x86_64 chips.
How would I create the following plot using lattice?
symbols( combPsummary$pastRate, combPsummary$finRate,
circles=sqrt(combPsummary$N) )
The idea is to plot finRate vs pastRate using circles whose areas are
proportional to the number of people in each group.
The following attempt does not reall
>From the instalation instructions in CRAN:
"
R 2.9.2 for Windows
===
This distribution contains a binary distribution of R-2.9.2 to run on
Windows 2000 and later (including 64-bit versions of Windows) on ix86
and x86_64 chips. It is designed to be as close as possible to the
im
Dear R Users,
Thanks in advance.
I am currently using R-2.9.1-win32.exe on Windows XP.
Is there any 64 bit binary on Windows XP?
Once again, thank you very much for the time you have given.
Regards,
Deb
**
T
On 14-Sep-09 22:30:12, Duncan Murdoch wrote:
> On 14/09/2009 4:32 PM, Liviu Andronic wrote:
>> Hello
>>
>> On 9/14/09, Ted Harding wrote:
>>> This has been sent by software which inserted no line-breaks.
>>> As a result, each paragraph is viewed (by my browser, Firefox)
>>> as one very long li
> Date: Mon, 14 Sep 2009 10:32:09 -0500
> From: Peng Yu
>
> Hi,
>
> x=matrix(1:60,nr=6)
>
> I can refer the last 2 rows by
> x[5:6,]
>
> If I don't know the total number of rows is 6, is there a way to refer
But R does known the total number of rows: it's NROW(x) -- or nrow(x)
if you are sur
On 14/09/2009 4:32 PM, Liviu Andronic wrote:
Hello
On 9/14/09, Ted Harding wrote:
This has been sent by software which inserted no line-breaks.
As a result, each paragraph is viewed (by my browser, Firefox)
as one very long line, not wrapped. In particular, the third
Slightly off-topic, b
Dear R'sians..
I apologize if this topic has been beaten to death and hope that hawks don't
pounce on me!
Could you please suggest an efficient way to filter rows from 500+ text
files (some with 3+ rows with multiple section table headers) residing
in several folders? I guess probably "scan"
On Sep 14, 2009, at 5:29 PM, Peng Yu wrote:
Hi,
I get the following variables. Instead of guessing what they mean, is
there a centralized location in R help() that describes their meaning
and usage?
names(afit)
[1] "coefficients" "residuals" "effects" "rank"
[5] "fitted.values" "
Does anyone know if there is a function in R that will compute
marginal effects after a probit or logit model, much like STATA's
command mfx?
Thanks,
Aleks
Aleksandr Andreev
Graduate Student - Department of Economics
University of North Carolina at Chapel Hill
Mobile: +1
You might have a look at the reshape __package__, which I generally find
easier to use than the reshape function.
Kevin Wright
On Mon, Sep 14, 2009 at 9:41 AM, Luca Braglia wrote:
> Hello *
>
> I would like to reshape wide the following dataset:
>
>
> > rl <- read.dta("intermedi/rapporti_lavor
On Sep 14, 2009, at 5:14 PM,
wrote:
thank you all for your help. I do know how to use which() but my
problem is that I am writing a function in which this is just part
of it. After seeing the (a-b)[bfor which is negative and which is positive.
Can you explain what you mean? There are
Hi,
I get the following variables. Instead of guessing what they mean, is
there a centralized location in R help() that describes their meaning
and usage?
> names(afit)
[1] "coefficients" "residuals" "effects" "rank"
[5] "fitted.values" "assign""qr""df.residual"
Hi Edward,
In your post, rather than asking for the indexes, you asked for the numbers,
AFAICS. Now, whether you want the indexes in which (b-a) is either positive
or negative, then do
which(b-a>0) # Positives
# [1] 2 3 6 7
which(b-a<0) # Negatives
# [1] 1 4 5
(a-b)[b wrote:
> than
The cat() function has already been pointed out to you (and that may be
enough), but for a little more elaborate alternative, see the txtStart and
txtComment functions in the TeachingDemos package for a glorified wrapper to
sink/cat/etc.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
dear R wizards: apologies for two queries in one day. I have a long form
data set, which identifies about 5,000 regressions, each with about 1,000
observations.
unit date y x
120060101
120060102
...
5000 20081230
5000 20081231
I need to run such regressions many many times
thank you all for your help. I do know how to use which() but my problem is
that I am writing a function in which this is just part of it. After seeing the
(a-b)[b wrote:
On Sep 14, 2009, at 3:02 PM, Jorge Ivan Velez wrote:
Hi Edward,
Here is a suggestion:
a = c(4,5,1,7,8,12,39)
b =
Hi,
On Sep 14, 2009, at 5:10 PM, Polwart Calum (County Durham and
Darlington NHS Foundation Trust) wrote:
Sorry I'm having one of those moments where I can't find the answer
but I bet its obvious...
I'm outputting my results to a file using sink()
Is there a command simillar to php's ech
Sorry I'm having one of those moments where I can't find the answer but I bet
its obvious...
I'm outputting my results to a file using sink()
Is there a command simillar to php's echo command that would allow me to add
some text to that file ie:
dataFr$a = 1:10
dataFr$b = 2*1:10
sink ("filepat
Hi swertie ,
Could you please add more details ?
What field are you at, some links maybe ?
Thanks,
Tal
On Mon, Sep 14, 2009 at 8:30 PM, swertie wrote:
>
> Hello! It is not really linked to R, but can somebody explain me why we
> sometimes make a mantel test directly for to distance matrices
Hi Peng ,
I am not sure I understood your question.
Are you asking what the "ss" and "p values" and so on mean ?
Tal
On Mon, Sep 14, 2009 at 11:58 PM, Peng Yu wrote:
> Hi,
>
> I don't quite understand what are the return values of aov. I know
> that it has 'coefficients'. But I need to k
could you please give an example on how that might be done using the doSNOW
?
(I asked the same question here:
http://blog.revolution-computing.com/2009/08/parallel-programming-with-foreach-and-snow.html
And
got only a partial reply)
Can any one share some experience in doing this ?
Thanks!
Ta
Hi,
I don't quite understand what are the return values of aov. I know
that it has 'coefficients'. But I need to know what all the other
return values are. Can somebody let me know how to figure them?
Value:
An object of class 'c("aov", "lm")' or for multiple responses of
class 'c("mao
Hi Tony,
It appears you (and David) where right, and my own problem came from another
issue which wasn't the floating point. (the problem was misspelling of the
colname of the data.frame I used as the newdata in the predict.lm)
Yet I am still happy with my posting, only to get your informed reply
Hi Guys,
thank you all for you comments. Actually, I had a typo and you'r right that
it should be "subdata[-c(11,22,33) , ]"
However, this does not work well either. I think, I know the reason:
In the diagnostic diagramm (that you get with plot(linreg) ), the number
which are assigned to the mo
Excellent - the "as.data.frame" trick was just what I needed!
Many thanks,
Nick
From: baptiste auguie [baptiste.aug...@googlemail.com]
Sent: 14 September 2009 17:48
To: Masca, N.
Cc: r-h...@stat.math.ethz.ch
Subject: Re: [R] Which "apply" function to use?
See last line to every message on r-help which in particular
asks for reproducible code and in this case means include
date and count. Note ?dput
This work for me:
library(lattice)
tt <- as.POSIXct(Sys.Date() + 1:10)
y <- seq_along(tt)
xyplot(y ~ tt)
as does this:
library(zoo)
xyplot(zoo(cbind
Thanks for the pointer. I should have looked at variable values first!
It appears that libname contains the path to the library and then loading
the rda file is just a matter of constructing the path properly
On Mon, Sep 14, 2009 at 3:28 PM, cls59 wrote:
>
>
>
> Hi, I have seen the answer to th
Dear R-people
I am struggling with disappearing legend box when using logarithmic
axis in scatterplot.
Sample code:
###
library(car)
#constructing data set
x=rep(1:50, 2);
ClassDummy=rep(1:2, each=50) ;
y=5+ClassDummy+(rnorm(100,mean=(50/x),sd=(10/x)))
mydata <- data.frame (cbind('x'
Hi,
I'm trying to do something simple (I think) with lattice graphics. I want
to have three xyplots in a single column, where the x axis for the three is
a date range and the y axes are numeric.
I tried doing the first chart, and ran into a problem. When I enter:
xyplot (date ~ count)
I get a
(Although I must admit that the current thread about SVMs leaves
me --- personally --- cold. I think that SVMs are a load of dingos'
kidneys.
So, you're saying that you find them so essential that life w/o them
is practically impossible ... unless we have dingo dialysi
Hello
On 9/14/09, Ted Harding wrote:
> This has been sent by software which inserted no line-breaks.
> As a result, each paragraph is viewed (by my browser, Firefox)
> as one very long line, not wrapped. In particular, the third
>
Slightly off-topic, but in such cases one solution would be to
On 15/09/2009, at 7:42 AM, Ted Harding wrote:
Hi Folks,
I don't often grumble,
Well Ted, that's just a flaw in your character! I guess
you can't help it! :-)
cheers,
Rolf
##
Attentio
Hi,
On Sep 14, 2009, at 2:34 PM, kylle345 wrote:
Hi,
I have 5 different files. Each file has about 1000 columns and
about 3000
rows. Basically what I want to do is take the average of the 1000
columns
and then graph it (line graph). How would I do this for 5 files at
the same
time a
On 15/09/2009, at 6:14 AM, Noah Silverman wrote:
Ravi,
If you don't like my questions, simply don't answer them.
My sediments exactly! :-)
The R-help forum frequently digresses into issues that are
not fundamentally R-related. Subscribers can participate
in
Try this:
sapply(sapply(summary(bgaov), '[[', 1), '[[', 'Mean Sq')
On Mon, Sep 14, 2009 at 4:45 PM, Paul wrote:
> I'm trying to write a function to automate doing a variance analysis, part
> of which involves doing some further calculations. The method I've been
> using isn't very robust, if va
I'm trying to write a function to automate doing a variance analysis,
part of which involves doing some further calculations. The method I've
been using isn't very robust, if variable names change then it stops
working.
For this dummy data
> dput(assayvar,"")
structure(list(Run = structure(c(
Try this:
if (!exists("i"))
tryCatch(stop(""),
error = function(e)invisible(),
finally=print("Please set the i variable"))
On Mon, Sep 14, 2009 at 3:38 PM, carol white wrote:
> Thanks to your replies.
>
> In fact, the problem doesn't come from "exists" but from "stop" t
Hi Folks,
I don't often grumble, but this time I've found myself inconvenienced
by a posting stored on R-help archives:
https://stat.ethz.ch/pipermail/r-help/2009-September/211095.html
This was Karin Groothuis-Oudshoorn & Stef van Buuren's message
on 10 September about the new version of MICE.
T
It would be even greater if you could get us started with some commented,
minimal, self-contained, reproducible code.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of kylle345
Sent: Monday, September 14, 2009 1:35 PM
To: r-help@r-pr
Thanks. That fixes things.
I saw mention of \\. in ?Quotes, but the usage was not clear. I took it
to mean the \ was to be printed. Maybe my little example would help, as
?Quotes doesn't have any.
JN
Henrique Dallazuanna wrote:
You need double backslashes:
grep('\\.f', cvec, value = TRUE)
On 9/14/2009 3:25 PM, Prof. John C Nash wrote:
If I run
cvec<-c("test.f", "test.sf", "try.g","try.res", "try.f")
print(cvec)
indx<-grep('\.f',cvec,perl=TRUE)
fset<-cvec[indx]
print(fset)
I get
> cvec<-c("test.f", "test.sf", "try.g","try.res", "try.f")
> print(cvec)
[1] "test.f" "test.sf" "
No you cannot. You may want to write a merge function with the special
capability but there is no better way than the one suggested by
Henrique.
On Sep 14, 12:18 pm, JiHO wrote:
> On 2009-September-11 , at 13:55 , wrote:
>
> > Maybe:
>
> > do.call(rbind, lapply(with(xy <- rbind(x, y), split(xy,
Hi,
I'm trying to plot a longitudinal data set, using ggplot and adding some
summary info (eg. mean, 1 sd bounds) using geom=ribbon. The summary
info is based on a subset of the original data (eg. less an outlier).
But I'm having trouble getting the ribbons to show up correctly. It's
probably s
Or:
(a - b)[b < a]
On Mon, Sep 14, 2009 at 4:16 PM, David Winsemius wrote:
>
> On Sep 14, 2009, at 3:02 PM, Jorge Ivan Velez wrote:
>
> Hi Edward,
>> Here is a suggestion:
>>
>> a = c(4,5,1,7,8,12,39)
>> b = c(3,7,8,4,7,25,78)
>> d <- a-b
>> d[which(d>0)]
>> # [1] 1 3 1
>>
>
> #Or even:
> d <-
Hi,
I have 5 different files. Each file has about 1000 columns and about 3000
rows. Basically what I want to do is take the average of the 1000 columns
and then graph it (line graph). How would I do this for 5 files at the same
time and plot the average of the 5 files into one graph.
it would
Hello! It is not really linked to R, but can somebody explain me why we
sometimes make a mantel test directly for to distance matrices and sometimes
we first make a gradient analysis and then a mantel test between the axis?
Thank you
--
View this message in context:
http://www.nabble.com/Mantel-
You need double backslashes:
grep('\\.f', cvec, value = TRUE)
On Mon, Sep 14, 2009 at 4:25 PM, Prof. John C Nash wrote:
> If I run
>
>
> cvec<-c("test.f", "test.sf", "try.g","try.res", "try.f")
> print(cvec)
> indx<-grep('\.f',cvec,perl=TRUE)
> fset<-cvec[indx]
> print(fset)
>
> I get
>
> > cvec
Hi, I have seen the answer to this sometime before but I just can't find it
again - pointers appreciated.
I have a package that contains some data.frames saved as .Rda files in the
data/ directory. When the package is loaded I would like to have them be
available in the workspace (without the u
If I run
cvec<-c("test.f", "test.sf", "try.g","try.res", "try.f")
print(cvec)
indx<-grep('\.f',cvec,perl=TRUE)
fset<-cvec[indx]
print(fset)
I get
> cvec<-c("test.f", "test.sf", "try.g","try.res", "try.f")
> print(cvec)
[1] "test.f" "test.sf" "try.g" "try.res" "try.f"
> indx<-grep("\.f",cvec
On Sep 14, 2009, at 3:02 PM, Jorge Ivan Velez wrote:
Hi Edward,
Here is a suggestion:
a = c(4,5,1,7,8,12,39)
b = c(3,7,8,4,7,25,78)
d <- a-b
d[which(d>0)]
# [1] 1 3 1
#Or even:
d <- (a-b)[which((a-b)>0)]
d
#[1] 1 3 1
HTH,
Jorge
On Mon, Sep 14, 2009 at 2:50 PM, Edward Chen
wrote:
Derek Norton gmail.com> writes:
> I am trying to convert numbers to English words, e.g. 123 -> One
> hundred twenty three. After some searching, I have been unable to
> find any info on this. I could certainly write code to do it, but my
> question is this: Does anyone know of a function that
See this post from the past (by John Fox):
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46843.html
-Johannes
2009/9/14 Derek Norton
> I am trying to convert numbers to English words, e.g. 123 -> One
> hundred twenty three. After some searching, I have been unable to
> find any info on this.
On Sep 14, 2009, at 2:11 PM, Derek Norton wrote:
I am trying to convert numbers to English words, e.g. 123 -> One
hundred twenty three. After some searching, I have been unable to
find any info on this. I could certainly write code to do it, but my
question is this: Does anyone know of a func
Hello -
I am attempting to add interaction terms to a model using the gamm
function in the mgcv package. I stripped it down to only two terms to
simplify it. I have no trouble with individual terms, continuous or
factors, nor with interacting factor terms; I cannot, however, figure
out how to add
Hi Edward,
Here is a suggestion:
a = c(4,5,1,7,8,12,39)
b = c(3,7,8,4,7,25,78)
d <- a-b
d[which(d>0)]
# [1] 1 3 1
HTH,
Jorge
On Mon, Sep 14, 2009 at 2:50 PM, Edward Chen wrote:
> I have a code:
> *a = c(4,5,1,7,8,12,39)
> b = c(3,7,8,4,7,25,78)
> d =a-b
> for(i in 1:length(d)){
> if(d[i]>0){x
iaw4 wrote:
>
> Sorry, one more: on OSX, I deleted my old 2.9.2 R.app, and installed the
> 64
> bit version of 2.9.0. I then did an "install.packages("car")" under my
> new
> 2.9.0. It seems to have worked, but alas, I still get an error that
> package
> 'car' was built under R version 2.9.2
It is difficult to know what you're trying to do here, I think. Is this it?
You almost surely don't need a for loop to accomplish your task, and should
make use of the pre-existing vectorized functions provided to you.
a <- c(4, 5, 1, 7, 8, 12, 39)
b <- c(3, 7, 8, 4, 7, 25, 78)
d <- a - b
whi
?nrow
Bert Gunter
Genentech Nonclinical Biostatistics
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Federman, Douglas
Sent: Monday, September 14, 2009 9:03 AM
To: Peng Yu; r-h...@stat.math.ethz.ch
Subject: Re: [R] How to refer to
I have a code:
*a = c(4,5,1,7,8,12,39)
b = c(3,7,8,4,7,25,78)
d =a-b
for(i in 1:length(d)){
if(d[i]>0){x = list(d[i])
print(x)}
else{y = list(d[i])
print(y)}}
the results are:
[[1]]
[1] 1
[[1]]
[1] -2
[[1]]
[1] -7
[[1]]
[1] 3
[[1]]
[1] 1
[[1]]
[1] -13
[[1]]
[1] -39
which will tell me what
Thanks to your replies.
In fact, the problem doesn't come from "exists" but from "stop" that displays
Error even if call. = FALSE. To answer to Dan, I quoted the pramater of exists.
So when the variable is not defined, stop displays the expression message
preceded by "Error". So the question w
Dear package mgcv users,
I am using package mgcv to describe presence of a migratory bird species as
a function of several variables, including year, day number (i.e.
day-of-the-year), duration of survey, latitude and longitude. Thus, the
"global model" is:
global_model<-gam(present ~ as
On Sep 14, 2009, at 2:00 PM, ivo welch wrote:
thanks, everyone. I was a bit confused.
I now think that the "car" error was because the package on the cran
website
itself was built under 2.9.2, not because I had an old version lying
around,
which my package continued to use instead of a ne
Dear All,
I am attempting to perform an ANOVA with three factors: feature (3
levels), group (5 levels), and patient (246 levels), where patient is
nested within group.
I am using the following command:
fit <- lm(intensity ~ feature + group + feature:group + group/patient,
data = new)
> a) How to change the text in the legend (for example, "number" instead of
> "n").
Use: scale_size("number")
> b) How to avoid having a legend for the polygon?
Don't include the value for alpha inside aes (you want to set it as
opposed to mapping it).
So,
ggplot(mydata, aes(x, y)) + geom_poi
Ravi,
If you don't like my questions, simply don't answer them.
--
N
On 9/14/09 10:12 AM, Ravi Varadhan wrote:
Noah,
It may be just me - but how does "any" of your questions on prediction
modeling relate to R?
It seems to me that you have been getting a lot of "free" consulting from
this for
Hi,
a developer asked me something (we were talking about a issue in R
highlighting)
Here it is:
"P.S.: Shouldn't constants like TRUE, FALSE, Inf, NaN, NA ... be marked
up too?"
Like in:
#
iNA <- as.integer(NA)
#
!is.na(Inf) & !is.nan(Inf) & is.infinite(Inf) & !is.finite(Inf)
#
!is.na(-Inf)& !
I am trying to convert numbers to English words, e.g. 123 -> One
hundred twenty three. After some searching, I have been unable to
find any info on this. I could certainly write code to do it, but my
question is this: Does anyone know of a function that does this?
Thanks,
Derek McCrae Norton
__
Due to over-sized matrix from combn(letters,13), I tried to only output
one selection which is satisfied with the criteria in if clause. This is
how my code looks like and the ERROR message shows:
> li<-combn(letters,13,function(x)(if(apply(( (as.matrix(t(letters%in% x))) %*%
> as.matrix(z)
1 - 100 of 203 matches
Mail list logo