[R] cloning a graphics window

2024-07-31 Thread Kenneth Knoblauch
zcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_4.4.1 tools_4.4.1 ___ Kenneth Knoblauch Inserm U1208 Stem-cell and Brain Research Institute 18 avenue du Doyen Lépine

[R] CIE Diagram with wavelengths tick marks

2023-07-20 Thread Kenneth Knoblauch
# Make sure this dataset works with the cieplot() function # attr(coldat2, "clrsp") <- "CIEXYZ" # colnames(coldat2) <- c("x", "y", "z") # cieplot(coldat2, col="white", main="CIE Test Plot") # Best regards # Til

Re: [R] lines through points in lattice legend

2023-01-28 Thread Kenneth Knoblauch
Thanks.  That works well and it's simple. Ken ___ Kenneth Knoblauch Inserm U1208 Stem-cell and Brain Research Institute 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 https://sbri.fr/public-pr

[R] lines through points in lattice legend

2023-01-28 Thread Kenneth Knoblauch
other attached packages: [1] lattice_0.20-45 loaded via a namespace (and not attached): [1] compiler_4.2.2 grid_4.2.2 Thanks for any enlightenment, in advance. Ken ___ Kenneth Knoblauch Inserm U1208 Stem-cell and Brain Research Institute 18 avenue du Doyen Lépine 69500

[R] Need Help To Solve An Equation In R

2017-05-28 Thread Kenneth Knoblauch
respect to y and there would be an unknown h that I need to find. I need to equate this lhs to p_star value in order to find h. Which function should I use to solve this equation? Please guide me regarding this. Thank you. -- With Regards, Neetu Shah, B.Tech.(CS), 3rd Year, IIIT Vadodara. -- Kenn

Re: [R] meaning of lm( y~., data=mydat ), is it a language feature, is it documented, is it supported?

2016-05-23 Thread Kenneth Knoblauch
s and Informatics > University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 > How about section

Re: [R] Opposite color in R

2015-07-25 Thread ken knoblauch
the results are unlikely to match a given individual's vision. On top of that, decisions made when this norm was specified are such that it deviates from human vision for short wavelengths so that you would be better off using a corrected version like that proposed by Judd in the 1950's or

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

2014-10-23 Thread Ken Knoblauch
f Freedom: 97 Total (i.e. Null); 95 Residual Null Deviance: 134.4 Residual Deviance: 112.3AIC: 118.3 There were 27 warnings (use warnings() to see them) HTH > > Andrew Hoskins > Postdoctoral reasearch fellow > Ecosystem Sciences > CSIRO > > E Andrew.Hoskins c

Re: [R] outer() problem

2014-05-01 Thread Ken Knoblauch
are the lengths of x and y, respectively in your case; > Thanks a lot > > Marc > -- Kenneth 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

Re: [R] Generate Binary Matrix

2014-04-09 Thread ken knoblauch
Doran, Harold 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 vector o

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

2014-01-07 Thread Ken Knoblauch
xyplot(Activity~ Day | Subject) xyplot(Activity ~ Day | Subject, data = Data, subscripts = TRUE, panel = function(x, y, subscripts, ...){ panel.xyplot(x, y) wh <- Data[subscripts, ] panel.abline(v = wh$Day[!is.na(wh$EventA)]) }) -- Kenneth Kn

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

2013-11-07 Thread Ken Knoblauch
or example following the example under help(family)? This is what I did in the psyphy package and I just checked and they all still work under the current version of R. > Thanks a lot, > Roland Deutsch -- Kenneth Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Inte

Re: [R] Select fixed number of elements

2013-10-30 Thread Ken Knoblauch
<- runif(N) x rx <- range(x) br <- seq(rx[1], rx[2], len = 6) sapply(br, function(bx){ x[which.min(abs(x - bx))] }) [1] 0.02910779 0.22708582 0.39239718 0.52419265 0.68940262 0.86889817 > > Regards > Alex -- Kenneth Knoblauch Inserm U846 Stem-cell and Brain

Re: [R] colour code areas of a plot

2013-10-22 Thread Ken Knoblauch
t can be vectors as can be the col argument. So you might be able to draw all of the regions with a single call to rect. I've done this to create alternating light and dark regions to highlight condition changes. See ?rect, of course. > > thanks for any suggestions! > -- Kenneth

Re: [R] speeding up "sum of squared differences" calculation

2013-10-22 Thread Kenneth Knoblauch
e in error, please notify the sender immediately via +44(0)20 8943 7000 or notify postmas...@lgcgroup.com and delete this message and any copies from your computer and network. LGC Limited. Registered in England 2991879. Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK -- Kenneth

Re: [R] speeding up

2013-10-21 Thread Ken Knoblauch
Ken Knoblauch inserm.fr> writes: > > Bos, Roger 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 ve

Re: [R] speeding up

2013-10-21 Thread Ken Knoblauch
elapsed 2.241 0.009 2.293 system.time(2 * sum(c(dist(X))^2)) user system elapsed 0.038 0.002 0.040 and then there is Rcpp if you want to add some extra grease. -- Kenneth Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neuroscie

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

2013-08-03 Thread Ken Knoblauch
that you could access as list elements. I haven't done this before but env.lst <- lapply(1:5, new.env) seems to work just fine env.lst [[1]] [[2]] [[3]] [[4]] [[5]] > Thanks! > -- Kenneth Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Inte

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

2013-06-12 Thread Ken Knoblauch
On Jun 12, 2013, at 4:36 PM, Ken Knoblauch 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 <- data.frame

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

2013-06-12 Thread Ken Knoblauch
ver. Ken __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Kenneth Knoblauch I

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é

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-05-30 Thread Ken Knoblauch
; Any suggestions would be appreciated. > > John > > ---- > John Fox > Sen. William McMaster Prof. of Social Statistics > Department of Sociology > McMaster University > Hamilton, Ontario, Canada > http://socserv.mcmaster.ca/jfo

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
t 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 Knoblauch

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
representation. -- Kenneth 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] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
ne) as the CIE coordinates provide no information on color appearance, per se. They specify what lights look alike, not what they look like. -- Kenneth Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France

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

2013-01-29 Thread Ken Knoblauch
; method fails when called > > normally, but works if I explicitly use -1 in the formula. I could hack > > the result of model.matrix(), > > but maybe there's an easier way? Have a look at the polr function in MASS where this same problem is handled, I think, around lines 1

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

2012-11-18 Thread Ken Knoblauch
14.3 Hmisc_3.10-1 R2HTML_2.2 svMisc_0.9-65 TinnR_1.0-5tools_2.15.2 -- Bert On Sun, Nov 18, 2012 at 8:09 AM, Ken Knoblauch wrote: Tom Roche pobox.com> writes: As described @ <<< clipped >>> However I will need to before-and-after compare this to the r

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

2012-11-18 Thread Ken Knoblauch
lattice with the _value_ of the level (an > atmospheric pressure), rather than the name or index of the level. > How to do that? > > TIA, Tom Roche pobox.com> maybe, see ?strip.custom in lattice -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integ

Re: [R] history and readline, Mac OSX

2012-10-17 Thread Ken Knoblauch
vice? Try looking at http://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

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

2012-09-28 Thread Ken Knoblauch
Jessica da Silva 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 fit the regression

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

2012-08-14 Thread ken knoblauch
this. It was designed to fit gamma functions to the luminance vs frame buffer values measured on CRT screens. But the functional form is similar. > thx > Christof > > best, Ken -- Kenneth Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neuro

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

2012-08-07 Thread Ken Knoblauch
We announce the release of package MPDiR version 0.1-11 which contains data sets and functions to support the forthcoming book "Modeling Psychophysical Data in R" by K. Knoblauch and L. T. Maloney, Use R! Vol 32, Springer (expected publication date: September 2012). The package includ

Re: [R] Seeking help with LOGIT model

2012-04-12 Thread Ken Knoblauch
rstand 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 wrote: Christofer Bogaso gmail.com> writes: Dear all, I am fitting a LOGIT model on this Data...

Re: [R] Seeking help with LOGIT model

2012-04-12 Thread ken knoblauch
Christofer Bogaso 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) Data[, -

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

2012-04-05 Thread ken knoblauch
ken knoblauch inserm.fr> writes: > > Michael Bach 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 vec

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

2012-04-05 Thread ken knoblauch
example: > v <- c(1, 2, 3, 4) > 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

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

2012-03-01 Thread ken knoblauch
t; Is there any way to tell glm() to add 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, > &g

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

2012-02-02 Thread ken knoblauch
How can I do then? > > What I know is only for 2 vectors via "intersect" function, but don't know how to deal with multiple vectors. > Reduce(intersect, list(v1 = c("a","b","c","d"), v2 = c("a","b&quo

Re: [R] clear plot linear mixed model

2012-01-05 Thread ken knoblauch
Christof Kluß email.uni-kiel.de> writes: > Am 02-01-2012 10:54, schrieb ken knoblauch: > > Christof Kluß email.uni-kiel.de> writes: > >> lme<- lme(conc ~ name/time - 1, > >> random=conc~time|nr,method="ML",data=measurements) > > see pl

Re: [R] clear plot linear mixed model

2012-01-02 Thread ken knoblauch
me) and > seperate colors 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

Re: [R] palettes for the color-blind

2011-11-03 Thread Ken Knoblauch
ibm.com/dx/proceedings/ pravda/truevis.htm who was (is) quite concerned with this issue, as well, as the excellent article by Zeileis, Hornik and Murrell http://statmath.wu.ac.at/~zeileis/papers/ Zeileis+Hornik+Murrell-2009.pdf HTH, Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research

Re: [R] Plotting a polygon with xyplot

2011-10-04 Thread Ken Knoblauch
ot;http://r.789695.n4.nabble.com/file/n3870788/111004_Lode_Outlines.csv";, header = TRUE,sep = ",",) par(mfrow = c(1, 2), pty = "s") plot(z ~ y, Data_poly, type = "l") fh <- with(Data_poly, which(z > 240)) D_poly <- rbind(Data_poly[fh, ], Data_poly[-rev(fh), ]) D_

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

2011-02-18 Thread Ken Knoblauch
you describe, the subjects are nested in this, i.e., some had a high effort of 5 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

Re: [R] reading a matlab file

2011-02-18 Thread Ken Knoblauch
in the documentation of the R.matlab 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 34 61 portable: +33 (0)6 84 10 64 10 http:

Re: [R] sensitivity logical operators in R

2011-01-23 Thread Ken Knoblauch
ou all! This list is pleasure!!! > > Marc > But, try all.equal(tt, t) [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

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

2011-01-06 Thread Ken Knoblauch
> How can I do that? > > I would 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 a

Re: [R] Still confused with lapply

2010-11-19 Thread Ken Knoblauch
eturn(c(v,w)) > } > > # The following for loop works > result<-data.frame() > for (i in 1:length(df1[,1])) { > result<-rbind(result,fcttest(df1[i,1],df1[i,2],df1[i,3])) why bother with lapply when you can just do this with(df1, cbind(df1[[1]] * df1[[2]], df1[[2]] + df1[[3]

Re: [R] Several Lattice plots in one Plot

2010-09-30 Thread Ken Knoblauch
s to do this but how about DTA <- cbind(day = dta$day, stack(dta[, -1])) xyplot(values ~ day | ind, DTA, type = "b", 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?

Re: [R] R package to identify model

2010-09-07 Thread Ken Knoblauch
Peng, C 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
n verify for yourself that a factor yields FALSE here x <- db1[[1]] is.vector(x) [1] 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 o

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

2010-03-14 Thread Ken Knoblauch
> 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 and Brain Research Institute Department of Integrative Neuroscien

Re: [R] lty dots pdf issue

2010-02-19 Thread Ken Knoblauch
Roger Koenker 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
lass(x)=c('c1','c2') > test(x) It works fine for me if you add a default method, which I think is what it is looking for. test.default <- function(x){ cat("default") x } test(x) c1 c2 default[1] 1 attr(,"class") [1] "c1" "c2" --

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

2010-02-11 Thread Ken Knoblauch
ame output which looks ok. Just for the record... Z R> sessionInfo() R version 2.10.1 (2009-12-14) i486-pc-linux-gnu locale: [1] C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] fortunes_1.3-7 On Thu, 11 Feb 2010

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

2010-02-11 Thread Ken Knoblauch
ld the same output which looks ok. Just for the record... Z R> sessionInfo() R version 2.10.1 (2009-12-14) i486-pc-linux-gnu locale: [1] C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] fortunes_1.3-7 On Thu, 11 Feb

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

2010-02-08 Thread Ken Knoblauch
Hadley Wickham 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
and in R, it is some uncalibrated combination of frame buffer values that is being 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)

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

2010-01-27 Thread Ken Knoblauch
st^ex/(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.0

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

2010-01-27 Thread Ken Knoblauch
onInfo() R version 2.10.1 Patched (2010-01-25 r51051) 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 Thanks, in advance, for any help. Ken -- Ken Knoblauch Ins

Re: [R] Problem with expand.grid

2009-12-22 Thread Ken Knoblauch
3 823 933 or just vectors expand.grid(1:3, 1:3) Var1 Var2 111 221 331 412 522 632 713 823 933 -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18

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

2009-12-18 Thread Ken Knoblauch
.frame") so that they would still inherit 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 Bro

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

2009-11-30 Thread Ken Knoblauch
ons/R.app 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 Inser

Re: [R] design matrix construction question

2009-11-02 Thread Ken Knoblauch
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

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

2009-09-30 Thread Ken Knoblauch
aking, the dichromat package is of great value in avoiding color choices that about 1% 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 Fran

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

2009-09-14 Thread Ken Knoblauch
of a function 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 d

[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
default hypothesis when fitting with lm. Also, the default 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

Re: [R] Question regarding package submission to CRAN

2009-07-16 Thread Ken Knoblauch
that the responsible person is on vacation... -- 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.

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

2009-06-19 Thread Ken Knoblauch
Ben Bolker 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} > >> > <>= > >> > op <- options(width = 65, digits = 3) > >> > ddata

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

2009-06-18 Thread Ken Knoblauch
Ben Bolker 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 lon

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

2009-06-16 Thread Ken Knoblauch
in advance, for any suggestions. 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

Re: [R] Splicing factors without losing levels

2009-06-09 Thread Ken Knoblauch
lx <- levels(x) ly <- levels(y) lxy <- union(lx, ly) xy <- cbind(levels(x)[x], levels(y)[y]) xy <- t(xy) dim(xy) <- NULL xy <- factor(xy, levels = lxy) xy } > splice.factor(factor(1:3), factor(4:6)) [1] 1 4 2 5

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

2009-03-10 Thread Ken Knoblauch
Doran, Harold 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

[R] length 1 offset in glm

2009-02-23 Thread Kenneth Knoblauch
hics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.8.1 Thanks for any enlightenment. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Br

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

2009-02-23 Thread Kenneth Knoblauch
It's easier to read. Better machine-human interaction. ergonomic: (esp. of workplace design) intended to provide optimum comfort and to avoid stress or injury. Quoting Wacek Kusnierczyk : Ken Knoblauch wrote: Wacek Kusnierczyk idi.ntnu.no> writes: Thomas Lumley wrote:

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

2009-02-23 Thread Ken Knoblauch
eave spaces around the = than it would be for <-. > > the reason being ...? > > vQ > 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:

Re: [R] Matrix package: band matrix

2009-02-20 Thread Ken Knoblauch
8224 . [4,] . . -1.007848357 -0.1117796 -0.834 [5,] . . . -0.6816979 -0.6052127 Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France te

Re: [R] parsing problem

2009-02-02 Thread Ken Knoblauch
Ken Knoblauch inserm.fr> writes: > > venkata kirankumar gmail.com> writes: > > I am trying to parse a vector for caliculating minimum in that vector the > > vector having values like > > > > 1Kontrolle > > 2 Placebo > >

Re: [R] parsing problem

2009-02-02 Thread Ken Knoblauch
olle is being treated as a factor so you are seeing only the codes of the levels. There is probably something more elegant, but you need something like, as.numeric(sapply(with(dd, strsplit(levels(Placebo)[Placebo], "m")), "[[", 1)) -- Ken Knoblauch Inserm U846 Institut Cellul

Re: [R] R for Computational Neuroscience?

2009-01-25 Thread Ken Knoblauch
nnectivity in neural systems. There are also packages for analysing 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

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

2009-01-23 Thread Ken Knoblauch
te a user-specified link and the source 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 por

Re: [R] Predictions with GAM

2009-01-16 Thread Ken Knoblauch
Ken Knoblauch inserm.fr> writes: > Robbert Langenberg gmail.com> writes: > > I am trying to get a prediction of my GAM on a response type. So that I > > eventually get plots with the correct values on my ylab. > > The problem I am encountering now is that I cannot seem

Re: [R] Predictions with GAM

2009-01-16 Thread Ken Knoblauch
and the by term, something like model.matrix(~ day:mapID - 1, data = mergeday) 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

Re: [R] boxplot via plot command

2008-12-02 Thread Ken Knoblauch
abel1",100), rep("label2",50), rep("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 a

Re: [R] boxplot via plot command

2008-12-02 Thread Ken Knoblauch
Hi, Antje 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), rep("lab

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

2008-11-09 Thread Ken Knoblauch
might try the link mafc.logit(m = 2) defined in the psyphy package. Continuing with your example, library(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 = &q

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

2008-10-23 Thread Ken Knoblauch
Ken Knoblauch inserm.fr> writes: > > Susana Zuloaga 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 > > iden

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

2008-10-23 Thread Ken Knoblauch
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 Neuros

[R] puzzle about contrasts

2008-09-09 Thread Kenneth Knoblauch
odel.matrix to be correct for this to work out correctly? Thank you. 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

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

2008-09-04 Thread Ken Knoblauch
Andrew Barr 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 12 mon

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

2008-08-02 Thread Ken Knoblauch
Anh Tran 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 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 -- K

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

2008-07-09 Thread Ken Knoblauch
mple, my own psyphy 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

Re: [R] expand.grid() function

2008-06-23 Thread Ken Knoblauch
Megh Dal 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 > 5

Re: [R] grouping values

2008-06-23 Thread Ken Knoblauch
Ken Knoblauch inserm.fr> writes: > Daren Tan 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 > 2l

Re: [R] grouping values

2008-06-23 Thread Ken Knoblauch
t;[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 7ul

Re: [R] Conditional ploting with logical vector

2008-04-05 Thread ken knoblauch
Armin Goralczyk 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, 1:10

Re: [R] help with R semantics

2008-04-03 Thread Ken Knoblauch
Hi, Charles Annis, P.E. 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 and

Re: [R] Importing an Excel spreadsheet

2008-03-20 Thread ken knoblauch
andy 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

  1   2   >