Folks,
I often build up R objects starting from NULL and then repeatedly
using rbind() or cbind(). This yields code like:
a - NULL
for () {
onerow - craft one more row
a - rbind(a, onerow)
}
This works because rbind() and cbind() are forgiving when presented
with a NULL arg: they act like
I want to write:
zap - function(v) {
if (exists(v)) {rm(v)}
}
But of course this doesn't work because the rm() acts on v which is
within zap() and doesn't affect the parent environment:
x - 1
zap(x)
x
[1] 1
How would I make this zap() function work?
--
Ajay Shah
Dear John,
Thanks for the prompt reply! Sorry did not supply with more detailed
information.
The target model consists of three latent factors, general risk
scale from Weber's domain risk scales, time perspective scale from
Zimbardo(only future time oriented) and a travel risk
On Sat, 14 Mar 2009, Mathew, Abraham T wrote:
I'm an R newbie and had a question about the read.xls function. I've heard that
this is often not a reliable function to use for importing data. However, I
have created numerous xls files which contain information about voter turnout
and
lba...@montana.edu wrote:
Hello,
I have some conflicting output from an aov summary and tukey contrasts
with a mixed effects model I was hoping someone could clarify. I am
comparing the abundance of a species across three willow stand types.
Since I have 2 or 3 sites within a habitat I have
Folks,
I have a personal package which used to build fine. Today when I tried
to build the package again, some errors popped up. Could you please
help? When I paste the offending function into an R it works
correctly. But the package build breaks.
$ R CMD check ansecon
* checking for working
thx , i will look that.
I'm both on windows and linux
2009/3/12 Eik Vettorazzi e.vettora...@uke.uni-hamburg.de
Hi,
see
?dev.off
but I think (guessing you use a windows system), you would be better of in
using win.metafile() instead of x11() in initiating the graph, see
?win.metafile
I've just committed a fix to the zoo svn repository. You can grab it like this:
source(http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/R/merge.zoo.R?rev=575root=zoo;)
On Sun, Mar 15, 2009 at 2:54 AM, Ajay Shah ajays...@mayin.org wrote:
Folks,
I often build up R objects
To turn the function avaliable you have to load the library first, to
do so:
library(xlsReadWrite)
Then you use your command read.xls.
I'm suposing that you already had installed the xlsReadWrite package.
A better alternative to this package is RODBC, which also read excel
2007 files. Take
There are two read.xls functions: one is in gdata and one is in
xlsReadWrite packages and neither is unreliable. You've simply
not loaded the package. There is more info here and interfacing
to Excel:
http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows
You should read the
You might want to look at rm to see how that function handles the
problem.
--
David Winsemius
On Mar 15, 2009, at 3:14 AM, Ajay Shah wrote:
I want to write:
zap - function(v) {
if (exists(v)) {rm(v)}
}
But of course this doesn't work because the rm() acts on v which is
within zap() and
Can anyone help with this - I have been running glmer code for linear
mixed models on my works pc, and am now working on my laptop (which is
vista) and when I load the lme4 package i get the message below and I
cannot run any models - any one have any ideas?
Emma
trying URL
It's a 404 message. Try a repository that does have it. The CMU
repository has a copy but the one you picked does not seem to have one
at the moment. Maybe there was a run on the British bit and the bit
banks are a wee short?
http://lib.stat.cmu.edu/R/CRAN/bin/windows/contrib/2.8/
--
This wiki page has the answer. Draw the plot first to establish the
coordinate system and create the viewing transformation matrix. Draw
the grid lines with lines(trans3d()), and then put a:
par(new=T) ... and then redraw the plot over the gridlines.
On 15/03/2009 4:46 AM, Ajay Shah wrote:
Folks,
I have a personal package which used to build fine. Today when I tried
to build the package again, some errors popped up. Could you please
help?
Generally questions about building packages are better in R-devel.
When I paste the offending
Dear Jim:
Thanks for your reply.
Looks to me, you were using batching.
I used batching to digest large data in Matlab before.
Still wonder the answers to the two specifics questions without resorting to
batching.
Thanks.
-Sean
On Sat, Mar 14, 2009 at 10:13 PM, jim holtman jholt...@gmail.com
Dear R community,
I compare mean monthly body temperature between two age classes of turtles
overwintering underground.
lm(body_tem ~ Month*Year*Age_Class)
TukeyHSD(aov(body_tem ~ Month*Year*Age_Class, a))
The Tukey HSD as well as the planned contrasts method showed significant
Dear hyena,
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
Behalf Of hyena
Sent: March-15-09 4:25 AM
To: r-h...@stat.math.ethz.ch
Subject: Re: [R] SEM model testing with identical goodness of fits (2)
Dear John,
Thanks for
I've put together a rough R port of that C code [*] in a package on r-
forge:
http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/pkg/spectral/?root=photonics
http://r-forge.r-project.org/R/?group_id=160 ( package spectral, will
be built overnight )
There is a lot of optimization and
Edna Bell wrote:
How do I find the functions which are primitives, please?
you can scan the whole search path for functions that are primitives:
primitives = sapply(search(), function(path)
with(as.environment(path), Filter(is.primitive, lapply(ls(), get
primitives is a list
On 15/03/2009 12:00 AM, Edna Bell wrote:
Dear R Gurus:
I'm working slowly through R Programming for Bioinformatics, which
is really interesting!
Anyway, my question now is: what determines if a function is a
builtin vs. a closure, please?
Closure is the normal type of function written in R
Dear All,
Im a new R user. How can I write code below more efficiently (using a
loop for example)?
f1 -function(par){x1 - par[1]; x2 - par[2];x3 - par[3] ; x4 - par[4]
; (1+x1)}
f2 -function(par){x1 - par[1]; x2 - par[2];x3 - par[3] ; x4 - par[4]
;(1+x2)}
f3 -function(par){x1 - par[1]; x2 -
Hi Sean,
you should think about storing the data externally in a sql database.
this makes you very flexible and you can do a lot of manipultaion
directly in the db. with the help of stored procedures for example in
a postgreSQL db you can use almost any preferred languege to
manipulate
I don't think you have gotten the basic idea of functions in R. Those
functions would return only the value of the last evaluated
expression, e.g. (1+par[1]) in the case of f1, but most of the code
appears to have no effect. See this simple example:
x1 - 4
f1 - function(x) x1 - x
f1(1)
Thank you
On Sun, Mar 15, 2009 at 8:36 AM, Duncan Murdoch murd...@stats.uwo.ca wrote:
On 15/03/2009 12:00 AM, Edna Bell wrote:
Dear R Gurus:
I'm working slowly through R Programming for Bioinformatics, which
is really interesting!
Anyway, my question now is: what determines if a function
Thank you
On Sun, Mar 15, 2009 at 8:23 AM, Wacek Kusnierczyk
waclaw.marcin.kusnierc...@idi.ntnu.no wrote:
Edna Bell wrote:
How do I find the functions which are primitives, please?
you can scan the whole search path for functions that are primitives:
primitives = sapply(search(),
On 15/03/2009 10:07 AM, Kingsford Jones wrote:
Building on Duncan's code, here's an approximation to the Matlab
'peaks' plot referred to by Pedro:
peaks - function(x, y) { 3 * (1-x)^2 * exp(-(x^2)-(y+1)^2) -
10 * (x/5-x^3-y^5) * exp(-x^2-y^2) - 1/3*exp(-(x+1)^2-y^2)}
x - y - seq(-3,3,.1)
z
Dear John,
Thanks for the reply.
Maybe I had used wrong terminology, as you pointed out, in fact,
variables prob*, o* and v* are indicators of three latent
variables(scales): weber, tp, and tr respectively. So variables
prob*, o* and v* are exogenous variables. e.g., variable
Dear Hyena,
Your model is of three correlated factors accounting for the
observed variables.
Those three correlations may be accounted for equally well by
correlations (loadings) of the lower order factors with a general
factor.
Those two models are indeed equivalent models and will, as a
I have four large two-dimensional matrices of which I want to create contour
plots. Something like
filled.contour(matrix)
contourplot(matrix)
works but only gives me one plot at a time. If I combine the four matrices
into one three-dimensional matrix, which I'll name seven, there should be
a way
Dear R list members,
I have a question regarding xyplot. I managed to make a xyplot of all the
IDs by using the syntax below:
xyplot(PA ~ CRPC + CRPT | ID, data = redinteract)
Now, I'd like to make a graph of a specific ID number (e.g., only ID number
301). I thought I could use subset, but it
What is it that you want to do with these 4 plots? Overlay them with
different color contours or plot them side-by-side on the same page?
?par # for filled.contour but the implementation will be different
for those two options.
contourplot is is a lattice plotting function. See Figure
Would have help if you had offered complete output for your efforts at
using subset. This should work (on the assumption that ID is of type
numeric):
xyplot(PA ~ CRPC + CRPT , data = subset(redinteract, ID == 301) )
On Mar 15, 2009, at 12:35 PM, Sachi Ito wrote:
Dear R list members,
I
Dear Hyena,
OK -- I see that what you're trying to do is simply to fit a confirmatory
factor-analysis model.
The two models that you're considering aren't really different -- they are,
as I said, observationally equivalent, and fit the data poorly. You can
*assume* a common higher-level factor
Using built in data frame CO2 try this where
Type is a 2 level factor.
library(lattice)
xyplot(uptake ~ conc | Type, CO2)
xyplot(uptake ~ conc | Type, CO2)[1]
xyplot(uptake ~ conc | Type, CO2)[2]
On Sun, Mar 15, 2009 at 12:35 PM, Sachi Ito s.ito@gmail.com wrote:
Dear R list members,
I have
Thanks Peter for the advice and quick response. I just want to clarify
what you suggest. I should average values within a site then do a one-way
anova to test for differnces between sites based on the 2 to 3 new samples
per stand type -- and not use random effects for site? Or, because I've
Thanks for the clear clarification. The suggested bi-factor solution
sounds attractive. I am going to check it in details.
regards,
William Revelle wrote:
Dear Hyena,
Your model is of three correlated factors accounting for the observed
variables.
Those three correlations may be accounted
I am using the XML package to form a rather large XML file.
It seems to go OK untill the file length gets larger than about 30Mb then it
seems that the last tokens of the xml file are unmatched. It is almost like the
file hasn't been flushed because the file is OK with the exception of the
I want to plot them side by side.
On Sun, Mar 15, 2009 at 12:41 PM, David Winsemius dwinsem...@comcast.netwrote:
What is it that you want to do with these 4 plots? Overlay them with
different color contours or plot them side-by-side on the same page?
?par # for filled.contour but the
Hi,
I'm having a bit of trouble with the axes in my plots. I don't like the way
R does not have them cross in the origin. Is there another plot/axis
function? i tried using abline as suggested by someone from this list, but
in my case this gives no satisfactory result, as the abline does
You would use layout to set up the page in base graphics. It sets up
the page to receive multiple plots. Unfortunately, this will *not*
give you side by side plots because filled.contour is restricted to a
full page per its help page
layout(matrix(c(1,2,3,4), 2,2 byrow=TRUE)
for (i in 1:4)
The purpose of carrying this CFA is to test the validity of a new
developed scale tr with v* items, other two scales weber and tp
are existing scales that measures specific risk attitudes. I am not sure
if a simple correlation analysis is adequate to this purpose or not,
thus the CFA test.
Hello,
When trying to run mvpart either specifying my own parameters or using the
defaults, I get the following error:
Error in all(is.leaf) :
unused argument(s) (c(FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE))
As far as I can tell, is.leaf is part of the dendrogam package, so I'm
assuming
Using R 2.7.0 under WinXP.
I need to write a function that takes a non-negative vector and returns the
parallell maximum between a percentage of this argument and a fixed value.
Both the percentages and the fixed values depend on which interval x falls
in. Intervals are as follows:
From |
Hi,
I think you could get a cleaner solution using ?cut to split your data
in given ranges (the break argument), and then using this factor to
give the appropriate percentage.
Hope this helps,
baptiste
On 15 Mar 2009, at 20:12, diegol wrote:
Using R 2.7.0 under WinXP.
I need to
On Sun, Mar 15, 2009 at 4:12 PM, diegol diego...@gmail.com wrote:
...This could be done in Excel much tidier in my opinion (especially the
range_aux part), element by element (cell by cell)...
If you'd do it element-by-element in Excel, why not do it
element-by-element in R?
Create a table
J S yulya258 at hotmail.com writes:
I compare mean monthly body temperature between two age classes of turtles
overwintering underground.
lm(body_tem ~ Month*Year*Age_Class)
TukeyHSD(aov(body_tem ~ Month*Year*Age_Class, a))
The Tukey HSD as well as the planned contrasts method showed
Hello Stavros,
If you'd do it element-by-element in Excel, why not do it
element-by-element in R?
Well, actually I was hoping for a vectorized solution so as to avoid
looping. I need to use this formula on rather lengthy vectors and I wanted
to put R's efficiency to some good use. In any
Hello Baptiste,
I am not very sure how I'd go about that. Taking the range, perc and min
vectors from Stavros' response:
range= c(20,100,250,700,1000,Inf)*1000
perc = c(65,40,30,25,20,0)/100
min = c(0,14,40,75,175,250)*1000
For range to work as the breaks argument to cut, I think
Hi,
I don't use ?cut and ?split very much either, so this may not be good
advice. From what I understood of your problem, I would try something
along those lines,
range= c(20,100,250,700,1000,Inf)*1000
perc = c(65,40,30,25,20,0)/100
min = c(0,14,40,75,175,250)*1000
range = c(0, range)
lba...@montana.edu wrote:
Thanks Peter for the advice and quick response. I just want to clarify
what you suggest. I should average values within a site then do a one-way
anova to test for differnces between sites based on the 2 to 3 new samples
per stand type -- and not use random effects for
Hello Baptiste,
Thanks so much for your help. This function which is basically your input
wrapped with curly brackets seems to work alright:
mr_2 - function(x){
range= c(20,100,250,700,1000,Inf)*1000
perc = c(65,40,30,25,20,0)/100
min = c(0,14,40,75,175,250)*1000
On Sat, Mar 14, 2009 at 1:51 PM, Frank E Harrell Jr
f.harr...@vanderbilt.edu wrote:
Dear Colleagues:
I need to make a graphic that uses the Nimbus rather than Helvetica font
family so that the font can be embedded in the encapsulated postscript file.
This is to satisfy a requirement from a
Using cut/split seems like gross overkill here. Among other things,
you don't need to generate labels for all the different ranges.
which(x=range)[1]
seems straightforward enough to me, but you could also use the
built-in function findInterval.
-s
I need a script that works for Bootstrap validation.
Could someone explain me when should I use the Bootstrap technical or
Jackknife?
Thanks
--
View this message in context:
http://www.nabble.com/BOOTSTRAP_CROSS-VALIDATION-tp22529500p22529500.html
Sent from the R help mailing list archive at
On Sun, 15 Mar 2009 14:23:40 +0100
Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote:
Edna Bell wrote:
How do I find the functions which are primitives, please?
you can scan the whole search path for functions that are primitives:
primitives = sapply(search(),
I want to forecast a time series Y using a model that includes previous
values of Y and an exogenous time series X using a transfer function. The
standard procedure as described in Box and Jenkins and numerous other
references is to first fit an ARIMA model to X. Use the ARIMA model to
computer
Paul Johnson wrote:
On Sat, Mar 14, 2009 at 1:51 PM, Frank E Harrell Jr
f.harr...@vanderbilt.edu wrote:
Dear Colleagues:
I need to make a graphic that uses the Nimbus rather than Helvetica font
family so that the font can be embedded in the encapsulated postscript file.
This is to satisfy a
That's what I meant by element-by -element. A vector in R corresponds
to a row or a column in Excel, and a vector operation in R corresponds
to a row or column of formulae, e.g.
Excel
A B C
1) 5 10 a1+b1 (= 15)
2) 3 2 a2+b2 (= 5)
etc.
R
A -
Dera R Helpers,
I am re-posting my query.
Please guide me.
Maithili
--- On Fri, 3/13/09, Maithili Shiva maithili_sh...@yahoo.com wrote:
I am trying to fit the Gumbel distribution to a data. I am
using lmom package. I am getting problem in Cumulative
Distribution Function of Gumbel
60 matches
Mail list logo