know how should I do this?
Consider
setdiff( licenseY, licenseX)
or, more or less equivalently,
licenseY[ (!licenseY %in% licenseX) ]
S Ellison
***
This email and any attachments are confidential. Any
> Rather than doing them manually,
> you might have better luck with ggbiplot, and the ggrepel package designed to
> 'repel' point labels so they don't overlap.
For base graphics, 'thigmophobe.lables' in the plotrix package also works to
avoid label overlap.
Steve E
*
t that that will help _me_ answer your question, but it may help someone
else].
S Ellison
***
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. I
presorted, wouldn't a binary search find the correct location
in O(log(n))? (roughly log2(n)?)
After that any insertion depends on how fast R can move memory about so the
overall speed clearly depends on factors other than
n.
> df <- data.frame(quant=factor(letters))
looks very like you're assigning a data frame to the function 'df' (density for
the F distribution)
It doesn't, because R is clever. But it's really not good practice to use
common function nam
> -Original Message-
> My data come from statistical model N(5, 2), with n=100, call this model_1
> Then, I add bias to that data with N(3, 1), with n=100, call this model_2
Do you mean you have data from N(5,2) that has had data from N(3,1) added to
it, or that you have two different sets
> ruipbarra...@sapo.pt
> Maybe the following (untested).
>
> table(df$Protocol[df$Speed == "SLOW"])
Could also use which.max to get the particular item: ...
tprot <- table(df$Protocol[df$Speed == "SLOW"])
If you wanted to zero-fill to the same length, or fill with NA, that'd be
something else ...
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
_
on to
"Basic statistics and classroom homework"'
S Ellison
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of kashyap vora
> Sent: 23 May 2016 14:04
> To: r-help@r-project.org
> Subject: [R] Programming Assignment 1: Quiz A
> I want to write the inside function (3^(x[i]+x[j])) in a more condensed form
> cause this will help me when the multiple summations are more than two
indices<-c(i,j) #or whatever you want
3^sum( x[indices] )
S Ellison
***
> Apparently, abs(1 - 0.95) is not equal to 0.05, which I find however quite
> disturbing.
It's normal.* See R FAQ 7.31 in the html help system.
S Ellison
*... and common to all computers that use binary.
***
This em
ction from glm comes up, there's a
strong likelihood that someone will point out that the covariances are not
necessarily sufficient for reliable confidence intervals on prediction (and
look! that just happened). You might want to hunt around for more authoritative
comment on that if the intervals/st
rdinates for each cluster. If you assign that list to an object you can then
write a separate function to format and write out the coordinates and use
lapply to run that on the list. Or you can include formatted write calls in the
by.index function, writing to a file as before.
E, ...)
}
lapply(names(cl), Write, x=cl, filename="myclust.txt")
(Ignore the NULLs returned)
Anything more structured than that and you'll have to write a write.kmeans
replacement for write that structures the results as you need them later.
S Ellison
> Are you aware of any function what would query the original function call
> arguments no matter what happens in the function?
Use missing() first.
If you can't use missing() first, or use it early in a parent function and pass
a flag, you could perhaps pass a copy of the parent function call t
Is there a reason not to use the convex hull for area calculations? Any curve
you put through the points would surely be at least as arbitrary as a straight
line.
S Ellison
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Alexander
> Shenk
inomial family is allowing for overdispersion and stata is not.
S Ellison
***
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. If
you have received this m
between two and
only two groups. Your files seem to have more than two years, which - at least
until my telepathic inference improves - seems likely to cause a problem for
t.test and var.test. Perhaps you were looking for pairwise.t.test?
S Ellison
***
> > What I need is this:
> > [[1]]
> > [1] 1 2 3
> > [[1]]
> > [2] 1 2 3
> > [[1]]
> > [2] 1 2 3
Try
rep(list(1:3), 3)
S Ellison
***
This email and any attachmen
ample, to sort by the first column of a matrix mm:
oo <- order(mm[,1])
mm[oo,]
order() also takes multiple sort fields so can sort by several columns
simultaneously (eg sort by first column and within that by third column etc)
27;, paste(names(dfr[1:20]),
collapse="+")))
)
test.FN(scope=scope)
}
test.step(X.des, Y)
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
c(NA, NA, letters[1:5]) )
you can do things like
x[is.na(x)] <- "Empty Space"
x
or
x[is.na(x)] <- ""
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
__
rp1 <- as.character(nwCorp1) ?
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
ation matrix, if you want to see how
closely individuals are associated, but correlation is a possible step on the
way.
S Ellison
***
This email and any attachments are confidential. Any use, copying or
disclosure other than by the in
Does
do.call('cbind', list_of_dataframes)
do what you want?
S Ellison
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Wolfgang
> Waser
> Sent: 09 February 2016 09:03
> To: Dénes Tóth; r-help@r-project.org
> Subject:
r calculations).
I wouldn't exactly call it statistics - it's based on recommendations for
measurement science and they assume a pretty simple deterministic model and
that has little or nothing to do with model fitting and inference.
S Ellison
> -Original Message-
> From: R
Apologies if I've missed a post, but have the default treatment of posts and
reply-to changed on R-Help of late?
I ask because as of today, my email client now only lists the OP email when
replying to an R-help message, even with a reply-all, so the default reply is
not to the list.
I also noti
f the closest Latitude/Longitude pair to your GPS location?
And once you have the distances you could use order() or rank() to pick the top
5 (maybe using head()) or just rank() on the distances.
And once you've picked a set you can still additionally check whether a
location was within the box.
S
df[order(df[,"x"]),]
or
df[order(df$x),]
And just to prevent yet more confusion, you might also want to avoid 'df' as a
name. 'df' is the function that returns the density of the F distribution ...
S Ellison
***
#x27;meanness', no-one
has yet pointed to Trey Causey's analysis of R-help's alleged meanness at
http://badhessian.org/2013/04/has-r-help-gotten-meaner-over-time-and-what-does-mancur-olson-have-to-say-about-it/
Up to 2013, it was apparently getting
s's names method:
names.eem <- function(x, ...){ "AnotherName"}
str(test1)
# List of 1
# $ AnotherName: chr "justaname"
# - attr(*, "class")= chr "eem"
So it isn't your '<-', it's because you overrode 'names'
S
th names of the right format.
I() wrapped round a matrix or data frame does nothing like what is needed if
you include it in a data frame construction, so either things have changed
since the tutorial was written, or the authors were not handling a matrix or
data frame with I().
S Ellison
**
> I want to get the table like "output". Any possibility to get it in R?
What do the rows represent in 'output'? Places? Times? Individuals?
What do the numbers in the table relate to? Individual bird identifier? Number
of birds?
> It is clear that a ) although is a type of bracket it is called a
> parenthesis, just as ,
> is called a comma, which is a type of punctuation mark.
These things are called parentheses because of what they do, not what they are.
A parenthesis is any word or phrase inserted as an explanation or
Meeting2", "Meeting3", "Meeting4","Meeting5")
>
> and have gotten a '+' at the end meaning I am missing something.
You are missing the closing bracket on the boxplot() command.
Just finish with a ')'
S Ellison
**
se in optim() - is pretty much
completely different from MCMC using a Gibbs sampling algorithm
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of debra ragland
> via R-help
> some sample data
> p<-matrix(c(rep(c(F,T,F),3), rep(c(T,F,T),3), rep(c(T,T,F),3),
> rep(c(F,F,T),3)))
i) Something wrong with p, here; it's a single column matrix. did you mean
p4<-matrix(c(rep(c(F,T
E,...){
x<-subset(x,subset)
do.call(type,list(x=x[[var]],...))
}
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
__
R-help@r-projec
If it's not what you meant, you'll need
to provide the picture.
S Ellison
***
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. If
you
> Could you please explain about
>
> sub("^([0-9]*).*$", "\\1", fields)
See ?regex and the extensive online literature on regular expressions.
S Ellison
***
This email and any attachments are confid
*x) + sin(w*x) to get alpha and beta, and hence
a and p. Those values could then be used as starting values for optim or
similar.
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
_
t from
" amet is not the only instance of 'amet', and there is more than one instance
of 'instance', 'is', 'of' and 'and'."
S Ellison
***
This email and any attachments a
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Luigi
> Marongiu
> if I have a sample set of the following numbers x1=0.09, x2=0.94, x3=0.48,
> x4=0.74, x5=0.04 I can calculate the variance easily.
Not without concatenating them into a vector, you ca
ately clear why you’re looping. grepl returns a vector of
logicals; you have a vector of character strings. Consider replacing 'if'
constructs with 'ifelse' - albeit a complicated ifelse() - and doing the whole
thing without a loop.
S Ellison
**
xact command you used above. If you used a different plotting
system for the bar plot the alignment would be very hard to guarantee, so stay
with base graphics for both.
S Ellison
***
This email and any attachments are confiden
panel.xyplot(x, y, ...)
panel.segmented(x, y, ...)
}
)
#And just to see if it works for panel-grouped data:
set.seed(1023)
dati$parts <- sample(gl(2, 50))
xyplot(y~x|parts, data=dati,
panel = function(x, y, ...) {
panel.xyplot(x, y, ...)
panel.segmented(x, y,
, 50))
xyplot(y~x|parts, data=dati,
panel = function(x, y, ...) {
panel.xyplot(x, y, ...)
panel.segmented(x, y, ...)
}
)
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
_
> I have already tried options(max.print=99) but does not show the desired
> result.
> As posted above it want to share the outcome with the business owner where
> there could be multiple entries.
Then just print the multiple entries. See ?duplicated for finding them
Otherwise, use things lik
> try tu put line
>
> setInternet2(TRUE)
>
> into your Rprofile.site file (located in etc directory of R installation) and
> restart
> R.
You may well need to specify the utils library, as follows, to make sure the
setInternet2 function is found at run time:
utils
> My preference is to start in different working directories depending on which
> project I am working on. R_USER is not a project directory. One way to do that
> is to double-click on an RData file located where you want to start.
Saving an empty 'empty.RData' image in my project directories when
_USER directory if R_USER exists (that is, the
working directory will be set to R_USER's contents).
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
__
> -Original Message-
> > I compute its regression surface doing polynomical regression (fit)
> > ...
> > fit <- lm(z ~ poly(x,2) + poly(y,2))
> >
.
> > So I want to repressent the surface
> > How could I do it? Any idea??
>
> You need to write a function f of x and y that produ
mRob in the robustbase
package to test your fixed effects; comparing the different inferences will
tell you something about which effects in OLS are simply artefacts caused by
outliers. lmRob uses comparatively recent developments in wald-type inference
tests to put the tests on a firmer footing.
of your MannKendalltau. So your result is a list of
lists.
Finally, you don’t need a loop at all. On a data frame, sapply would work
nicely, so (although I've not tested it) something like
sapply(desta[,2:nc], 2, function(x) ManKendall(x)$tau)
ought to do the whole thing in one shot and packa
renthesis, string terminator or
operator terminator - would be sensible.
As a clue, you could think about what '%' means in R. It does NOT mean 'percent'
S Ellison
***
This email and any attachments are co
near.output = FALSE, threshold = 0.1)
Does neuralnet not recognise '.'? If it does and if you include resp in the
data frame, you could drastically simplify the formula, to just resp~. That is:
out <- neuralnet(resp~. , data=cbind(resp, mydata), hidden = 4, lifesign =
xample, if you want to
plot a line over the data, use
xyplot(tmin~year|month, curr_data,
panel=function(x, y, ...) {
panel.xyplot(x, y, ...)
panel.lmline(x, y, ...)
}
)
S Ellison
***
This email and any attachme
you may not find it very interesting for such a small range
S Ellison
***
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. If
you have rece
e vector. A common symptom is that the bootstrap
sometimes works and sometimes doesn't, or only seems to work for small numbers
of bootstrap replicates.
But you're right; with no data, one can only guess.
S Ellison
**
("D"))
>
> How could I create an exhaustive list of length 21 now, each of whose
> elements
> contains a unique combination of vector elements?
do.call(expand.grid, lst)
S Ellison
***
This email and any atta
me length as your data. in a data frame it can be 1:nrow(dfr) etc.
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
__
R-help@r-project.org m
See ?tiff, ?png etc and look for 'res'
S Ellison
From: R-help [r-help-boun...@r-project.org] On Behalf Of linda.s
[samrobertsm...@gmail.com]
Sent: 01 March 2015 14:50
To: r-help
Subject: [R] figure resolution
when using R for exporting figures
re or less
trivially using R CMD from the package source code.
The documentation you're looking for on installation is 6.3 of 'R Installation
and Administration. For building packages locally from your own R source code,
look at
> 2) Switch off any anti-virus runtime checking.
Thanks; that seems to have been it - probably because of a recent Norton
update, as previous package installations worked smoothly.
S
***
This email and any attachments are confiden
his otherwise serviceable small
laptop and it'll be a while before I get back to my desktops, I'd appreciate
any clues as to what - if anything - I could to do in the mean time to get a
working package install.
S Ellison
***
You don't appear to be supplying a valid parameter set to optim.
The first argument in optim (par) must be a vector of parameters to optimise;
you're passing a vector of NAs. Thise are not finite.
Also, temp is defined as a value and optim will not be able to optimise that.
You need to define
> I want to do a boxcox transformation, but I got this:
> Error: could not find function "boxcox"
>
> What can I do?
Well, the recommended 'homework' in the posting guide would be a start.
i) ??boxcox, if you have any packages installed that include something with
that functionality.
ii) RSite
'col.main', 'sub', 'cex.sub', 'col.sub', 'xlab', 'ylab',
'cex.lab', and 'col.lab' are passed to 'title'."
The key phrase is "Currently, 'yaxs' and 'ylim' are
fiable. aov seems fairly tolerant of that in one sense - instead of
throwing an error and stopping it tells you what it can identify and leaves out
anything it can't.
S Ellison
***
This email
skill(pid) #Kill the process
You'll have to tweak that if you have more than one process with the same name,
and also to check for nonexistence of an expected process.
S Ellison
ur function, use uniroot to find a
root of (f(x) - 0.05)
That will normally need you to define a new function g(x) = f(x)-0.05 and apply
uniroot to g(x)
S Ellison
***
This email and any attachments are confidential. Any use,
> > I'd also be interested in why the 'direct, brute force' approach
> > (above) doesn't work,
Your example was a 3-dimensional array, so
> rownames(P) <- colnames(P) <- c(live', 'dead')
would have worked; rownames() and colnames() work on dimnames[1] and
dimnames[2].
But
rownames(P[,,1])
cou
ct 1 in the "cont" group.
Yes, but that isn't all, is it?
subject/group
means group nested in subject, expanding to
~subject+subject:group.
so Error(subject/group) asks for a subject effect across groups _as well as_
one within groups.
S Ellison
tution in
plotmath expressions; they just have to be followed very carefully.
And ?bquote is also useful for substitution in plotmath...
S Ellison
***
This email and any attachments are confidential. Any use, copying or
disclosure oth
> -Original Message-
> subsets<-list(B="(A[,1] %in% c(1,2) & A[,2] %in% c(1,2)) | (A[,1] %in%
> c(3) & A[,2] %in% c(1)) | (A[,1] %in% c(4) & A[,2] %in% c(1:4))", C="(A[,1]
> %in%
> c(1:4) & A[,2] %in% c(1,2))", D="(A[,1] %in% c(1,2) & A[,2] %in% c(1:3)) |
> (A[,1]
> %in% c(3) & A[,2]
David Stevens [david.stev...@usu.edu] wrote:
> There are other R-friendly editors too. Tinn-R and Notepad++ come to mind.
TextPad also has an R syntax file.
S Ellison
***
This email and any attachments are confidential. Any
See also the levene test from the car package, and for a single outlying
variance see the cochran test from the outliers package.
From: R-help [r-help-boun...@r-project.org] On Behalf Of sait k
[sa...@hotmail.de]
Sent: 08 January 2015 11:12
To: r-h...@lis
> A solution on the link below provides the steps of updating R without losing
> packages in Unix.
> http://zvfak.blogspot.se/2012/06/updating-r-but-keeping-your-installed.html
>
> How could I do that on windows 7 platform?
See the R Windows FAQ, FAQ 2.8.
***
> I want to change R-3.1.1 to the default, so that when I type which R, I get
> /usr/local/R-3.1.1
Change your PATH to include the R 3.1.1 directory instead of the version 2
directory?
S
***
This email and any attachments are
acter representation depends only on how much you decide to
round when converting to character format. That is essentially arbitrary, so
any games you play with conversion to character are just telling you how many
digits you decided to round each number to, not how many there were to start
with
title). Don't miss out section 10.7,
"Scope"; it's important, but follows 'advanced examples' which are less
important for a beginner.
After that, Google.
And after that, R-help again.
S Ellison
***
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Clint Bowman
>
> ?read.fortran
Also read.fwf if it's in a file.
S
***
This email and any attachments are con
ubstr(x, 9,12),
Precipitation=as.numeric(substring(x,13)))
}
decode.lst(lst1Sub)
S Ellison
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Zilefac Elvis
> Sent: 22 October 2014 16:38
> To: R. Help
>
> 3. all.equal(a, as.integer(a))
Closer, but be aware that all.equal will not always return TRUE or FALSE and -
more importantly - as.integer truncates towards zero and does NOT generally
round to the nearest integer.
a <- 4 - sqrt(2)^2 #Analytically 2
all.equal(a, as.integer(a))
# [1] "Mean re
all.equal, which is documented on the help page
you were referred to.
S Ellison
***
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. If
you hav
> But i use a<-10/b , b is some value ,may be 5, maybe 5.5
If you do floating point arithmetic on integers you'll usually get floating
point answers, including the 5.0.
See FAQ 7.31 for the usual floating point problem, and ?all.equal for the usual
answer to it. You could see if a result is cl
> I want to plot( 11:20 ) in a plot.
> if i just type the code above, the y value will be from 11 to 20, now i
> want the
> value from a given range like 0 to 40, how can i do it?
See the ylim= argument to plot.default; eg
plot(x, y, ylim=c(0,40))
Also look at ?par and note that plot() and
> Thanks Joshua and Sven - I completely forgot about which() .
Also
na.omit(p[p<=0.05])
#and
p[p<=0.05 & !is.na(p)]
S.
***
This email and any attachments are confidential. Any use...{{dropped:8}}
> I'm stuck trying to begin an axis label in ggplot with a superscript.
For a crude work-round, you could try
ggplot(mydata) +
aes(x = x, y = y) +
geom_line() +
ylab(expression(paste(' '^{14}, "C&qu
environment from one object directly
to another object.
This kind of thing is exactly what makes watching R-help so worthwhile.
S Ellison
***
This email and any attachments are confidential. Any use...
nd then
> earima(lh, order = c(1,0,0)) #First example from arima
#Returns (or at least displays) ...
Welcome to the new Arima!
Call:
Arima(x = lh, order = c(1, 0, 0))
Coefficients:
ar1 intercept
0.5739 2.
Keith Jewell said:
> ... from reading ?all.equal I would have expected
> scale = 1 and the default scale = NULL to give identical results for the
> length
> one numerics being passed to all.equal.
>
> Can anyone explain?
Inspectng the code in all.equal.numeric, I find
xy <- mean((if (cplx)
C and R code for pt and qt in R (the cumulative probability distribution and
the inverse, quantile, function respectively) is available in the R source
code, which you can obtain from CRAN; see
http://CRAN.R-project.org/mirrors.html - see the source code link from any of
the listed mir
> > Is there an easy way to check whether a variable is within +/- 10%
> > range of another variable in R?
You could use
2*abs(A-B)/(A+B) < 0.1
which avoids an apply().
I've assumed you meant different by under 10% of the mean of the two, hence the
2/(A+B); if you meant 10% of something else, s
Inability to access a repository index is very often an indication of a failed
internet connection from R. In Windows that is often a result of incorrect
proxy settings or other internet connection settings. The R Windows FAQ, 2.19
("The Internet download functions fail") may have the answer...
> If I want to divide the column of a matrix by the sum of the column, should I
> loop over the columns or can I use apply family?
Looping's unnecessary.
See ?scale or ?sweep, with ?colSums for two non-looping answers; apply() also
works if you give it a suitable function argument.
S
**
> We are currently trying to migrate 3 users of "R" to a citrix based
> environment, but are coming across major issues trying to install the
> packages to the relevant image.
Why can't you open a virtualised OS instance, install and start R in the normal
way, install the packages normally in R
> -Original Message-
> > x<-"/mnt/AO/AO Data/S01-012/120824/"
>
> I would like to extract "S01-012"
> gsub("/mnt/AO/AO Data/(.+)/.+", "\\1", x)
#does it, as does
> gsub("/mnt/AO/AO Data/([\\w-]+)/.+", "\\1", x, perl=TRUE)# \w is perl RE;
> the default is POSIX, which would be.
>
> I want to keep only the part inside the two points. After lots of headache
> using grep() when trying something like this:
>
> grep('.(.*?).','df.subject_test.RData',value=T)
>
>
> Does anyone have any suggestion ?
gsub("df\\.(.+)\\.RData", "\\1", 'df.subject_test.RData')
Steve E
***
ion line drawings. So for single graphs I
generally stick to base graphics.
S Ellison
***
This email and any attachments are confidential. Any use...{{dropped:8}}
__
R-help@r-project.org
101 - 200 of 662 matches
Mail list logo