similar to: using scan to record user's input

Displaying 20 results from an estimated 2000 matches similar to: "using scan to record user's input"

2007 Mar 17
1
problem with mfg argument of par
I'm having a problem with the mfg option of par. Am I making an error in my usage? Here is a simple example that I thought would plot to the 4 corners of a 2x2 plot but doesn't plot to the lower right and plots twice on the upper left. par(mfrow = c(2, 2)) pos <- as.matrix(expand.grid(1:2, 1:2)) for (ix in 4:1) { par(mfg = pos[ix, ]) plot(1:5) } Thank you in advance. R version
2007 May 30
2
runif with weights
Dear all, I would like to generate 25 numbers from 1 to 100 but I would like to have some numbers that could be more probable to come out. I was thinking of the function runif: runif(25, 1, 100) , but I don?t know how to give more weight to some numbers. Example: each number from 2 to 10 has the probability of 40% to come out but the probability of each number from 11 to 100 to come out is
2008 Oct 16
1
packages in Depends field and NAMESPACES
Must packages in the Depends field of the DESCRIPTION file have NAMESPACES? I haven't seen this explicitly indicated anywhere. I am writing a small package and find that when I add the abind package to the list of the Depends field, I get an error in R CMD check of the build. * checking package name space information ... OK * checking package dependencies ... ERROR Packages required but not
2007 May 29
0
new packages psyphy and MLDS
New packages psyphy and MLDS are available on CRAN: psyphy ncludes an assortment of functions useful in analyzing data from pyschophysical experiments. It includes functions for calculating d' from several different experimental designs, links for mafc to be used with the binomial family in glm (and possibly other contexts) and selfStart functions for estimating gamma values
2007 May 29
0
new packages psyphy and MLDS
New packages psyphy and MLDS are available on CRAN: psyphy ncludes an assortment of functions useful in analyzing data from pyschophysical experiments. It includes functions for calculating d' from several different experimental designs, links for mafc to be used with the binomial family in glm (and possibly other contexts) and selfStart functions for estimating gamma values
2008 Sep 09
1
puzzle about contrasts
Hi, I'm trying to redefine the contrasts for a linear model. With a 2 level factor, x, with levels A and B, a two level factor outputs A and B - A from an lm fit, say lm(y ~ x). I would like to set the contrasts so that the coefficients output are -0.5 (A + B) and B - A, but I can't get the sign correct for the first coefficient (Intercept). Here is a toy example, set.seed(12161952) y
2007 Sep 03
3
plotting predicted curves with log scale in lattice
Hi, I was taken off guard by the following behavior in a lattice plot. I frequently want to add a predicted curve defined at more points than in the formula expression of xyplot. There have been numerous examples of how to do this on r-help, but I still often struggle to make this work. I just realized that specifying one of the axes on a log scale does not guarantee that the added data for a
2007 Jun 11
3
if statement
Hi all, I have a rather naive question. I have the height of 100 individuals in a table and I want to assign the tallest 30% as Case=1 and the bottom 30% as Case=0. How do I do that? thanks. jiong The email message (and any attachments) is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is
2007 May 21
3
Selecting complementary colours
Dear r-helpers, I wonder whether, given the "#rrggbb" representation of a colour, there is a simple way to select the complementary colour, also expressed as a "#rrggbb" string. Any suggestions would be appreciated. John -------------------------------- John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604
2007 Sep 01
1
Sweave rendering of simple character
Hi, When I compile the construction \begin{Scode}{eval=FALSE} ?HSP \end{Scode} with Sweave and latex, it outputs in the pdf as, > `?` (HSP) which is not incorrect but a bit more formal than I wanted for demonstrating the use of the help shortcut. I would like the output to look like, > ?HSP but I can't seem to make this work. I have also tried the results=verbatim argument.
2007 May 06
7
A function for raising a matrix to a power?
Hi, Is there a function for raising a matrix to a power? For example if you like to compute A%*%A%*%A, is there an abbreviation similar to A^3? Atte Tenkanen > A=rbind(c(1,1),c(-1,-2)) > A [,1] [,2] [1,] 1 1 [2,] -1 -2 > A^3 [,1] [,2] [1,] 1 1 [2,] -1 -8 But: > A%*%A%*%A [,1] [,2] [1,] 1 2 [2,] -2 -5
2006 Nov 18
1
deriv when one term is indexed
Hi, I'm fitting a standard nonlinear model to the luminances measured from the red, green and blue guns of a TV display, using nls. The call is: dd.nls <- nls(Lum ~ Blev + beta[Gun] * GL^gamm, data = dd, start = st) where st was initally estimated using optim() st $Blev [1] -0.06551802 $beta [1] 1.509686e-05 4.555250e-05 7.322720e-06 $gamm [1] 2.511870 This works fine but I
2007 Feb 11
2
Suppresing default text in pairs.lmList() in package = nlme
I would like to suppress the text 'Scatter Plot Matrix' that appears under the plot. Could someone please suggest how? _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 Parcels: Room 102 Gilmer Hall McCormick Road Charlottesville, VA 22903 Office: B011
2008 Jun 23
2
grouping values
I tried aggregate, apply etc, but can't get the right result. For example, m <- cbind(c(LETTERS[1:5]), c("aa", "bb", "cc", "aa", "cc")) [,1] [,2][1,] "A" "aa"[2,] "B" "bb"[3,] "C" "cc"[4,] "D" "aa"[5,] "E" "cc" how to obtain
2008 Oct 23
1
Fw: It 's correct to do contrasts for a GLM?
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 know that the contrasts are used in ANOVA, 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
2008 Jul 15
5
counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"
Any better solution than this ? sum(strsplit("TCGGGGGACAATCGGTAACCCGTCT", "")[[1]] == "G") _________________________________________________________________ [[alternative HTML version deleted]]
2009 Jan 23
4
glm binomial loglog (NOT cloglog) link
I would like to do an R glm() with family = binomial(link="loglog") Right now, the cloglog link exists, which is nice when the data have a heavy tail to the left. I have the opposite case and the loglog link is what I need. Can someone suggest how to add the loglog link onto glm()? It would be lovely to have it there by default, and it certainly makes sense to have the two opposite
2009 Feb 02
2
parsing problem
Hi all, I am trying to parse a vector for caliculating minimum in that vector the vector having values like 1 Kontrolle 2 Placebo 3 125mg/kg 4 250mg/kg 5 500mg/kg 6 1000mg/kg hear i tries for comverting it into numeric with using "as.numaric()" function but i got values like 5 6 2 3 4 1 it gives 1000mg/kg is the least one but i have
2008 Dec 02
3
boxplot via plot command
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("label2",50), rep("label3",150)) df <- data.frame(as.factor(l), x) plot(df) Thank you! Antje
2009 Jan 23
2
R for Computational Neuroscience?
Hi all, I've noticed that many computational neuroscience research groups use MATLAB. While it's possible that MATLAB may have some features unavailable in R, I suspect that this may instead simply be a case of costly tradition, where researchers were taught MATLAB as students and pay for it as researchers because it's all they know. I'd like to attempt to break the cycle by