Re: [R] Opposite color in R

2015-07-26 Thread ken knoblauch
peter dalgaard pdalgd at gmail.com writes: On 25 Jul 2015, at 21:49 , Atte Tenkanen attenka at utu.fi wrote: Hi, I have tried to find a way to find opposite or complementary colors in R. I would like to form a color circle with R like this one: http://nobetty.net/dandls/

Re: [R] Help with GLM starting values in user defined link function

2014-10-23 Thread Ken Knoblauch
Andrew.Hoskins at csiro.au writes: I'm trying to fit a binomial GLM with user defined link function (negative exponential), however I seem to be unable to find the correct starting values to initialise such a model. I've tried taking starting values from a logistic and log models fit to the

Re: [R] outer() problem

2014-05-01 Thread Ken Knoblauch
Marc Girondot marc_grt at yahoo.fr writes: outer(0:1, 0:1, FUN=function(x, y) {1}) Erreur dans outer(0:1, 0:1, FUN = function(x, y) { : dims [produit 4] ne correspond pas à la longueur de l'objet [1] Because whatever the dimensions of your 2 input vectors, this function simply returns the

Re: [R] Generate Binary Matrix

2014-04-09 Thread ken knoblauch
Doran, Harold HDoran at air.org writes: I am trying to generate a binary matrix where row in the matrix is guaranteed to have at least one 1. Ideally, I would like most rowSums to be equal 2 or 3 with some 1s and some 4s. But, rowSums cannot be equal to 0. I can tinker with the

Re: [R] How do I perform conditional annotation of lattice panel plots?

2014-01-07 Thread Ken Knoblauch
Chen, George George.Chen at roswellpark.org writes: My apologies for asking this question that may have been asked before. I am trying to plot activity dependent on time conditioned by the subject. Code for sample data below. So I have something like this xyplot(Activity~Time|Subject). This

Re: [R] Adding the complementary log-link to binomial() and make.link()

2013-11-07 Thread Ken Knoblauch
Roland Deutsch roland.deutsch at tuwien.ac.at writes: in my research I frequently work with binomial response models, which are of course part of the generalized linear models. While I do use common link functions such as the logit, probit and cloglog, I often have the need of invoking

Re: [R] Select fixed number of elements

2013-10-30 Thread Ken Knoblauch
Alaios alaios at yahoo.com writes: I have in my code some vectors that are not of equal size. I would like to be able for each of these vectors select 6 elements that are (almost) equally spaced. So the first one would be at (or close) to the beginning the last one at (or close) to the end

Re: [R] colour code areas of a plot

2013-10-22 Thread Ken Knoblauch
Martin Batholdy batholdy at googlemail.com writes: I would like to colour different areas of a plot. But I don't know how to do this efficiently. here an example: (t = time) t - 1:100 bg_colors - c(rep('green',20), rep('yellow',10), rep('green',20), rep('red',5), rep('yellow',45))

Re: [R] speeding up

2013-10-21 Thread Ken Knoblauch
Bos, Roger roger.bos at rothschild.com writes: I am using a sum of squared differences in the objective function of an optimization problem I am doing and I have managed to speed it up using the outer function versus the nested for loops, but my suspicion is that the calculation could be

Re: [R] speeding up

2013-10-21 Thread Ken Knoblauch
Ken Knoblauch ken.knoblauch at inserm.fr writes: Bos, Roger roger.bos at rothschild.com writes: I am using a sum of squared differences in the objective function of an optimization problem I am doing and I have managed to speed it up using the outer function versus the nested

Re: [R] import function without overwriting function with the same name

2013-08-03 Thread Ken Knoblauch
Martin Batholdy batholdy at googlemail.com writes: I have to import multiple R-files. Each file consists of several functions with the same function name across the R-files. When I import all files one by one (with source()) I overwrite the function definition of the previous file until only

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

2013-06-12 Thread Ken Knoblauch
You seem to treating the input values as xyY when they should be XYZ (case matters). So, I would do something 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]

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

2013-06-12 Thread Ken Knoblauch
developing. Bryan On Jun 12, 2013, at 4:36 PM, Ken Knoblauch ken.knobla...@inserm.fr wrote: You seem to treating the input values as xyY when they should be XYZ (case matters). So, I would do something like this D65 - c(0.3127, 0.329, 0.3583) X - 100 * D65[1] Y - 100 * D65[2] Z - 100 * D65[3] XYZ

Re: [R] measuring distances between colours?

2013-06-01 Thread Ken Knoblauch
Hi John, Out of curiosity and if it is not much trouble, I would be curious if Luv worked any better than Lab. I think that Luv is supposed to be preferred for monitors and Lab for surfaces but they are generally pretty similar. Best, Ken Sent from my iPhone ___ Ken Knoblauch Inserm U846

Re: [R] measuring distances between colours?

2013-06-01 Thread Ken Knoblauch
I'd have to look it up and I'm not home at the moment. Can see later on. I would have thought that it would be normalized to have a jnd equal to 1 but I'm not sure. Ken Sent from my iPhone ___ Ken Knoblauch Inserm U846 Stem-Cell and Brain Research Institute 18 av du Doyen Lépine 69500 Bron

Re: [R] measuring distances between colours?

2013-05-30 Thread Ken Knoblauch
John Fox jfox at mcmaster.ca writes: I'm interested in locating the named colour that's closest to an arbitrary RGB colour. The best that I've been able to come up is the following, which uses HSV colours for the comparison: r2c - function(){ hexnumerals - 0:15 names(hexnumerals)

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
ishi soichi soichi777 at gmail.com writes: Has anyone plotted or is it possible to plot CIE *xy* chromaticity diagram http://en.wikipedia.org/wiki/File:CIE1931xy_blank.svg I need this plot in color. ishida I think that plotting the spectral locus and the line of purples is trivial,

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
ishi soichi soichi777 at gmail.com writes: Has anyone plotted or is it possible to plot CIE *xy* chromaticity diagram http://en.wikipedia.org/wiki/File:CIE1931xy_blank.svg I need this plot in color. ishida sermon And following up on my previous mail (diatribe), after having

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
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. Bryan On Mar 18, 2013, at 7:08 AM, Ken

Re: [R] how to suppress the intercept in an lm()-like formula method?

2013-01-29 Thread Ken Knoblauch
Michael Friendly friendly at yorku.ca writes: To partly answer my own question: It wasn't that hard to hack the result of model.matrix() to remove the intercept, remove.intercept - function(x) { if (colnames(x)[1] == (Intercept)) { x - x[,-1] attr(x,

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Ken Knoblauch
(an atmospheric pressure), rather than the name or index of the level. How to do that? TIA, Tom Roche Tom_Roche at pobox.com maybe, see ?strip.custom in lattice -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Ken Knoblauch
On Sun, Nov 18, 2012 at 8:09 AM, Ken Knoblauch ken.knobla...@inserm.fr wrote: Tom Roche Tom_Roche at pobox.com writes: As described @ clipped However I will need to before-and-after compare this to the results of a reboxing, or 3D regridding, of this data, so I would prefer

Re: [R] history and readline, Mac OSX

2012-10-17 Thread Ken Knoblauch
://R.research.att.com/libs/ TIA -- Christian -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr

Re: [R] blank plot----how do I make symbols appear

2012-09-28 Thread Ken Knoblauch
Jessica da Silva jessica.m.dasilva at gmail.com writes: I am trying to create a scatterplot, coding each point to one of 5 populations. I was successful when I did this for one set of data, yet when I try plotting other data a blank plot appears (although the axes are labelled and I can

Re: [R] self-starter functions for y = a + b * c^x

2012-08-14 Thread ken knoblauch
Christof Kluß ckluss at email.uni-kiel.de writes: But now I search a self-starter for y = a + b * c^x Do you know a package that implement such self-starter or is there a easy way to do it myself? You might be able to adapt the SS.calib function from the psyphy package for this. It was

[R] [R-pkgs] new package MPDiR version 0.1-11

2012-08-07 Thread Ken Knoblauch
data sets from published psychophysical experiments using detection and rating scale measures for estimating signal detection parameters, psychometric functions, classification images, etc. Best, Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative

Re: [R] Seeking help with LOGIT model

2012-04-12 Thread ken knoblauch
Christofer Bogaso bogaso.christofer at gmail.com writes: Dear all, I am fitting a LOGIT model on this Data... snip --- glm(Data[,1] ~ Data[,-1], binomial(link = logit)) Call: glm(formula = Data[, 1] ~ Data[, -1], family = binomial(link = logit)) Coefficients: (Intercept)

Re: [R] Seeking help with LOGIT model

2012-04-12 Thread Ken Knoblauch
!) However could not understand what you mean by You seem to be getting complete separation on X5 ? Can you please be more elaborate? Thanks, On Thu, Apr 12, 2012 at 4:06 PM, ken knoblauch ken.knobla...@inserm.fr wrote: Christofer Bogaso bogaso.christofer at gmail.com writes: Dear all, I am fitting

Re: [R] Apply function to every 'nth' element of a vector

2012-04-05 Thread ken knoblauch
) mysquare - function (x) { return (x*x) } w - applyfun(v, mysquare, 2) then w should be c(1, 4, 3, 16) Michael Bach Hi Michael, v^(2 - seq_along(v) %% 2) [1] 1 4 3 16 Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du

Re: [R] Apply function to every 'nth' element of a vector

2012-04-05 Thread ken knoblauch
ken knoblauch ken.knoblauch at inserm.fr writes: Michael Bach phaebz at gmail.com writes: how do I e.g. square each second element of a vector with an even number of elements? Or more generally to apply a function to every 'nth' element of a vector. I looked into the apply

Re: [R] User defined link function with extra parameters

2012-03-01 Thread ken knoblauch
this parameter in the estimation or do I have to write my own estimator with optim()? If the parameter cannot be made into a coefficient of the linear predictor, then I'm afraid that you will have to roll your own. Thanks, BP -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute

Re: [R] How to get intersection of multiple vectors?

2012-02-02 Thread ken knoblauch
(a,b,c,d), v2 = c(a,b,e), v3 = c(a,f,g))) Many thanks -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable

Re: [R] clear plot linear mixed model

2012-01-05 Thread ken knoblauch
Christof Kluß ckluss at email.uni-kiel.de writes: Am 02-01-2012 10:54, schrieb ken knoblauch: Christof Klußcklussat email.uni-kiel.de writes: lme- lme(conc ~ name/time - 1, random=conc~time|nr,method=ML,data=measurements) see plot.augPred in the nlme package thx, but how to set primary

Re: [R] clear plot linear mixed model

2012-01-02 Thread ken knoblauch
for the measurements (nr). How would you do that? thx Christof see plot.augPred in the nlme package -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91

Re: [R] palettes for the color-blind

2011-11-03 Thread Ken Knoblauch
://statmath.wu.ac.at/~zeileis/papers/ Zeileis+Hornik+Murrell-2009.pdf HTH, Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10

Re: [R] Plotting a polygon with xyplot

2011-10-04 Thread Ken Knoblauch
- with(Data_poly, which(z 240)) D_poly - rbind(Data_poly[fh, ], Data_poly[-rev(fh), ]) D_poly - rbind(D_poly, Data_poly[1, ]) plot(z ~ y, D_poly, type = n) with(D_poly, polygon(y, z, col = lightblue)) -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences

Re: [R] reading a matlab file

2011-02-18 Thread Ken Knoblauch
. -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members/kenneth-knoblauch.html

Re: [R] how to incorporate prior base probabilities into binomial glmm

2011-02-18 Thread Ken Knoblauch
and others of 3. Perhaps, the following would work then glmer(y ~ EffortLevel/(effort + costs + scr) + (1 | id), family = binomial) I think that if each observer has a unique id, that the nesting will be automatic for this variable, but you should verify that. -- Ken Knoblauch Inserm U846 Stem-cell

Re: [R] sensitivity logical operators in R

2011-01-23 Thread Ken Knoblauch
) [1] TRUE and see the R FAQ 7.31 -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members

Re: [R] Deselect one of the array's matrix

2011-01-06 Thread Ken Knoblauch
like to thank you in advance for your help Best Regards Alex [[alternative HTML version deleted]] Read section 2.7 of An Introduction to R that comes with the distribution. -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative

Re: [R] Still confused with lapply

2010-11-19 Thread Ken Knoblauch
],df1[i,3])) why bother with lapply when you can just do this with(df1, cbind(df1[[1]] * df1[[2]], df1[[2]] + df1[[3]])) HTH Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4

Re: [R] Several Lattice plots in one Plot

2010-09-30 Thread Ken Knoblauch
, layout = c(2, 6)) for which you can add additional annotations as desired. By the way, do you realize that you have repeated column names in your data frame? HTH, Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du

Re: [R] R package to identify model

2010-09-07 Thread Ken Knoblauch
Peng, C cpeng.usm at gmail.com writes: what is ESP package? Thanks. I've heard that It's only available over from a repository accessible through a next-generation wifi system call oui-ja. (Beware humor travels poorly over the internet and across linguistic differences!).

Re: [R] Stack with factors

2010-04-01 Thread Ken Knoblauch
] FALSE so I think that this at least explains why it doesn't work as you expected. Thank you for your help. Kenneth -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34

Re: [R] Direction and scaling of cumulative distribution in ecdfplot

2010-03-14 Thread Ken Knoblauch
= function(x, y = NULL, ...){ panel.ecdflt(x, ...) }) Many thanks, Jeff -- Jeff Stevens Research Scientist Center for Adaptive Behavior and Cognition Max Planck Institute for Human Development Lentzealle 94 14195 Berlin, Germany -- Ken Knoblauch Inserm U846 Stem-cell

Re: [R] lty dots pdf issue

2010-02-19 Thread Ken Knoblauch
Roger Koenker rkoenker at uiuc.edu writes: I'm trying to redo an old plot with: sessionInfo() R version 2.11.0 Under development (unstable) (2010-02-09 r51113) x86_64-apple-darwin9.8.0 When I do: pdf(lty.pdf,height = 6, width = 8) u - 1:100/100 y - matrix(rep(1:10,each = 100),100)

Re: [R] NextMethod() example from S Programming by Vena bles and Ripley (page 78)

2010-02-13 Thread Ken Knoblauch
] 1 attr(,class) [1] c1 c2 -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members/kenneth

Re: [R] Sweave, lty = 3 line incorect in pdf output

2010-02-11 Thread Ken Knoblauch
) i386-apple-darwin9.8.0 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base loaded via a namespace (and not attached): [1] tools_2.10.1 Thanks for any help. Ken -- Ken Knoblauch Inserm

Re: [R] Sweave, lty = 3 line incorect in pdf output

2010-02-11 Thread Ken Knoblauch
) i386-apple-darwin9.8.0 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base loaded via a namespace (and not attached): [1] tools_2.10.1 Thanks for any help. Ken -- Ken Knoblauch Inserm

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Ken Knoblauch
Hadley Wickham hadley at rice.edu writes: Hi all, Is there a fast way to determine the number of lines in a file? I'm looking for something like count.lines analogous to count.fields. Hadley How about something like length(readLines(fname)) Ken

Re: [R] color blending and transparency

2010-02-03 Thread Ken Knoblauch
used. Best, baptiste Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members

[R] term.formula error when updating an nls object

2010-01-27 Thread Ken Knoblauch
-darwin9.8.0 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base Thanks, in advance, for any help. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department

Re: [R] term.formula error when updating an nls object

2010-01-27 Thread Ken Knoblauch
/(Contrast^fx + sig^fx)), start = list(Rm = 30, sig = 0.05, ex = 3, fx = 3.1)) -Peter Ehlers Ken Knoblauch wrote: Hi, I'm getting an error that I don't understand when updating an nls object. Here is a toy example. dd - structure(list(Contrast = c(0.00376, 0.03759

Re: [R] Problem with expand.grid

2009-12-22 Thread Ken Knoblauch
933 -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members/kenneth-knoblauch.html

Re: [R] Getting Rd pages right for redefined S3 generic

2009-12-18 Thread Ken Knoblauch
other data frame methods. My rbind.mlds.df works fine with them, and I document it accordingly. HTH. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0

Re: [R] How do I run to or more R consoles on Mac OS X?

2009-11-30 Thread Ken Knoblauch
to open as many copies of the app as you like. Be careful though, because these inherit environment variables from the terminal session, not necessarily the same as those when running the app from the Finder. I was bitten by that the first time I tried this. Ken -- Ken Knoblauch Inserm U846 Stem

Re: [R] design matrix construction question

2009-11-02 Thread Ken Knoblauch
- 1, dd) za:xf zb:xf 1 1 0 2 1 0 3 1 0 4 0 0 5 0 0 6 0 0 7 0 1 8 0 1 attr(,assign) [1] 1 1 attr(,contrasts) attr(,contrasts)$z [1] contr.treatment thanks Ben Bolker -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research

Re: [R] dichromat, regexp, and grid objects

2009-09-30 Thread Ken Knoblauch
% of the population would have trouble discriminating. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr

Re: [R] How to convert numbers to words?

2009-09-14 Thread Ken Knoblauch
that does this? Thanks, Derek McCrae Norton Try Rnews Volume 5/1, May 2005, The Programmer's Niche by John Fox How Do You Spell That Number? -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France

[R] [R-pkgs] new package MLCM: Maximum Likelihood Conjoint Measurement

2009-09-10 Thread Ken Knoblauch
desirability. This package contains tools to estimate the additive contribution of the n scales to the judgment by a maximum likelihood method under several hypotheses of how the perceptual dimensions interact. -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative

Re: [R] Compare lm() to glm(family=poisson)

2009-08-01 Thread Ken Knoblauch
link function with the poisson family is log. So, these are things to take into account in any potential comparison. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34

Re: [R] overshoot of formula line in summary output of Sweave

2009-06-19 Thread Ken Knoblauch
Ben Bolker bolker at ufl.edu writes: Here is a toy example that illustrates the overshoot of the formula \documentclass[12pt]{article} \usepackage{geometry} \geometry{left=2in,right=2in} \begin{document} keep.source=TRUE= op - options(width = 65, digits = 3) ddataframe -

Re: [R] overshoot of formula line in summary output of Sweave

2009-06-18 Thread Ken Knoblauch
Ben Bolker bolker at ufl.edu writes: In the Sweave output for summary for several types of model objects and also for the comparison of models with anova, I find that that the display of the call(s) or formula does not obey the width option, even with keep.source=TRUE set, so that a long

[R] overshoot of formula line in summary output of Sweave

2009-06-16 Thread Ken Knoblauch
-- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members/kenneth-knoblauch.html

Re: [R] Splicing factors without losing levels

2009-06-09 Thread Ken Knoblauch
) xy } splice.factor(factor(1:3), factor(4:6)) [1] 1 4 2 5 3 6 Levels: 1 2 3 4 5 6 -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91

Re: [R] reliability, scale scores in the psych package

2009-03-10 Thread Ken Knoblauch
Doran, Harold HDoran at air.org writes: Ista There are several functions in the MiscPsycho package that can be sued for classical item analysis. Since when is classical item analysis a crime? No wonder the USA is considered such a litigious society! Ken -- Ken Knoblauch Inserm U846

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Ken Knoblauch
ergonomy! -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members/kenneth-knoblauch.html

Re: [R] parsing problem

2009-02-02 Thread Ken Knoblauch
something more elegant, but you need something like, as.numeric(sapply(with(dd, strsplit(levels(Placebo)[Placebo], m)), [[, 1)) -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences Intégratives 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77

Re: [R] parsing problem

2009-02-02 Thread Ken Knoblauch
Ken Knoblauch ken.knoblauch at inserm.fr writes: venkata kirankumar kiran4u2all at gmail.com writes: I am trying to parse a vector for caliculating minimum in that vector the vector having values like 1Kontrolle 2 Placebo 3 125mg/kg 4 250mg/kg

Re: [R] R for Computational Neuroscience?

2009-01-25 Thread Ken Knoblauch
psychophysical data which are relevant for behavioral neuroscience, psyphy, MLDS, sdtalt, etc. Would there be enough for CRAN TASK VIEW? Ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences Intégratives 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72

Re: [R] glm binomial loglog (NOT cloglog) link

2009-01-23 Thread Ken Knoblauch
of the make.link function can be useful to. Ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences Intégratives 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr

Re: [R] Predictions with GAM

2009-01-16 Thread Ken Knoblauch
) in your case. I added the appropriate columns into my data frame and also to the newdata for predict. You can see an example in the appendix of http://www.journalofvision.org/8/16/10/ HTH, Ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences

Re: [R] boxplot via plot command

2008-12-02 Thread Ken Knoblauch
(label3,150)) df - data.frame(as.factor(l), x) plot(df) Just to complete my response, the documentation for plot.data.frame indicates For a two-column data frame it plots the second column against the first by the most appropriate method for the first column. kk -- Ken Knoblauch Inserm U846

Re: [R] boxplot via plot command

2008-12-02 Thread Ken Knoblauch
Hi, Antje niederlein-rstat at yahoo.de writes: Hi folks, I've just discovered that the following code leads to boxplot (surprisingly to me). Can anybody explain to me why? Is this documented somewhere? I've never consider this option before. x - rnorm(300) l - c(rep(label1,100),

Re: [R] Fitting a modified logistic with glm?

2008-11-09 Thread Ken Knoblauch
(psyphy) fit - glm(y ~ x, binomial(mafc.logit(2)), control = glm.control(maxit = 100)) # default didn't converge x.ord - order(x) lines(x[x.ord], fitted(fit)[x.ord], col = red, lwd = 3) HTH, Ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences

Re: [R] Fw: It 's correct to do contrasts for a GLM?

2008-10-23 Thread Ken Knoblauch
, it is not incorrect to use them in GLM? there is a way to do contrasts between treatments for GLM as a Tukey for the ANOVA? Susana see https://stat.ethz.ch/pipermail/r-help/2003-November/041559.html -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences Intégratives 18

Re: [R] Fw: It 's correct to do contrasts for a GLM?

2008-10-23 Thread Ken Knoblauch
Ken Knoblauch ken.knoblauch at inserm.fr writes: Susana Zuloaga szuloaga_aguilar at hotmail.com writes: Hi all I am one recent user of R and have a few doubts I did a binomial GLM with 3 - factor and now I have to test contrasts to identify that treatments are different. I

Re: [R] using complete.cases() with nested factors

2008-09-04 Thread Ken Knoblauch
Andrew Barr wabarr at gmail.com writes: This maybe a newbie question. I have a dataframe that looks like the sample at the bottom of the email. I have monthly precipitation data from several sites over several years. For each site, I need to extract years that have a complete series of

Re: [R] Multiple R console for OS X?

2008-08-02 Thread Ken Knoblauch
Anh Tran anhnttran at ucla.edu writes: I always open more than 1 R console in Windows. I can't figure out a way to do this with OS X yet. I need that to utilize the duo core on my desktop. How would I do that? Have a look here https://stat.ethz.ch/pipermail/r-sig-mac/2008-April/004814.html

Re: [R] counting number of G in TCGGGGGACAATCGGTAACCCGTCT

2008-07-15 Thread Ken Knoblauch
Daren Tan daren76 at hotmail.com writes: Any better solution than this ? sum(strsplit(TCGACAATCGGTAACCCGTCT, )[[1]] == G) Try table(strsplit(TCGACAATCGGTAACCCGTCT, )) A C G T 5 7 8 5 and get all 4 at once. HTH -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau

Re: [R] building experimental paradigm with R as Brainard/Pelli PsychToolbox

2008-07-09 Thread Ken Knoblauch
and MLDS). Ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences Intégratives 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr

Re: [R] grouping values

2008-06-23 Thread Ken Knoblauch
are separated by | [,1] [,2][1,] aa A|D[2,] bb B[3,] cc C|E How about do.call(expand.grid, rep(list(c(u, l)), 3)) Var1 Var2 Var3 1uuu 2luu 3ulu 4llu 5uul 6lul 7ull 8lll -- Ken Knoblauch Inserm U846

Re: [R] grouping values

2008-06-23 Thread Ken Knoblauch
Ken Knoblauch ken.knoblauch at inserm.fr writes: Daren Tan daren76 at hotmail.com writes: I tried aggregate, apply etc, but can't get the right result. do.call(expand.grid, rep(list(c(u, l)), 3)) Var1 Var2 Var3 1uuu 2luu 3ulu 4llu 5u

Re: [R] expand.grid() function

2008-06-23 Thread Ken Knoblauch
Megh Dal megh74 at yahoo.com writes: I have one question on expand.grid() function. When I write following syntax :expand.grid(c(u, l), c(u, l), c(u, l)) I get following as desired : Var1 Var2 Var3 1uuu 2luu 3ulu 4llu 5u

Re: [R] Conditional ploting with logical vector

2008-04-05 Thread ken knoblauch
Armin Goralczyk agoralczyk at gmail.com writes: In a function I have a plot and want to add symbols/text only when indicated by a logical vector (which was generated by the function before, not manually like in the following example): plot(1:10, 1:10) lv - c(T,T,T,F,F,F,T,T,T,F) text(1:10,

Re: [R] help with R semantics

2008-04-03 Thread Ken Knoblauch
Hi, Charles Annis, P.E. Charles.Annis at StatisticalEngineering.com writes: logit.FC - function(POD.floor = 0, POD.ceiling =1) { if (POD.floor 0 | POD.floor 1) stop (POD.floor must be between zero and one.) if (POD.ceiling 0 | POD.ceiling 1) stop (POD.ceiling must be between zero

Re: [R] Importing an Excel spreadsheet

2008-03-20 Thread ken knoblauch
andy geek_show at dsl.pipex.com writes: I am trying to import an *.xls spreadsheet into R. I am doing this as follows: read.table(file(A5_DL.xls)) So I copied it all over to a text document and tried to import that, thus: read.table(A5.txt) The error I got then was: Error in scan(file,

Re: [R] [OT] normal (as in Guassian)

2008-03-02 Thread Ken Knoblauch
Johannes Hüsing johannes at huesing.name writes: Am 02.03.2008 um 17:44 schrieb Gabor Csardi: I'm not a statistician, but do i remember well that among all distributions with a given mean and variance, the normal distribution has the highest entropy? This is good enough for me to call

Re: [R] Loop with variable index

2008-01-30 Thread Ken Knoblauch
Bill.Venables at csiro.au writes: y - sort(rnorm(20)) # say... m - s - numeric(19) for(i in 2:20) { m[i-1] - mean(y[1:i]) s[i-1] - sd(y[1:i]) } -Original Message- On Behalf Of cvandy Subject: [R] Loop with variable index I have a list of 20 values. The first

Re: [R] color palette from red to blue passing white

2007-12-04 Thread Ken Knoblauch
hadley wickham h.wickham at gmail.com writes: pruned For example, I have this alpha function in ggplot: alpha - function(colour, alpha) { col - col2rgb(colour, TRUE) / 255 col[4, ] - rep(alpha, length(colour)) new_col - rgb(col[1,], col[2,], col[3,], col[4,]) new_col[is.na(colour)] -

Re: [R] Packages - a great resource, but hard to find theright one.

2007-11-21 Thread Ken Knoblauch
function and http://cged.genes.nig.ac.jp/RGM2/index.php HTH ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences Intégratives 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http

Re: [R] Plot segments with different colors

2007-11-13 Thread Ken Knoblauch
Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.be writes: the 'col' argument of plot() may also be a vector, e.g., x - sort(rnorm(15)) y - rnorm(15) plot(x, y, col = rep(c(red, blue, magenta), c(5, 6, 4))) Dimitris Dimitris Rizopoulos - Original Message

Re: [R] window (x,y) co-ordinates of datapoints

2007-10-09 Thread Ken Knoblauch
of units online here, as well as other places, http://en.wikipedia.org/wiki/SI_prefix upon seeing which, I wondered (in the spirit of a google) if there was a prefix beyond yotta called lotta? ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences

Re: [R] Sweave and ggplot2

2007-09-25 Thread Ken Knoblauch
Julien Barnier julien at no-log.org writes: Hi, When I try this example at work, I got an error message during Sweave which is close from something like warning : semitransparency not supported by this device. When I try at home (with the given sessionInfo), I got no warning but in both

Re: [R] nls fits by groups

2007-09-23 Thread Ken Knoblauch
Aleksi Lehtonen lehtonen.aleksi at gmail.com writes: I am trying to estimate several non-linear models simultaneously. I don't want to use non-linear mixed model, but non-linear model with same form, but it should be estimated separately according to variable group (I have lots of groups that