Re: [R] R and Interactive Visualizations

2013-11-22 Thread Bryan Hanson
I think you will need to do this in a web page running java. So you need a way to link your R stuff to java, possibly back and forth depending upon exactly what you end up doing. You've found some pages already. But look also at shiny and d3. http://www.rstudio.com/shiny/ http://d3js.org/ A

Re: [R] R packages for CAT scans

2013-09-18 Thread Bryan Hanson
Check here: http://cran.r-project.org/web/views/MedicalImaging.html Bryan On Sep 18, 2013, at 7:56 AM, wwreith wrote: > Does anyone know of a package that would allow data from a CT scan to be > loaded into R? > > Thanks! > > > > -- > View this message in context: > http://r.789695.n4.nabb

Re: [R] (no subject)

2013-07-15 Thread Bryan Hanson
Look at the package chemometrics, it can certainly handle your number of variables (p > n is what that's called and it requires special considerations). I don't recall about missing values. The authors of that package also have a very helpful text. Good Luck. Bryan On Jul 14, 2013, at 10:50

Re: [R] Issue with Imports in NAMESPACE

2013-06-25 Thread Bryan Hanson
By chance is any of this related to what I'll call the 'depends relay' discussed in this SO post? http://stackoverflow.com/a/8638902/633251 (see the 'caveat' to Josh O'Brien's answer, which also links back to another answer by Martin Morgan). This issue has happened to me and the symptoms are e

Re: [R] Proper way to implement package internal functions

2013-06-12 Thread Bryan Hanson
On 13/06/13 03:34, Bryan Hanson wrote: > > >> So this warning from check is not a problem in the long run: >> >> * checking for missing documentation entries ... WARNING >> Undocumented code objects: >> ‘ang0to2pi’ ‘dAB’ ‘doBoxesIntersect’ ... >> A

Re: [R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Bryan Hanson
hing like this > > D65 <- c(0.3127, 0.329, 0.3583) > > X <- 100 * D65[1] > Y <- 100 * D65[2] > Z <- 100 * D65[3] > XYZ <- data.frame(X = X, Y = Y, Z = Z) > > convertColor(XYZ, from = "XYZ", to = "sRGB") > [,1] [,2] [,3]

Re: [R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Bryan Hanson
, from = "XYZ", to = "sRGB") # none of these are 1,1,1, namely white (they are ~ 0.6, 0.6, 0.6) So it looks like D65, a white standard, does not come back to something near white in the sRGB space. What am I doing wrong here, or what do I misunderstand? Please don't s

[R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Bryan Hanson
grDevices::convertColor has arguments 'from' and 'to' which can take on value 'XYZ'. Can someone confirm that 'XYZ' is the same as the CIE chromaticity coordinates that are also sometimes refered to as 'xyY' in the literature? Or are these the CIE tristimulus values? It looks to me like the f

Re: [R] Proper way to implement package internal functions

2013-06-12 Thread Bryan Hanson
hould have documentation entries. if I understand correctly. I guess the reason I didn't find any documentation is the wide lattitude which is possible. Thank you. Bryan On Jun 12, 2013, at 10:57 AM, Duncan Murdoch wrote: > On 12/06/2013 10:44 AM, Bryan Hanson wrote: >> [p

[R] Proper way to implement package internal functions

2013-06-12 Thread Bryan Hanson
[previously posted on Stack Overflow: http://stackoverflow.com/questions/17034309/hiding-undocumented-functions-in-a-package-use-of-function-name ] I've got some functions I need to make available in a package, and I don't want to export them or write much documentation for them. I'd just hide

Re: [R] rgl crashes after one successful draw

2013-05-29 Thread Bryan Hanson
one on > Apple's GL. In particular, are you using command-line R or R.app? > > I seem to be able to reproduce it using R.app, in which case it is most > definitely for R-sig-mac, and a workaround is to use command-line R. > > On 29/05/2013 15:11, Bryan Hanson wrote: >&g

[R] rgl crashes after one successful draw

2013-05-29 Thread Bryan Hanson
This is really odd, and probably 100% local to me, but I'm at a loss as to a next step. After narrowing things down, here's how to reproduce: library("rgl") showSomething <- function() { open3d() points3d(rnorm(10),rnorm(10),rnorm(10)) axes3d() title3d('main','s

Re: [R] Linebreaks in cat() functions that call other variables?

2013-05-22 Thread Bryan Hanson
The only permutation you likely didn't try: >> cat("df(between) is", a[1,1], "\ndf(within) is", a[2,1]) \n has to be inside the quotes. HTH. Bryan On May 22, 2013, at 4:34 PM, jordanbrace wrote: > Hi everyone, > > I'm having some difficulty getting the linebreaks I want with the cat() > fun

Re: [R] Image segmentation

2013-04-06 Thread Bryan Hanson
I've recently had a reason to work a little with image segmentation too, and in addition to EBImage, you should look at biOps. You can learn a lot by studying these packages. Bryan On Apr 6, 2013, at 10:04 AM, Eder Paulo wrote: > Hello, > > Thanks for replying me! > > I was investigating t

Re: [R] OrgMassSpecR peak area issue

2013-03-18 Thread Bryan Hanson
If you type DrawChromatogram you can see the method used to calculate the peak area. Looks to me like you could easily hack it if you wanted. The relevant part about peak areas is this: for (j in 1:n) { k <- (j%%n) + 1 x[j] <- peakTime[j] * peakIntensity[k] - pe

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Bryan Hanson
I am, unfortunately, well-aware of the limitations that Ken points out (and I do appreciate him making these points). One can readily demonstrate the gamut limitations by printing the diagram Ishida links to on different devices. My hope is to get something close and include a disclaimer. Bry

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Bryan Hanson
I can send you my not quite perfect attempt a little later today. Bryan **** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University Greencastle IN 46135 USA academic.depauw.edu/~hanson/deadpezsociety.html github.com/bryanhanson academic.depauw.edu/~hanson/UMP/In

Re: [R] Fitting this data with a gaussian would be great

2013-02-23 Thread Bryan Hanson
Fortune candidate? I hear the landlord is hell, but the company good. Bryan > I've > already got an apartment reserved for me in one of Pat Burns's "R > Inferno" levels, and I don't want to descend even further. > > Best, > Bert __ R-help@r-project.o

Re: [R] R calculates small numbers, where the result should be zero

2012-09-11 Thread Bryan Hanson
This is the result of how any computer program stores numbers, it's not unique to R. A slightly different question is discussed in R FAQ 7.31 but it applies to your situation. You may also enjoy the R Inferno at www.burns-stat.com/pages/Tutor/R_inferno.pdf Bryan *** Bryan H

Re: [R] How can I "declutter"/make a biplot less messy in R

2012-06-18 Thread Bryan Hanson
Don't do the biplot. Darn hard to make sense of anyway. Plot the scores and the loadings separately. You can see how to do that in this thread: http://r.789695.n4.nabble.com/How-to-plot-PCA-output-td4614732.html Good Luck. Bryan *** Bryan Hanson Professor of Chemistry & Bio

Re: [R] Reading a bunch of csv files into R

2012-05-28 Thread Bryan Hanson
bset myList and basically turn it into related chunks of the original. HTH. Bryan On May 28, 2012, at 12:27 PM, HJ YAN wrote: > Dear Bryan > > Thank you so much for your prompt reply! > > Please see my responds below under = in your reply... > > Many thanks ag

Re: [R] Reading a bunch of csv files into R

2012-05-28 Thread Bryan Hanson
OK, a couple of things (I only looked through quickly): 1. R doesn't allow variable names to begin with a number. Be sure you don't try that. 2. What's the overall goal here? Read them in, change the name, then write them out? Let us know and it will be easier to help you. 3. Regardless of

Re: [R] Reading a bunch of csv files into R

2012-05-25 Thread Bryan Hanson
HJ, try something like this: files <- list.files(pattern = "\\.(csv|CSV)$") for (i in 1:length(files)) { temp <- read.csv(files[i], header = FALSE) ... do whatever you want with the contents of temp... } Bryan ******* Bryan Hanson Profes

Re: [R] How to interpret an ANOVA result?

2012-05-15 Thread Bryan Hanson
at comes to my mind. Here it is. It might be pretty much self-explanatory, if not, try ?aov and ?TukeyHSD for details. Maybe it answers your questions about why things are significant or not. Hopefully I didn't misunderstand your questions. Good Luck. Bryan *** Bryan Hanson Pr

Re: [R] How to plot PCA output?

2012-05-08 Thread Bryan Hanson
> [...] > But having indicated that I don't see a biplot's multiple scales as > particularly likely to confuse or mislead, I'm always interested in > alternatives. The interesting question is 'given the same objective - a > qualitative indication of which variables have most influenced the loca

Re: [R] How to plot PCA output?

2012-05-07 Thread Bryan Hanson
uses? Does it even > matter? > Cheers, > > Chris > > > On 07/05/2012 14:36, "Bryan Hanson" wrote: > >> Christian, is that 36 samples x 11K variables? Sounds like it. Is this >> spectroscopic data? >> >> In any case, the scores are in t

Re: [R] How to plot PCA output?

2012-05-07 Thread Bryan Hanson
Good luck. Bryan *** Bryan Hanson Professor of Chemistry & Biochemistry DePauw University On May 7, 2012, at 6:22 AM, Christian Cole wrote: > I have a decent sized matrix (36 x 11,000) that I have preformed a PCA on > with prcomp(), but due to the large number of variables I can

Re: [R] Not getting correct graphs

2012-03-31 Thread Bryan Hanson
Attachments don't come through on this list. It would be helpful to know what you mean by "junk graphs". Your coding style is a little hard to follow as it is a mix of -> and <- but I think you definitely have a problem in > for (i in refid) which should probably be for (i in 1:length(refid)

Re: [R] Singleton pattern

2012-03-16 Thread Bryan Hanson
ers from copying it, which would be more along the lines of a singleton. You can google the archives for some great discussions of S3 vs S4 if that sounds interesting. Bryan *** Bryan Hanson Professor of Chemistry & Biochemistry DePauw University On Mar 16, 2012, at 7:47 AM, David

Re: [R] Mac shortcut for running a script

2011-12-13 Thread Bryan Hanson
For just running a single line? apple-return Bryan On Dec 13, 2011, at 10:19 AM, asafw wrote: > Hi, > > I wonder if there is a mac equivalent to ctrl+r shortcut for running a > script line.. > (I am using MAC OS X 10.7.2). I saw this post > http://r.789695.n4.nabble.com/Shortcut-to-run-script-

Re: [R] Writing a function, want a string argument to define the name of the excel sheet to be called

2011-12-01 Thread Bryan Hanson
Sure, change your example as follows and then you can pass the name properly: foo <- function(x,y,NAME = "filename.csv"){ #make a matrix with x rows and y cols M <- matrix(nrow=x,ncol=y) #write the matrix write.table(M, file = NAME,append=TRUE, sep = ",") } Bryan **

Re: [R] nipals in the chemometrics package in R

2011-12-01 Thread Bryan Hanson
ve us more details about what you are doing. Bryan **** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University Greencastle IN 46135 USA academic.depauw.edu/~hanson/deadpezsociety.html github.com/bryanhanson academic.depauw.edu/~hanson/UMP/Index.html On Dec 1, 2011,

[R] [R-pkgs] Package HiveR 0.1-4 Released

2011-11-21 Thread Bryan Hanson
vements in speed for 3D plots. Please do let me know if you have questions, feature requests or find problems. Thanks, Bryan **** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University Greencastle IN 46135 USA academic.depauw.edu/~hanson/deadpezsociety.html github.c

Re: [R] 2^k experiment generator

2011-11-13 Thread Bryan Hanson
Check out the Task View on Experimental Design: http://cran.at.r-project.org/web/views/ExperimentalDesign.html but perhaps packages rsm or qualityTools have what you want. Bryan *** Bryan Hanson Professor of Chemistry & Biochemistry DePauw University On Nov 13, 2011, at 9:2

Re: [R] ggplot2 - regression statistics how to display on plot

2011-11-10 Thread Bryan Hanson
Jim, you can use the function appended below, which is part of package HandyStuff. If you want an example, see ?lmEqn after installing HandyStuff, available at github.com/bryanhanson/HandyStuff. Bryan lmEqn <- function(df = NULL, y = NULL, x = NULL, method = "lm", leg.loc = c(0, 0),

[R] Package build/check OK, install looking for irrelevant function

2011-11-09 Thread Bryan Hanson
king for what I asked (is.a vs is.not.a). Perhaps unrelated. And a google search of the error message doesn't produce anything recent. I've restarted my computer and upgraded to the latest patched R. Problem remains. This was not occurring last weekend, but I'm not sure how I migh

Re: [R] plotmath: unexpected SPECIAL

2011-06-22 Thread Bryan Hanson
ten enough to become decent at it. Thanks again. Bryan On Jun 22, 2011, at 8:49 PM, David Winsemius wrote: On Jun 22, 2011, at 8:10 PM, Bryan Hanson wrote: Hello R Masters and the Rest of Us: The first of these works fine, the 2nd is accepted but too literal (the "%->%" is

[R] plotmath: unexpected SPECIAL

2011-06-22 Thread Bryan Hanson
t this? I want the two phrases connected by a right arrow. TIA, these things always elude me. Bryan *** Bryan Hanson Professor of Chemistry & Biochemistry DePauw University xlab1 <-expression(paste("Phase Angle ", phi, " Neat-O")) xlab2 <- express

Re: [R] Downloading a csv from Dropbox using the shareable link

2011-05-23 Thread Bryan Hanson
wn into a different directory. As long as I bury these folders deep enough that I don't have to use a relative path that ever hits the "PersonX" level I suppose it will work. I'll try it out. Further suggestions welcome. Thanks, Bryan On May 20, 2011, at 8:24 PM, Patrick Co

Re: [R] Downloading a csv from Dropbox using the shareable link

2011-05-20 Thread Bryan Hanson
hat ever hits the "PersonX" level I suppose it will work. I'll try it out. Further suggestions welcome. Thanks, Bryan On May 20, 2011, at 8:24 PM, Patrick Connolly wrote: On Fri, 20-May-2011 at 02:05PM -0400, Bryan Hanson wrote: Hello Kindred R Spirits... I'm try

[R] Downloading a csv from Dropbox using the shareable link

2011-05-20 Thread Bryan Hanson
oing this. Thanks for any suggestions. Bryan ******** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University Greencastle IN 46135 USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] (no subject)

2011-04-17 Thread Bryan Hanson
Is there any news on this issue? I have the same problem but on a Mac. I have upgraded R and updated the built packages. The console output and sessionInfo are below. The problem is triggered by library(ggplot2) my .Rprofile If I do library(ggplot2) after the aborted start up ggplot2 is loaded

[R] [R-pkgs] Package ChemoSpec 1.46 Now Available on CRAN

2011-03-30 Thread Bryan Hanson
round in R. A vignette illustrating typical operations is available. Naturally, I'd be glad to hear from users with suggestions and bug reports. Bryan ****** Bryan Hanson Prof. of Chemistry & Biochemistry DePauw University Greencastle Indiana USA [[alternative HTML v

[R] [R-pkgs] Package FuncMap Now Available on CRAN

2011-03-30 Thread Bryan Hanson
ferences between the structure of the two popular plotting packages lattice and ggplot2. Bryan ** Bryan Hanson Prof. of Chemistry & Biochemistry DePauw University Greencastle Indiana USA require(mvbutils) require(lattice) require(ggplot2) require(FuncMap) # Use Mark Bravington's fo

Re: [R] robust estimation

2011-03-11 Thread Bryan Hanson
Willi, try this: install.packages("sos") library("sos") findFn("L1 norm regression") I find 34 hits but you'd have to look them over to see if any of them are the sort of thing you want. HTH, Bryan Prof. Bryan Hanson Dept of Chemistry &am

Re: [R] The L Word

2011-02-24 Thread Bryan Hanson
he concept mentioned. Of course, it could be somewhere else. But, the concept is pretty straightfoward. Bryan **** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University 602 S. College Ave Greencastle IN 46135 USA On Feb 24, 2011, at 3:13 AM, Tal Galili wrote:

Re: [R] question regarding basic stat question

2011-02-22 Thread Bryan Hanson
Daniel, how is the data stored? The answer to your question may be as simple as > df <- read.csv("filename.csv") > summary(df) See ?read.csv for info on reading various file formats. HTH, Bryan **** Prof. Bryan Hanson Dept of Chemistry & Biochemistry

Re: [R] Function to locate points in 3d octants or points on twoaxes

2011-02-02 Thread Bryan Hanson
g ] On Behalf Of Bryan Hanson Sent: Wednesday, February 02, 2011 5:23 AM To: Petr Savicky Cc: r-help@r-project.org Subject: Re: [R] Function to locate points in 3d octants or points on twoaxes Thanks Petr, the sign function will be of help. I was not aware of it. Bryan On Feb 2, 2011, at 3:21 A

[R] General Solution to Drawing a Spline Curve in 3d?

2011-02-02 Thread Bryan Hanson
curve or xspline. What I'm trying to do is related to the idea of great circles, as implemented in package geosphere, but the curves I'd like to draw are not on the surface of a sphere nor are they parts of a circle. Thanks for any suggestions! Bryan ******* Bryan Hans

Re: [R] Function to locate points in 3d octants or points on two axes

2011-02-02 Thread Bryan Hanson
Thanks Petr, the sign function will be of help. I was not aware of it. Bryan On Feb 2, 2011, at 3:21 AM, Petr Savicky wrote: On Tue, Feb 01, 2011 at 08:30:22PM -0500, Bryan Hanson wrote: [Sorry, resending with a proper subject line!] Hi Guru's... I have a set of points that ma

[R] Function to locate points in 3d octants or points on two axes

2011-02-01 Thread Bryan Hanson
ask. Thanks, Bryan ******** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University 602 S. College Ave Greencastle IN 46135 USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the po

[R] Function to

2011-02-01 Thread Bryan Hanson
ss product might be part of this, but I'm a little rusty on how to apply it. I hope this is clear enough, and someone has a suggestion to point me in the right direction. Before writing my own klunky version, I thought I'd ask. Thanks, Bryan ******** Prof. Bryan Hans

Re: [R] Parsing a Simple Chemical Formula

2010-12-26 Thread Bryan Hanson
hings to read through from the various recommendations. Thanks again, Bryan On Dec 26, 2010, at 10:21 PM, David Winsemius wrote: On Dec 26, 2010, at 8:28 PM, Bryan Hanson wrote: Thanks Spencer, I'll definitely have a look at this package and it's vignettes. I believe I have looked a

Re: [R] Parsing a Simple Chemical Formula

2010-12-26 Thread Bryan Hanson
hemical Thermodynamics and Activity Diagrams" and provides many more capabilities that might interest you. Hope this helps. Spencer On 12/26/2010 5:01 PM, Bryan Hanson wrote: Well let me just say thanks and WOW! Four great ideas, each worthy of study and I'll learn severa

Re: [R] Parsing a Simple Chemical Formula

2010-12-26 Thread Bryan Hanson
R! A big thanks to each of you! Bryan On Dec 26, 2010, at 7:26 PM, Gabor Grothendieck wrote: On Sun, Dec 26, 2010 at 6:29 PM, Bryan Hanson wrote: Hello R Folks... I've been looking around the 'net and I see many complex solutions in various languages to this question, but I have

[R] Parsing a Simple Chemical Formula

2010-12-26 Thread Bryan Hanson
t a way to convert "form" into a list or data frame which I can then do the math on. Here's hoping this is a simple issue for more experienced R users! TIA, Bryan *** Bryan Hanson Professor of Chemistry & Biochemistry _

Re: [R] Forcing standard notation in Sweave tables

2010-12-13 Thread Bryan Hanson
Take a look at package xtable. Bryan On 12/13/10 7:31 PM, "Chris Fonnesbeck" wrote: > I'm hoping someone with some experience generating tables in Sweave will be > able to solve this problem for me. I'm experiencing some inconsistency with > the way floating point numbers are displayed -- for

Re: [R] How to change leaf color by group in hclust plot or how to install A2R package in windows?

2010-12-13 Thread Bryan Hanson
An example is described here that you can adapt: http://r.789695.n4.nabble.com/coloring-leaves-in-a-hclust-or-dendrogram-plot -tt795496.html#a795497 HTH. Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 12/13/10 12:54 PM, &qu

Re: [R] Error in calcCurveGrob(x, x$debug) : End points must not be identical

2010-12-05 Thread Bryan Hanson
ck now. The problem with the viewport being wrong was limited to the toy example I made. I'll send you a graphic directly so you can see what I'm working on. Thanks again for the correct "test" for identical endpoints. Should have been able to see that one myself! Bryan

[R] Error in calcCurveGrob(x, x$debug) : End points must not be identical

2010-12-04 Thread Bryan Hanson
Hi All... I haven¹t found mention of this error anywhere. I'm trying to draw spline curves using grid graphics. Most of the time, I have no problems, but I have some data sets that give the error in the subject line. I'm not sure which end points are identical, but the end points passed to the fu

Re: [R] Replacing several rows of a matrix at once

2010-11-28 Thread Bryan Hanson
riations you might want to deal with. > > Cheers, Mike. > > On Mon, Nov 29, 2010 at 2:53 PM, Bryan Hanson wrote: >> Hello Folks.  This must be a silly question with a (not) obvious (to me) >> answer. >> >> Consider this: >> >> tmp <- matrix(1:20

[R] Replacing several rows of a matrix at once

2010-11-28 Thread Bryan Hanson
mn and recycles vec. What I want to do is replace multiple rows simultaneously at once. I suppose I can write a function, but this seems pretty fundamental so I feel I must be missing some obvious alternative. I'm feeling like I'm in the Inferno! TIA. Bryan * Bryan Hans

[R] Grid newbie: aligning & scaling viewports

2010-11-19 Thread Bryan Hanson
circles don't have the intended radius - if my math is right, the outmost circle should touch the ends of the colored axes. My sense is that this has something to do with my mis-handling of the viewports, but I can't quite see it. Any hints much appreciated! Bryan ***** Bryan H

Re: [R] Ordination plot option missing from PCA dialog

2010-10-22 Thread Bryan Hanson
Bill, this may be a long shot, but the error you report is extremely close to what you get on a Mac when trying to load rgl when X11 is missing. Bryan ** Bryan Hanson Professor of Chemistry & Biochemistry DePauw University 602 S. College Avenue Greencastle, IN 46135 PHONE 765

Re: [R] Color individual leaf labels in dendrogram

2010-10-15 Thread Bryan Hanson
Henrik, there is an easily adaptable example in this thread: http://r.789695.n4.nabble.com/coloring-leaves-in-a-hclust-or-dendrogram-plot -tt795496.html#a795497 HTH. Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 10/15/10 9:0

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Bryan Hanson
a different way that selecting the graphic in a viewer and cutting and pasting. Quality is top-notch and the graphic is clickable to be resized (and retains it's quality). HTH. Bryan ********* Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA

Re: [R] Passing data to aov

2010-08-26 Thread Bryan Hanson
it was the default as I felt at some point I would have to change it so I wanted it there as a reminder. Instead, it led me astray... Thanks so much! Bryan (coming to you from the R-Inferno today) On 8/26/10 10:14 AM, "David Winsemius" wrote: > > On Aug 26, 2010, at 8:47 AM, Bryan

[R] Passing data to aov

2010-08-26 Thread Bryan Hanson
one of scoping/environment, but again, this is only an idea. TIA for any assistance. Bryan ***** Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA hypTestScores <- function(mylist, score.matrix, pcs = 1:3, fac = NULL, ...) { score

[R] Gathering different data types for aov etc

2010-08-19 Thread Bryan Hanson
don't think what I have so far will do the interaction, in fact, I suspect it will use only f1 or perhaps f1 + f2, just a hunch. Any suggestions to make this more elegant and robust? I've been reading about model frames etc but don't quite see how to do a simple example suc

[R] Is there a function to interdigitate two columns?

2010-07-25 Thread Bryan Hanson
mmon process, but as I'm not sure what it's called I'm having trouble searching. Thanks as always, Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA __ R-help@r-projec

Re: [R] findInterval and data resolution

2010-07-12 Thread Bryan Hanson
Thanks Duncan... More appended at the bottom... On 7/12/10 5:38 PM, "Duncan Murdoch" wrote: > On 12/07/2010 5:25 PM, Bryan Hanson wrote: >> Hello Wise Ones... >> >> I need a clever way around a problem with findInterval. Consider: >> >> vec1 <-

[R] findInterval and data resolution

2010-07-12 Thread Bryan Hanson
here a more clever way to do this? I'm thinking there might be a function out there that I am not aware of. TIA, Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA

Re: [R] boot with strata: strata argument ignored?

2010-06-26 Thread Bryan Hanson
Thanks Chuck, I understand much better what is going on with your example. But I'm still uncertain why the b2$t array does not have the dimensions of R x no. of strata. Any further insight would be appreciated. Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Bio

[R] boot with strata: strata argument ignored?

2010-06-26 Thread Bryan Hanson
s to make sense (2 levels in the factor, so $t has 2 columns). I either misunderstand the expected behavior or I've missed some punctuation or syntax detail. TIA, Bryan ***** Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA

Re: [R] Building a package using classes

2010-06-05 Thread Bryan Hanson
, Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 6/5/10 10:20 AM, "Sébastien Durand" wrote: > Hello, > > I am looking for an efficient and complete free tutorial to learn how to > properly use,

Re: [R] max number from a list of numbers

2010-05-20 Thread Bryan Hanson
I think you want unlist with recursive = TRUE, see ?unlist. Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 5/20/10 3:29 PM, "Jonathan" wrote: > Hi all, >I'm hoping this question has a s

Re: [R] ggplot2: qplot won't work

2010-05-13 Thread Bryan Hanson
int(P2) etc Bryan ***** Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 5/13/10 1:42 AM, "Ralf B" wrote: > I have a script running in the StatET Eclipse environment that > executes the ggplot2 command qplot in

Re: [R] What is mclust up to? Different clusters found if x and y interchanged

2010-04-20 Thread Bryan Hanson
;- Mclust(tur[,3:2], initialization = list( hcPairs = hc23)) # uses > mod23 initialization > > mod23mod[c("modelName","G")] # same as mod32 > mod32mod[c("modelName","G")] # same as mod23 > > Hope this helps, > > Chris Fraley >

[R] What is mclust up to? Different clusters found if x and y interchanged

2010-04-19 Thread Bryan Hanson
Hello All... I gave a task to my students that involved using mclust to look for clusters in some bivariate data of isotopes vs various mining locations. They discovered something I didn¹t expect; the data (called tur) is appended below. p <- qplot(x = dD, y = dCu65, data = tur, color = mine) pr

Re: [R] Why doesn't vec[-real.number] give an error or warning? Kids do the darndest things!

2010-03-14 Thread Bryan Hanson
work. >   > R is a great learning experience for people and it allows you to experiment > without breaking things.  I still have to write little test cases every so > often to understand how things work, especially if you have NAs in your data > and you are trying to do some equali

[R] Why doesn't vec[-real.number] give an error or warning? Kids do the darndest things!

2010-03-13 Thread Bryan Hanson
behavior be valuable? I can see that it avoids doing floor or as.integer in computations where an index is needed but real numbers are generated for whatever reason, but is that common? Thanks for any insight. Bryan ***** Bryan Hanson Acting Chair Professor of Chemistry & Bioc

Re: [R] graph help

2010-01-30 Thread Bryan Hanson
ght Bryan ***** Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 1/30/10 3:04 PM, "Rob Manley" wrote: > Hello, > > I'm fairly new to R and having trouble displaying my data graphically to a > publisha

[R] ggplot2, building a simple formula interface

2009-12-28 Thread Bryan Hanson
f1 <- rep(c("C", "D", "D", "C"), 25) f2 <- rep(c("A", "B"), 50) mydata <- data.frame(res, f1, f2) df <- simple(~ res + f1, mydata) p <- ggplot(df, aes(f1, res)) + geom_boxplot() plot(p) Thanks, Bryan * Br

Re: [R] rgl keyboard shortcut for translation on Mac?

2009-12-06 Thread Bryan Hanson
M, "Duncan Murdoch" wrote: > Bryan Hanson wrote: >> Hello Everyone. >> >> I¹m on a Mac, using rgl. Thanks to all the developers and maintainers on >> it! >> >> If I drag the mouse, I can rotate the view, if I hold down the option key or >> the

[R] rgl keyboard shortcut for translation on Mac?

2009-12-06 Thread Bryan Hanson
seem to modify anything. So, what I can't find is a key combination that translates the object. From reading various documents about openGL, it seems there might be a toggle somewhere, but I need a hint! Or do I need to install/invoke some additional command? Thanks, Bryan ***** Br

Re: [R] Where are usages like "== 2L" documented?

2009-11-17 Thread Bryan Hanson
explictly an integer for whatever reason? Are there other reasons, for instance, ways it saves lines of code? Bryan ***** Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 11/17/09 4:20 AM, "Patrick Burns&qu

Re: [R] Where are usages like "== 2L" documented?

2009-11-16 Thread Bryan Hanson
at least not in the first few pages. Thanks for the tips. Bryan ***** Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 11/16/09 7:52 PM, "Gabor Grothendieck" wrote: > On Mon, Nov 16, 2009 at 7:25 PM, Duncan Murdo

[R] Where are usages like "== 2L" documented?

2009-11-16 Thread Bryan Hanson
Gurus: I keep seeing other people¹s code that contain ideas like If (x == 2L) X[-1L] X - 1L I have some idea of what¹s going on, but where is the use of concepts like ³2L² documented? Thanks, Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw Univer

Re: [R] plot.window arguments being ignored?

2009-11-08 Thread Bryan Hanson
s automatically resize as necessary. Both lattice and ggplot2 have books and very nice web sites where you can find an example like yours. Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 11/7/09 6:28 PM, "A

Re: [R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-28 Thread Bryan Hanson
ducible example. The problem is actually in your > code, not mine ;) You probably want: y = min(res, na.rm = TRUE) - 0.1 > * diff(range(res, na.rm = TRUE)) > > Hadley > > (drop = TRUE solves a difference problem - it controls whether or not > to remove bins with zero count) &

Re: [R] PDF Corrupted?

2009-10-27 Thread Bryan Hanson
Looks like you need to do dev.off() after the plot to properly close the file. Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 10/27/09 8:42 PM, "rkevinbur...@charter.net" wrote: > I am running R 2

Re: [R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-23 Thread Bryan Hanson
nge(res)), label = paste("n = ", ..count.. , sep = "")), color = "black", size = 4.0, stat = "bin") print(p) } On 10/23/09 1:19 PM, "Bryan Hanson" wrote: > One for the ggplot2 gurus... > > I have a function which

[R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-23 Thread Bryan Hanson
is carried out as the last step. So, any suggestions about why the counts don't appear on my plot? I suppose I can always clean the data first, but it would be much more practical to do that in the background during the preparation of the plot. Thanks as always, Bryan * Bryan

Re: [R] Building an R package on MAC

2009-10-22 Thread Bryan Hanson
Gina, at the terminal, make sure you are in directory Users/apple/Docments/R When you type >R CMD build TEST Sounds like you might be in the TEST directory, not the R directory. The build system looks for a subdirectory with your package name when it starts. Bryan ***** Bryan Han

Re: [R] Subsetting/modifying a symbolic formula

2009-10-21 Thread Bryan Hanson
vars(fo[[3]]), function(x) { fo[[3]] <- as.name(x); fo }) >> one.x > [[1]] > y ~ f1 > > [[2]] > y ~ f2 > > > On Wed, Oct 21, 2009 at 11:29 AM, Bryan Hanson wrote: >> Hello All.. >> >> Please consider the following: >> >> y <- rnorm(20,

[R] Subsetting/modifying a symbolic formula

2009-10-21 Thread Bryan Hanson
rms.formula, ?formula etc all discuss these attributes but as I said, it seems a bit impenetrable. RSiteSearch("symbolic formula") returns too many answers. No doubt I am missing the obvious, as this is my first foray into using formulas in my own functions. TIA, Bryan * Bryan H

Re: [R] General means of matching a color specification to an official R color name

2009-10-13 Thread Bryan Hanson
uot;Barry Rowlingson" wrote: > On Tue, Oct 13, 2009 at 9:43 PM, Bryan Hanson wrote: >> Hello List Dwellers: >> >> I¹ve looked around quite a bit, but don¹t quite see an answer that I >> understand. >> >> I¹m looking for a way to take any kind of color speci

[R] General means of matching a color specification to an official R color name

2009-10-13 Thread Bryan Hanson
search for the n closest matches of hex in df.rgb$hex.code # perhaps hex should be converted into a different color space 1st # eventually would like to display matches side by side w/hex } Thanks as always. Bryan ***** Bryan Hanson Acting Chair Professor of Chemistry & Bi

Re: [R] ggplot2: mapping categorical variable to color aesthetic with faceting

2009-10-06 Thread Bryan Hanson
+ facet_grid(. ~ fac2) >>   jit <- position_jitter(width = 0.1) >>   p <- p + layer(geom = "jitter", position = jit) + >>     scale_colour_manual(values=c("red", "blue")) >>   print(p) >>   } >> >> >> test <-

Re: [R] ggplot2: mapping categorical variable to color aesthetic with faceting

2009-10-06 Thread Bryan Hanson
data.frame(res = rnorm(100), fac1 = as.factor(rep(c("A", "B"), 50)), >fac2 = as.factor(rep(c("lrg", "lrg", "sm", "sm"), 25))) > > compareCats(data = test) > > rem <- runif(5, 1, 100) # randomly remove a few points

  1   2   >