Hi
Your data are rather wild so I am not sure if following function can do what
you want. I designed it primarily for intagration of peaks from different
sources.
integ1 <- function (x, y, dm = -Inf, hm = +Inf)
{
ifelse(dm == -Inf, dm <- min(x), dm <- dm)
ifelse(hm == +Inf, hm <- max(x)
Hi John,
Sorry but if this sounds really as a newbie question.
I looked at the data as you suggested using glimpse(name of the dataset)
and then View(dput(head(ak,20))) to capture it as a table. Is there an
option where i can save this view table & share along.
I used dput but that would not w
Hi
The main problem with the code you have below is that it mixes drawing
based on the 'graphics' package with drawing based on the 'grid' package
and those packages do not mix easily.
I am not clear on what you want as your final result, but I wonder
whether you need to just set up the plot
Dear R-User!
This is a question to all of you that are familiar with the 'dismo'
package, in particular we are interested in the gbm.step() function to
create a boosted regression tree model in R. From the model output object we
can use the $cv.statistics to get information on the cross-validation
I tried to upload the file once again. I tweaked it a bit, now my code is:
forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1, subset=(pub==1),
xlim = c(-16, 6),
ilab = cbind(SIMdv, SIMiv),
ilab.xpos = c(-7.5, -5.5), cex = 0.75)
op <- par(cex=.75, font=2)
text(c(-7
The first id was ignored (d[2:length(id)]) and the last id in id.lag was set to
FALSE. Because the values are in new positions even though the same number of
id values are kept, a lag (shift) has been created that takes effect when
id.lag is used as an index into transact.
--
An alternative to your approach is to pass your data to the approxfun
or splinefun functions and then use the integrate function on the
result.
On Mon, Aug 24, 2015 at 3:10 AM, CarstenH wrote:
> Hi all
>
> I need to calculate the area under a curve (integral) for the following data
> pairs:
>
> D
This is partly a bug in the AUC package and partly a problem
with you not reading or understanding the the help file for the
auc function in that package. help(auc) says
auc(x, min = 0, max = 1)
Arguments:
x: an object produced by one of the functions ‘sensitivity’,
For base plotting functions (not grid) then you may be interested in
the updateusr function in the TeachingDemos package. If you can find
the current coordinates of 2 points on the 1st plot (the background
image) that are not in the same horizontal or vertical line (use the
locator function if not
Can you please explain elaborately! I understood that TRUE has been shifted
ahead. But unfortunately did not understand the code- as how using logical
vector it was shifted ? # lagged vector of id. TRUE is shifted one position
aheadid.lag <- c(id[2:length(id)], FALSE)It shifted ahead twice using
Hi Charles
I am new in R and would like to learn/use it in the beginning for easy
operations. I already used google for houres and did not find a solution for
this in my eyes easy calculation process. I spent long time with reading
forums, package handbooks, and tried and error but always failed.
Hi!
Thanks for pointing out the mistake.
I am resubmitting my question as follows:
Hi!I am facing a problem in understanding the R-CodeSuppose I have a
transactional dataset named- "transact" with its values like
following:customer_ID
<-c(1000,1000,1000,1000,1000,1000,100
On Aug 24, 2015, at 7:23 AM, Jeff Newmiller wrote:
> Read ?predict, paying particular attention to the newdata argument.
I agree that reading help pages is needed but need both the ?predict page and
the ?integrate page. I think proximate cause of the error is that `integrate`
is not getting an
Just to second Thierry's point, your HTML post is basically unreadable.
Please repost as plain text.
John Kane
Kingston ON Canada
> -Original Message-
> From: butt_its...@hotmail.com
> Sent: Mon, 24 Aug 2015 16:30:31 +0530
> To: r-help@r-project.org
> Subject: [R] Understand Rcode- subs
# logical vector, TRUE when record_type equals 1
id <- transact$record_type == 1
# lagged vector of id. TRUE is shifted one position ahead
id.lag <- c(id[2:length(id)], FALSE)
sub <- transact[id.lag, ]
# have a look at the row numbers
transact[id, ]
sub
Best regards,
ir. Thierry Onkelinx
Instituut
I would suggest you look into the Matrix package.
Here's an example that illustrates what I suspect is the root cause of
your issue:
> x <- matrix(1:4, ncol=2)
> class(x)
[1] "matrix"
> y1 <- x[,1]
> class(y1)
[1] "integer"
> y1
[1] 1 2
> y2 <- x[,1,drop=FALSE]
> class(y2)
[1] "matrix"
> y2
I cannot reproduce the issue with 'ilab' not being shown when using 'subset'.
My guess is that the values for 'ilab.xpos' specified are actually outside of
the plotting region. After you have drawn the forest plot, try:
par("usr")[1:2]
to see what the default limits actually are. Then use 'xlim
Dear Marco
Comments inline
On 24/08/2015 15:03, Marco Colagrossi wrote:
Hello folks,
I have a couple of issues with the metafor package, specifically with
the forest graphs.
I am currently conducting a Meta-Analysis in economics throughout the
metafor package.
My meta-analysis has the specifi
Hi R developers,
I am looking for a R version of Matlab function lsqlin. I came across R pracma
package which has a lsqlin function. Compared with Matlab lsqlin, the R version
does not allow inequality constraints.
I am wondering if this functionality will be available in future. And I would
als
Hello folks,
I have a couple of issues with the metafor package, specifically with
the forest graphs.
I am currently conducting a Meta-Analysis in economics throughout the
metafor package.
My meta-analysis has the specific of having different cases from
single studies, and this proven to be chall
Read ?predict, paying particular attention to the newdata argument.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Hi Carsten,
This list is meant to help you solve specific coding problems. What have
you tried? A quick google search will provide several packages including
caTools, ROCR, AUC, pROC. Look in to some of them, try them out and report
back if you have problems 'using' a function instead of just a
Note that, in general,
rowMeans(x)
is preferable to
apply(x,1,mean)
Consult ?rowMeans for details.
Cheers,
Bert
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On Mon, Aug 24, 2015 at 2:20 AM, Jim Lemon wro
Posting in HTML mangles up your code, making it hard to read. Please
resend your question in plain text and make the code reproducible. See
http://adv-r.had.co.nz/Reproducibility.html for more details on that.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Natu
Hi!
I am facing a problem in understanding the R-Code
Suppose I have a dataset named- transact with its values like following:
customer_ID
shopping_pt
record_type
1000
1
0
1000
2
0
1000
3
0
1000
4
0
1000
5
0
Hi all
I need to calculate the area under a curve (integral) for the following data
pairs:
Depth SOC
22.50.143
28.50.165
34.50.131
37.50.134
40.50.138
43.50.107
46.50.132
49.50.175
52.50.087
55.50.117
58.50.126
61.50.
Hi Peter,
I think your problem is that your calculations occur after the end of
the loop. What you probably want is something like this:
yr_means<-mam_means<-jf_means<-
jja_means<-ond_means<-rep(NA,length(prec_files))
for (i in 1:length(prec_files)) {
prec_data<-read.delim(prec_files[i], sep="\t
Dear all,
I'm trying to geocode addresses (of Catalonia) with accents and
Catalan characters (as for example "ç"). I'm using the "geocode"
function (package ggmap), but I obtain some Google "INVALID_REQUEST"
when the addresses have these characters. For example:
> geocode("Carrer Veneçuela, 10,
28 matches
Mail list logo