Thanks so much!!
Would be it be better if in vignette of plotmath, x %~% y and x~~y;
likewise, other operations (.e.g.,
x %*% y, x * y) may be grouped, so that are not missed by a layman like
me! - just a thought...
Thanks,
Santosh
On Tue, Jun 4, 2013 at 9:13 PM, David Winsemius
On Jun 5, 2013, at 3:53, Julio Sergio julioser...@gmail.com wrote:
I want to generate specific gamma distribution functions, given fixed
parameters.
This is I have k, and theta, say
k - 32.2549 # shape
theta - 26.32809 # scale
# I have an auxiliary function that
Hello,
?plotmath - See Also
demo(plotmath)
Regards,
Pascal
On 05/06/13 15:00, Santosh wrote:
Thanks so much!!
Would be it be better if in vignette of plotmath, x %~% y and x~~y;
likewise, other operations (.e.g.,
x %*% y, x * y) may be grouped, so that are not missed by a layman like
me! -
Hi all,
I'm encountering a problem I do not understand on my data:
library (lattice)
Mpool1 - Table[Table$Subarea %in% c(52E9, 51E9),]
Mpool2 - Table[Table$Subarea %in% c(53F0, 52F0),]
Mpool3 - Table[Table$Subarea %in% c(51F0, 50F0),]
Mpool4 - Table[Table$Subarea %in% c(51F1, 52F1),]
Mpool -
Hi, Xochitl,
wrapping the call to histogram() inside your loop in a call to print()
should solve your problem:
print( histogram( .))
Regards -- Gerrit
On Wed, 5 Jun 2013, Xochitl CORMON wrote:
Hi all,
I'm encountering a problem I do not understand on my data:
library (lattice)
This is an FAQ. you have to explicitly 'print' the histogram:
print(histogram(~ Mpool[[2]]$LngtClas | Mpool[[2]]$SpCode, type = count, col
= lightgrey, xlab= LngtClas, main = paste(Length distribution per species
for Mpool, 2, sep = _)))
Sent from my iPad
On Jun 5, 2013, at 4:37, Xochitl
Hi Jim,
Thank you a lot. Is it a FAQ concerning lattice or FOR loop in general?
Regards,
Xochitl C.
Le 05/06/2013 10:55, Jim Holtman a écrit :
This is an FAQ. you have to explicitly 'print' the histogram:
print(histogram(~ Mpool[[2]]$LngtClas | Mpool[[2]]$SpCode, type = count, col =
Hello,
If in faux we ?force the return value, the bug is gone.
faux - function(c) {
f - function (x) get(paste0(c,gamma))(x,k,scale=theta)
force(f)
f
}
Hope this helps,
Rui Barradas
Em 05-06-2013 07:13, Michael Weylandt escreveu:
On Jun 5, 2013, at 3:53, Julio
Good Afternoon All,
I am attempting to use the SendMailR function, I have checked with our I.T.
department that I am using the correct server and I have the right
permissions to connect and they have sent emails via this server but not
through R and I have also checked that the port should be
Hello,
My solution works but it is incorrect. We should force the argument 'c',
not the return value. Like said in the help page for force. Which I've
only read after my first post. The following way makes much more sense
and is a bit shorter.
faux - function(c) {
force(c)
Hello,
See the help pages for
?abline
?par # parameter 'col'
Hope this helps,
Rui Barradas
Em 04-06-2013 22:05, Kaptue Tchuente, Armel escreveu:
Hi all,
I'm struggling with the display of several regression lines (with different
colors) on the same plot.
I manually drew what I'm trying
On Jun 4, 2013, at 4:46 PM, Kota Hattori wrote:
Dear all,
I have been searching ways to run power analysis for mixed-effects
models. However, I have not been successful
in the research. Today I would like to ask your help. As long as I
see from my search, Martin Julien wrote a package
On Jun 4, 2013, at 10:15 PM, Hans W Borchers wrote:
Bert Gunter gunter.berton at gene.com writes:
1. This looks like a homework question. We should not do homework
here.
2. optim() will only approximate the max.
3. optim() is not the right numerical tool for this anyway.
optimize() is.
David Winsemius dwinsemius at comcast.net writes:
[...]
On Jun 4, 2013, at 10:15 PM, Hans W Borchers wrote:
In the case of polynomials, elementary math ... methods can
actually be
executed with R:
library(polynomial) # -6 + 11*x - 6*x^2 + x^3
p0 -
On Jun 4, 2013, at 3:05 PM, Kaptue Tchuente, Armel wrote:
Hi all,
I'm struggling with the display of several regression lines (with
different colors) on the same plot.
I manually drew what I'm trying to do with 8 lines (see attached).
If you want lines that only span a portion of a plot
On 13-06-05 12:08 AM, ivo welch wrote:
thx, greg.
chunk boundaries have meanings. the reader needs to stop, and buffer one
line when it has crossed to the first line beyond the boundary. it is also
problem that read.csv no longer works with files---readLines then has to do
the processing.
On 06/05/2013 12:33 AM, r-help-requ...@r-project.org wrote:
Dear friends - I'm on windows 7, R 2.15.2
when I run the example for aareg in survival package I see this:
plot(lfit[4], ylim=c(-4,4))
error in xy.coords(x, y, xlabel, ylabel, log) :
'x' is a list, but does not have
Kota Hattori kota.hattori at canterbury.ac.nz writes:
Dear all, I have been searching ways to run power analysis for
mixed-effects models. However, I have not been successful in the
research. Today I would like to ask your help. As long as I see from
my search, Martin Julien wrote a package
This originally was an SPlus script that I modifeid about a year-and-a-half
ago. It worked perfectly then. Now I can't get any output despite not
receiving an error message. I'm providing the SPLUS script as a reference.
I'm running R15.2.2. Any help appreciated.
Hi,
Try this:
lstf1- list.files(pattern=.txt)
length(lstf1)
#[1] 119
fun2- function(lstf){
lst1-lapply(lstf,function(x) readLines(x))
lst2-lapply(lst1,function(x) {gsub((\\d+)(-.99),\\1 \\2,x)})
lst3-lapply(lst2,function(x) {x-gsub((\\d+)(-.99),\\1 \\2,x)})
lst4-
On Sun, May 26, 2013 at 12:47 AM, Milan Bouchet-Valat nalimi...@club.fr wrote:
Le mardi 21 mai 2013 à 21:39 +0100, Prof Brian Ripley a écrit :
On 21/05/2013 21:24, Bert Gunter wrote:
At the risk of misunderstanding... (inline)
On Tue, May 21, 2013 at 12:17 PM, Milan Bouchet-Valat
If you have read the Posting Guide, you will know that you should have read ALL
the FAQs before posting your question.
http://cran.r-project.org/doc/FAQ/R-FAQ.html
That said, this particular FAQ applies to any library that depends on grid
graphics, including lattice and ggplot2.
Thank you all! This approach, using the 'polynom' library, did the trick.
library(polynom) # -6 + 11*x - 6*x^2 + x^3
p0 - polynomial(c(-6, 11, -6, 1)) # has zeros at 1, 2, and 3
p1 - deriv(p0); p2 - deriv(p1) # first and second derivative
xm - solve(p1) # maxima and minima of p0
xmax =
This is not a homework but part of my research.
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-write-a-loop-in-R-to-select-multiple-regression-model-and-validate-it-tp4668669p4668720.html
Sent from the R help mailing list archive at Nabble.com.
I would like to compare models selected with ridge, lasso and elastic net.
Fig. below shows coefficients paths using all 3 methods: ridge (Fig A,
alpha=0), lasso (Fig B; alpha=1) and elastic net (Fig C; alpha=0.5). The
optimal solution depends on the selected value of lambda, which is chosen
based
Hi all,
I'm trying to randomly select sample numbers for length class groups (5
per length class).
For this I'm using a loop FOR and the function sample () and specified a
size for the sampling of 5. Unfortunately, one of the length class group
does not contain 5 individuals. For me is not
Dear Dr. David,
Many thanks for your answer.
Now, if I want to see if there are common namein those places , how can
I do it? So, by common I mean, it might be compared with 2, 3, 4 all
of them. All possible combinations
Many thanks
regards
Nico
On Mon, Jun 3, 2013 at 5:20 PM, David
Rui Barradas ruipbarradas at sapo.pt writes:
My solution works but it is incorrect. We should force the argument 'c',
faux - function(c) {
force(c)
function (x) get(paste0(c,gamma))(x,k,scale=theta)
}
Thanks a lot, Rul. I think I have to learn a bit more about lazy evaluation
Hi all,
I am revisiting using reshape2 to aggregate critter (bats) occurrences
by time blocks and have the final output for each row sum a percentage
such that the row sums total 1 (100%).
Reshape2 library is loaded on start.
The old code I had stored in NotePad++ seems to no longer work as I
What about using instead
size = min(5, length(Gpool$SampleNb[Gpool$LngtClas == LngtClas[[4]]
Gpool$SpCode == SpCode[[2]]])
that would make sure your sample is either the size of the data or 5.
Sarah
On Wed, Jun 5, 2013 at 10:27 AM, Xochitl CORMON
xochitl.cor...@ifremer.fr wrote:
Hi all,
I'm
On 05/06/2013 10:32 AM, ivo welch wrote:
I just tested read.csv with files...it still works. it can read one
line at a time (without col.names and with nrows). nice. it loses
its type memory across reinvokcations, but this is usually not a
problem if one reads a few thousand lines inside
Something like this?
set.seed(42)
a - sample.int(10)
b - sample.int(5)
c - sample.int(3)
smpl - function(x) sample(x, ifelse(length(x)5, length(x), 5))
smpl(a)
[1] 4 8 1 10 2
smpl(b)
[1] 2 3 5 1 4
smpl(c)
[1] 2 1 3
-
David L Carlson
Associate
Hello,
1) It is always nice to say something as Hello,
2) What do you want us to do with that script, without the required commented,
minimal, self-contained, reproducible code?
3) The lastest version of R is 3.0.1.
Regards,
Pascal
2013/6/5 Scott Raynaud scott.rayn...@yahoo.com
This
Hello,
cast is in reshape library. Is it loaded?
Regards,
Pascal
2013/6/5 Neotropical bat risk assessments neotropical.b...@gmail.com
Hi all,
I am revisiting using reshape2 to aggregate critter (bats) occurrences
by time blocks and have the final output for each row sum a percentage
such
Hello,
May be this helps:
dta1-do.call(data.frame,dta)
dta2-dta1[complete.cases(dta1),]
dta2[,-3]-lapply(dta2[,-3],as.character)
lstdta2-split(dta2,dta2$place)
library(plyr)
#Some names are common in a few, but not in all the places. If you are looking
for names common in 2 places, 3, places,
Thank you Sarah for this code, it's exactly what I wanted to reach.
Le 05/06/2013 16:49, Sarah Goslee a écrit :
What about using instead
size = min(5, length(Gpool$SampleNb[Gpool$LngtClas == LngtClas[[4]]
Gpool$SpCode == SpCode[[2]]])
that would make sure your sample is either the size of
Hi again all,
Several replied ASAP that I also needed reshape loaded and not just
reshape2.
Hmmm tried that and I had some output but not the correct format.
What I need is to run simulations of time overlap between species as per
the simulation program data input constraints:
The basis for
Hi Atem,
No problem.
which(res==-.99)
# [1] 18246 397379 420059 426569 427109 603659 604199 662518 664678
#[10] 698982 699522 700062 701142 754745 1289823 1500490 1589487 1716011
#[19] 1837083
which(res==-.99,arr.ind=TRUE)
# row col
#1506 1506 2
#12359 12359
Your request is still vague. Arun has given you one approach. This
will tell you which names are found in pairs of places:
ndf - length(names(dta.df.sp))
results - vector(list)
for (i in 1:(ndf-1)) {
+ for (j in (i+1):ndf) {
+ pair - paste(names(dta.df.sp)[i], names(dta.df.sp)[j])
+
Bruce,
I'm not sure what's going on since I tried this on my Linux system running
R 3.0.0 and just did:
library(reshape2)
help(cast)
and the help for 'cast' came up. There was no indication to me that
'reshape' was needed and I can not see a dependency in CRAN for 'reshape'.
But I built R from
There is indeed a ?cast help topic in reshape2, but there is no cast
function. Instead there is dcast (returns a data.frame) and
acast(returns an array).
Bruce, you can try your original example with
input.cast - dcast(input.melt, Species ~ Date, fun.aggregate = sum)
Best,
Ista
On Wed, Jun 5,
Rui et al.
Certainly correct.
However, I think the use of force() and similar should be avoided if
possible, as computing on the language can be tricky. So here is an
alternative formulation that avoids it:
faux - function(c){
f - get(paste0(c,gamma)) ## evaluation of c is forced here
Will using the function mlply() rather than maply() do the trick for you?
For example
dat - data.frame(dim1=1:10, dim2=1:10)
foo - maply(dat, function(dim1, dim2) list(a=foo, b=runif(10)))
foo2 - mlply(dat, function(dim1, dim2) list(a=foo, b=runif(10)))
Jean
On Wed, Jun 5, 2013 at 12:33 AM,
Hi,
Try:
fun1- function(dat,Col1,Col2,number){
lst1- split(dat,list(dat[,Col1],dat[,Col2]))
lst2- lst1[lapply(lst1,nrow)0]
res- lapply(lst2,function(x) sample(x[,1],if(nrow(x) number) nrow(x) else
number,replace=FALSE))
res}
head(fun1(Gpool,LngtClas,SpCode,5),4)
#$`40_49.MERLMER`
#[1] 34
See my comments below.
From: Pascal Oettli kri...@ymail.com
To: Scott Raynaud scott.rayn...@yahoo.com
Sent: Wednesday, June 5, 2013 10:02 AM
Subject: Re: [R] SPlus script
Hello,
1) It is always nice to say something as Hello, Tried, but could make it come
out
Interestingly enoughhelp(cast) did not work but ?cast does
As Ista says, there is no cast() in reshape2
John Kane
Kingston ON Canada
-Original Message-
From: tea...@gmail.com
Sent: Wed, 5 Jun 2013 11:55:43 -0400
To: neotropical.b...@gmail.com
Subject: Re: [R] reshape2 issue
On Jun 5, 2013, at 20:58 , Scott Raynaud wrote:
See my comments below.
From: Pascal Oettli kri...@ymail.com
To: Scott Raynaud scott.rayn...@yahoo.com
Sent: Wednesday, June 5, 2013 10:02 AM
Subject: Re: [R] SPlus script
Hello,
1) It is always nice
Both the R and S+ versions (which seem to differ only in the use of _ for
assignment
in the S+ version) do nothing but define some functions. You would not expect
any
printed output unless you used those functions on some data. Is there another
script
that does that?
Bill Dunlap
Spotfire,
Hi again all,
As the original code lines I had dated back to 2007 that may have
predated reshape2?
In any case the use of *dcast *rather than /*cast*/ solved the issue.
Then with 3 steps:
Stop
read
Think
I saw I just needed to change the line
input.cast - cast(input.melt, Species ~ *Date*,
Yes , I think it was only a year or two ago that the change occured.
John Kane
Kingston ON Canada
-Original Message-
From: neotropical.b...@gmail.com
Sent: Wed, 05 Jun 2013 15:26:25 -0400
To: r-help@r-project.org
Subject: [R] reshape2 issue solved Tnx!
Hi again all,
As the
Try:
library(ggplot2)
ggplot(mtcars, aes(mpg, qsec, colour = as.factor(gear))) +
geom_point() + geom_smooth(method = lm, se = FALSE)
You probably will have to melt your data to get into the right format.
John Kane
Kingston ON Canada
-Original Message-
From: armel.kap...@sdstate.edu
Bert Gunter gunter.berton at gene.com writes:
faux - function(c, nm = gamma,...){
f - get(paste0(c,nm))
function(x)f(x,...)
}
This could be called with:
xgam - lapply(c(p,d), faux, shape=k, scale=theta)
xgam[[1]](1000)
[1] 0.8710477
xgam[[2]](1000)
[1]
You will want to force the evaluation of the ... arguments, just as you are
already
forcing the evaluation of 'c', before returning your function. E.g., compare
the
following two:
# your 'faux', renamed and enhanced a bit
f0 - function (c, nm = gamma, ...)
{
probFunc -
Le mercredi 05 juin 2013 à 19:37 +0530, Deepayan Sarkar a écrit :
On Sun, May 26, 2013 at 12:47 AM, Milan Bouchet-Valat nalimi...@club.fr
wrote:
Le mardi 21 mai 2013 à 21:39 +0100, Prof Brian Ripley a écrit :
On 21/05/2013 21:24, Bert Gunter wrote:
At the risk of misunderstanding...
As you can see, my original modification was to replace all _ with -. It
worked after I
did that. This is a simulation that generates its own data based on the given
parameters.
I should obtain a plot of the number of experimental subjects as a function of
the repsonse
rate in the
William Dunlap wdunlap at tibco.com writes:
f1 - function (c, nm = gamma, ...)
{
probFunc - getFunction(paste0(c, nm))
force(list(...))
function(x) probFunc(x, ...)
}
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
Thanks a lot William!, this really enhances my
Not that I know of.
I have ideas, but haven't had time.
-thomas
On Wed, Jun 5, 2013 at 4:13 AM, j.lenkeit j.lenk...@uva.nl wrote:
Hello,
I am new in R and would be glad for any help.
My question is: Is there any available package to run a multilevel model
(random/fixed effects) with
You can put print statements into the arguments given to a function to more
directly
see when they get evaluated. E.g.,
z - f0(c={ cat(Evaluating 'c' argument\n); p}, nm=norm, mean={
cat(Evaluating 'mean' argument\n); 1.2 })
Evaluating 'c' argument
z(1:5)
Evaluating 'mean' argument
[1]
Dear r-helpers,
I have two questions on multilevel binary and ordered regression models,
respectively:
1. Is there any r function (like lmer or glmer) to run multilevel ordered
regression models?
2. I used the glmer function to run a two-level binary logit model. I want
to make sure
that I did
Hi,
Try this:
lstf1- list.files(pattern=.txt)
length(lstf1)
#[1] 119
#I changed the function a little bit to unlist by rows to match the dates
column I created.
fun2- function(lstf){
lst1-lapply(lstf,function(x) readLines(x))
lst2-lapply(lst1,function(x) {gsub((\\d+)(-.99),\\1 \\2,x)})
Hello!
I installed rJava and am trying to load it.
library(rJava)
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try
re-installing Java and make sure R and Java have matching
Hey, I'm new with R and I'm attempting to map and then plot points on a map
of Antarctica with help from some code at the following link. Link
http://www.molecularecologist.com/2012/09/making-maps-with-r/
After downloading the packages here is the code I used. I feel like the
problem has to do
Hi everyone,
I want to open an XML file in R and it also works.
But then I get a list of all numbers but it isn't in the type of numeric.
I tried this:
exampleData -
C:/Users/Andreas/Desktop/Thesis/Interzeptionsmodell/Daten/Karlsruhe/Windgeschwindigkeit/1948.xml
F - system.file(exampleData,
I put header=TRUE and sep = ; and my problem was resolved.
read.csv(./scoreDb.csv,header = TRUE,sep=;
Best Regards,
Sandro
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
Hello,
I need to calculate a sandwich covariance matrix in gamm. The package
sandwich does not work because:
Error in UseMethod(vcov) : no applicable method for 'vcov' applied to an
object of class c('gamm', 'list')
Does anyone knows how to overcome this problem? Thanks in advance.
Regards,
I am trying to create a new datafarme using the subset function given 2
conditions
subset1- subset(dframe, glb_ind=Y | sample==1)
subset2-subset(dframe, cwar_ind=Y | sample==2)
subset3-subset(dframe, reg_ind=Y | sample==3)
However, my first conditions (glb_ind,cwar_ind, and reg_ind) all have
The problem might be that NAs in the dataset are blank
On Wed, Jun 5, 2013 at 9:54 AM, Daniel Tucker dtuck...@u.rochester.eduwrote:
Also tried this but results werent any different
subset1- subset(dframe, glb_ind=Y | sample==1 | !is.na(glb_ind))
subset2-subset(dframe, cwar_ind=Y |sample==2
Also tried this but results werent any different
subset1- subset(dframe, glb_ind=Y | sample==1 | !is.na(glb_ind))
subset2-subset(dframe, cwar_ind=Y |sample==2 | !is.na(cwar_ind))
subset3-subset(dframe, reg_ind=Y | sample==3 | !is.na(reg_ind))
On Wed, Jun 5, 2013 at 9:33 AM, Daniel Tucker
Hi all,
I am revisiting using reshape2 to aggregate critter (bats) occurrences
by time blocks and have the final output for each row sum a percentage
such that the row sums total 1 (100%).
Reshape2 library is loaded on start.
The old code I had stored in NotePad++ seems to no longer work as I
I just tested read.csv with files...it still works. it can read one line
at a time (without col.names and with nrows). nice. it loses its type
memory across reinvokcations, but this is usually not a problem if one
reads a few thousand lines inside a buffer function. this sort of function
is
Dear Henric,
Thank you so much. I was able to successfully install the rqpd package
on my Windows machine (win 7) using the R.2.15.1 version.
I greatly appreciate your wonderful help.
Thank you.
Best regards,
Manish
On 6/4/2013 3:54 PM, Henric Winell wrote:
Manish,
Manish K. Srivastava
Hi -
Is there a way to simultaneously control for temporal autocorrelation and
Poisson-distributed data in R? I have seen similarly threaded topics as
recently as 2009, but the statistical texts suggested in them are well
above my comprehension, and I'm hopeful that more straightforward solutions
Hi,
I am trying to replicate some code I previously used to undertake a dbRDA
analysis, however since updating my R software and all associated packages
to the latest version it seems the analysis does not work.
I have two dist objects: gendist and geodist.
I first reduce geodist using pcnm().
Hello together,
this is ma first post, so please aplogize me if post this in the wrong
section.
I have problem concerning ma two matrizes.
After a regressione and so on, I got two matrizes
Matrixres contains the results of ma calculation.
Matrixr contains my detiene, which where Aldo used
Daniel,
You need == instead of =.
HTH,
Jorge.-
Sent from my phone. Please excuse my brevity and misspelling.
On Jun 6, 2013, at 10:36 AM, Daniel Tucker dtuck...@u.rochester.edu wrote:
Also tried this but results werent any different
subset1- subset(dframe, glb_ind=Y | sample==1 |
You have mixed your x with your y, try this:
map(worldHires,Antarctica,ylim=c(-90,-60),xlim=c(-180,180),col=gray90,fill=TRUE)
I tend not to use maps/mapdata if I can help it (there are problems as
you can see, though there is support for projections with mapproject,
see ?map), if you want to
Hi,
There is a problem with xlim and ylim.
map(worldHires,Antarctica,xlim=c(-180,180),ylim=c(-90,-60),col=gray90,fill=TRUE)
You also might have a look at ggplot2
library(ggplot2)
world - map_data(world)
worldmap - ggplot(world, aes(x=long, y=lat, group=group)) +
geom_path() +
Hi Scott
I converted the _ to - and ran it in 3.01
Ran about half way and then could not find nl? and others so may be
some scoping problems? or other problems
Duncan
Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home:
Hello,
I have been using the function lme() from package 'nlme' for several months
now without any problems. Suddenly, it cannot find a factor in my data.
Is this a new bug of some kind? My code and output are below.
Thanks for your help!
-Steve Pfeiffer
require(xlsx)
require(nlme)
Hi,
I think it is due to the missing values:
I get warnings()
z.5.annualMax- daily2annual(z, FUN=max, na.rm=TRUE,dates=1)
#There were 50 or more warnings (use warnings() to see the first 50)
write.csv(z.5max.annual, file = Stations.csv)
Just to validate the result:
I tried this:
res3-
Thanks, Bill. Clearly something I missed. I appreciate your filling in
that crack.
Another equivalent way to do it?
f2 - function(c,nm = gamma,...)
{
probFunc - paste0(c,nm)
more - list(...)
function(x)do.call(probFunc,c(x,more))
}
This avoids the explicit use of get() and force(), I
Hi
I want to fit a multivariate multilevel model for a longitudinal data set. can
you introduce me a package or some function to fit this model?
Thanks in advance.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
82 matches
Mail list logo