Re: [R] R intersect()

2016-06-28 Thread S Ellison
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

Re: [R] biplot

2016-06-23 Thread S Ellison
> 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

Re: [R] R help contingency table

2016-06-20 Thread S Ellison
versa? [not 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

Re: [R] detecting if a variable has changed

2016-06-14 Thread S Ellison
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 finding the loc

Re: [R] subset data right

2016-05-27 Thread S Ellison
ta.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 names as variable names. Too much potential for

Re: [R] What are some toy models I can use in R?

2016-05-25 Thread S Ellison
> -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

Re: [R] Factor Variable frequency

2016-05-25 Thread S Ellison
> 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"])

Re: [R] promoting scalar arguments to vectors in a function

2016-05-23 Thread S Ellison
ero-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}} __ R-help@r-projec

Re: [R] Programming Assignment 1: Quiz Air Pollution (Week 2: Programming with R)

2016-05-23 Thread S Ellison
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 Air Polluti

Re: [R] write a function inside the summation in a more condensed form

2016-04-11 Thread S Ellison
> 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] )

Re: [R] Problem with <= (less than or equal): not giving the expected result

2016-04-06 Thread 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 email a

Re: [R] minimal attributes to get se.fit

2016-04-04 Thread S Ellison
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/standard err

Re: [R] Export the result k-means cluster to CSV file

2016-03-29 Thread S Ellison
coordinates 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.

Re: [R] Export the result k-means cluster to CSV file

2016-03-24 Thread S Ellison
.) } 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 **

Re: [R] How to make a function aware of its own call arguments

2016-03-24 Thread 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

Re: [R] Fit a smooth closed shape through 4 points

2016-03-21 Thread S Ellison
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

Re: [R] About calculation of the gravity model in R and STATA software

2016-03-19 Thread S Ellison
ily 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 message in error

Re: [R] please help

2016-03-14 Thread S Ellison
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 lookin

Re: [R] assign a vector to list sequence

2016-03-09 Thread 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

Re: [R] group by rows

2016-03-09 Thread S Ellison
r example, 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)

Re: [R] Lexical scoping for step and add1 functions

2016-03-09 Thread S Ellison
+"))) ) test.FN(scope=scope) } test.step(X.des, Y) S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ R-help@r-project.org m

Re: [R] missing values in csv file

2016-02-17 Thread S Ellison
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}} __ R-help

Re: [R] Error on Text Mining for WordCloud

2016-02-14 Thread S Ellison
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

Re: [R] How to extract same columns from identical dataframes in a list?

2016-02-09 Thread S Ellison
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: Re: [R] H

Re: [R] pearson correlation matrix

2016-02-09 Thread S Ellison
f 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 intended reci

Re: [R] Package for error analysis

2016-02-05 Thread S Ellison
culations). 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-help [mailto:r

[R] Has R-help changed reply-to policy?

2016-02-04 Thread S Ellison
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

Re: [R] find numbers that fall in a region or the next available.

2016-02-03 Thread S Ellison
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 Ellison **

Re: [R] Sorting a Data Frame

2016-01-26 Thread S Ellison
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 *** This em

Re: [R] R-help mailing list activity / R-not-help?

2016-01-26 Thread S Ellison
ess', 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 _less_ 'mean', not more.

Re: [R] Strange behavior with S3 class

2016-01-18 Thread S Ellison
tion(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 Ellison ***

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-15 Thread S Ellison
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 **

Re: [R] Would you please help me to create a table in R?

2015-12-18 Thread 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?

Re: [R] Make a box-whiskers plot in R with 5 variables, color coded.

2015-12-15 Thread S Ellison
> 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

Re: [R] Make a box-whiskers plot in R with 5 variables, color coded.

2015-12-15 Thread S Ellison
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 **

Re: [R] If I have 3 parameters, is optim() doing the same thing as Gibbs sampling?

2015-12-10 Thread S Ellison
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}} __ R-

Re: [R] applying wilcox.test to every combination of rows in a matrix (pairwise)

2015-12-09 Thread S Ellison
> 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

Re: [R] Graphing a subset of data

2015-12-01 Thread S Ellison
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-

Re: [R] Extracting part of alpha numeric string

2015-11-30 Thread S Ellison
> 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

Re: [R] PCA plot of variable names only

2015-11-30 Thread S Ellison
xes. 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 have recei

Re: [R] Non-linear fit?

2015-11-25 Thread S Ellison
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}} __

Re: [R] How to calculate variance on multiple numbers at once?

2015-11-11 Thread S Ellison
> -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

Re: [R] Calculating distance between words in string

2015-11-11 Thread S Ellison
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 are confidential. Any use...{{dropped:8}}

Re: [R] regex not working for some entries in for loop

2015-10-26 Thread S Ellison
r 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

Re: [R] Scope of Axes

2015-10-22 Thread S Ellison
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 confidential.

Re: [R] Piecewise regression using segmented package plotted in xyplot

2015-08-28 Thread S Ellison
: 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, ...) } ) S Ellison *** This email and any attachments

Re: [R] Piecewise regression using segmented package plotted in xyplot

2015-08-28 Thread S Ellison
, ...) } ) 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 https

Re: [R] Output In R

2015-08-20 Thread S Ellison
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 like

Re: [R] lme4 package installation

2015-08-17 Thread S Ellison
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::setInternet2() S Ellison

Re: [R] Why does R start in wrong working directory despite R_USER setting?

2015-08-10 Thread S Ellison
(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}} __ R-help@r-project.org mailing list

[R] Setting R working directories on Windows - was RE: Why does R start in wrong working directory ...

2015-08-10 Thread S Ellison
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 I

Re: [R] rgl 3d surface

2015-07-16 Thread S Ellison
-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 produces the fitted

Re: [R] Fixed effects regression and robust regression

2015-05-20 Thread S Ellison
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. S Ellison

Re: [R] Calculating Kendall's tau

2015-04-02 Thread S Ellison
. 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 package it nicely into a named vector while it's about it. S Ellison

Re: [R] Fitting a line on trellis plot

2015-03-25 Thread S Ellison
(x, y, ...) panel.lmline(x, y, ...) } ) 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

Re: [R] Fwd: missing in neural network

2015-03-25 Thread S Ellison
'.'? 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 = minimal, linear.output = FALSE, threshold = 0.1) S Ellison

Re: [R] Graph with ggplot2.

2015-03-25 Thread S Ellison
could think about what '%' means in R. It does NOT mean 'percent' S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ R-help@r-project.org mailing

Re: [R] density plot not smooth

2015-03-18 Thread S Ellison
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 received this message in error, please notify

Re: [R] subset a data frame by largest frequencies of factors

2015-03-06 Thread S Ellison
) etc. 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 https://stat.ethz.ch

Re: [R] Error in thielsen

2015-03-06 Thread S Ellison
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 *** This email and any attachments are confidential. Any use...{{dropped:8

Re: [R] Concatenating elements from lists via combinations

2015-03-06 Thread S Ellison
? do.call(expand.grid, lst) 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

Re: [R] figure resolution

2015-03-01 Thread S Ellison
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 to folder

[R] Packages not installing on XP

2015-02-24 Thread S Ellison
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 *** This email and any attachments

Re: [R] Packages not installing on XP

2015-02-24 Thread S Ellison
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

Re: [R] Convert windows source package for Mac use

2015-02-24 Thread S Ellison
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 'Writing R Extensions' S Ellison

Re: [R] [BUG] or [undocumented] boxplot - horizontal swaps ylim and xlim

2015-02-13 Thread S Ellison
', 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 https://stat.ethz.ch/mailman

Re: [R] SIMPLE question

2015-02-13 Thread S Ellison
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)

Re: [R] Why I am getting error when writing a function for optim?

2015-02-13 Thread 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

Re: [R] Terminating a program using R

2015-02-12 Thread S Ellison
process with the same name, and also to check for nonexistence of an expected process. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ R-help@r

Re: [R] help in anova

2015-02-12 Thread S Ellison
an error and stopping it tells you what it can identify and leaves out anything it can't. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ R-help

Re: [R] How to solve this complex equation

2015-02-10 Thread S Ellison
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, copying or disclosure other than

Re: [R] aov and Error function

2015-02-02 Thread S Ellison
, expanding to ~subject+subject:group. so Error(subject/group) asks for a subject effect across groups _as well as_ one within groups. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8

Re: [R] naming rows/columns in 'array of matrices'

2015-02-02 Thread S Ellison
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]) could not

Re: [R] lost in plotmath expressions

2015-01-30 Thread S Ellison
for substitution in plotmath... 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 message in error, please

Re: [R] create a function with subset statement

2015-01-29 Thread S Ellison
-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] %in% c(1,2)))

Re: [R] R vs. RStudio?

2015-01-11 Thread S Ellison
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 use

Re: [R] i need help for var.test()

2015-01-08 Thread S Ellison
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:

Re: [R] change default installation of R

2014-10-31 Thread S Ellison
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

Re: [R] How to update R without losing packages

2014-10-31 Thread S Ellison
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.

Re: [R] how to calculate a numeric's digits count?

2014-10-24 Thread S Ellison
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. S

Re: [R] assignment 2 part 1,2,3

2014-10-23 Thread S Ellison
, 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 *** This email and any attachments are confidential. Any use...{{dropped:8

Re: [R] Split fixed width data in R

2014-10-22 Thread S Ellison
), 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 Subject: [R] Split fixed width data in R

Re: [R] Split fixed width data in R

2014-10-22 Thread 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

Re: [R] how to judge a virable is a integer?

2014-10-20 Thread S Ellison
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 have received this message in error, please notify the sender

Re: [R] how to judge a virable is a integer?

2014-10-20 Thread S Ellison
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: [R] how to judge a virable is a integer?

2014-10-18 Thread S Ellison
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

Re: [R] ggplot - start axis label with superscript

2014-10-14 Thread S Ellison
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, sep = ))) S Ellison

Re: [R] SOLVED: evaluate NA to FALSE instead of NA?

2014-10-14 Thread S Ellison
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}}

Re: [R] how to ajust y-axis values in plot() ?

2014-10-14 Thread S Ellison
  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

Re: [R] a REALLY dumb question

2014-10-06 Thread S Ellison
: ar1 intercept 0.5739 2.4133 s.e. 0.1161 0.1466 sigma^2 estimated as 0.1975: log likelihood = -29.38, aic = 64.76 ... which seems to be doing what you want... S Ellison *** This email and any attachments

Re: [R] a REALLY dumb question

2014-10-06 Thread S Ellison
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...{{dropped:8

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-02 Thread S Ellison
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, same

Re: [R] Inverse Student t-value

2014-10-02 Thread S Ellison
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 mirrors. S Ellison

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-02 Thread S Ellison
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)

Re: [R] uninstalled and reinstalled R, now cannot install packages

2014-10-01 Thread S Ellison
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...

Re: [R] division of col by the sum of the col

2014-09-23 Thread S Ellison
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

Re: [R] Help on installing R packages in a Citrix

2014-08-22 Thread S Ellison
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

Re: [R] regex pattern assistance

2014-08-15 Thread S Ellison
-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. gsub(/mnt/AO/AO

Re: [R] Regex - subsetting parts of a file name.

2014-07-31 Thread S Ellison
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

Re: [R] Area Graphs

2014-07-16 Thread S Ellison
generally stick to base graphics. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

<    1   2   3   4   5   6   7   >