FAQ

# R>r-help>November 2005

## 610 discussions - 1,904 posts

• 34

#### [R] question about R code

Dear Sir/Madam, If I have matrics as follows: How can I use R code to solve the equation ax^2+bx+c=0. thanks! yuying shi Yuying ShiNov 5, 2005 at 7:38 pmNov 25, 2005 at 4:23 am
• 29

#### [R] voronoi

Is there any pure r code to do delaunay or voronoi diagrams? Thanks! --------------------------------- RobertNov 13, 2005 at 5:12 amNov 15, 2005 at 2:04 pm
• 16

#### [R] finding peaks in a simple dataset with R

I've been asked in private, (and am replying BCC to the asker), "of course" it is the way to go, don't get lost be going somewhere else :-) and try install.packages("fortune") fortune("go with R") ... Martin MaechlerNov 23, 2005 at 1:35 pmNov 28, 2005 at 2:41 pm
• 12

#### [R] writing R shell scripts?

I'm new to the list. I've used R and S-PLUS a bit for about 15 years but am now working to make R my main program for all numerical and statistical computing. I also use Octave for this kind of work ... Mike MillerNov 8, 2005 at 1:52 amFeb 7, 2006 at 4:44 pm
• 12

#### [R] combine two columns

Hi, I have an R programming problem and I havent found anything in the documentation yet: I have a data matrix, in which two neighbouring columns represent replicates of the same experiment, e.g ... Georg OttoNov 28, 2005 at 5:47 pmNov 30, 2005 at 5:03 pm
• 12

#### [R] help with apply, please

Dear list, I have a problem with a toy example: mtrx <- matrix(c(1,1,0,1,1,1,0,1,1,0,0,1), nrow=3) rownames(ma) <- letters[1:3] I would like to determine which is the minimum combination of rows that ... Adrian DUSANov 19, 2005 at 1:00 pmNov 19, 2005 at 8:09 pm
• 11

#### [R] Method for \$

Dear R experts, I have defined a class "myclass" and would like the slots to be extractable not only by "@" but also by "\$". I now try to write a method for "\$" that simply executes the request ... Ulrike GrömpingNov 18, 2005 at 2:37 pmNov 22, 2005 at 7:08 pm
• 11

#### [R] How to find statistics like that.

Hi there, Suppose mu is constant, and error is normally distributed with mean 0 and fixed variance s. I need to find a statistics that: Y_i = mu + beta1* I1_i beta2*I2_i + beta3*I1_i*I2_i + +error, ... Gao FayNov 9, 2005 at 8:56 pmNov 11, 2005 at 2:26 pm
• 10

#### [R] getting started, reading listing and saving data

Dear List I am new to R and to the list and will try best as I can be clear and concise. My apologies if anything I write contravenes the posting code on this list. I would also like to say I have ... Ronnie BabigumiraNov 23, 2005 at 1:38 amNov 24, 2005 at 6:36 am
• 10

#### [R] attributes of a data.frame

Dear all, I noticed that a data.frame has four attributes: - names - row.names - class - variable.labels While one can use the first three (i.e. names(foo) or class(foo)), the fourth one can only be ... Adrian DUSANov 21, 2005 at 7:18 pmNov 23, 2005 at 5:29 pm
• 10

#### [R] effect sizes for Wilcoxon tests

Hello, I use t.test for normal distributed and wilcox.test for non-normal distributed samples. It is easy to write a function for t.test that calculates the effect size, because all parts of the ... Claus AtzenbeckNov 14, 2005 at 4:01 pmNov 16, 2005 at 12:12 pm
• 10

#### [R] different functions on different vector subsets

Hi, I am trying to apply two different functions on on a vector as follow: a<-c(NA,1,2,3,-3,-4,-6) if a 0 I would like to raise it by the power of 2: 2^a and if the a<0 I would like to have the ... Ron OphirNov 10, 2005 at 3:25 pmNov 11, 2005 at 5:25 pm
• 9

#### [R] Point pattern to grid

Dear all, I'd like to change a point pattern to a grid of cells and use one of the variables as the output. e.g. The point pattern is of a window of (500*500) and several features such as pH, ... Leaf SunNov 17, 2005 at 9:13 pmNov 28, 2005 at 7:43 am
• 9

#### [R] Chi-squared test

Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not: chisq.test(rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, ... Bianca Vieru- DimulescuNov 24, 2005 at 11:13 amNov 25, 2005 at 10:33 am
• 9

#### [R] Element-by-element multiplication operator?

Is there an element-by-element multiplication in R, like the .* operator in Matlab? eg: A (2x3) B (2x3) C=A.*B C (2x3) C = [[a11*b11 a12*b12 a13*b13]; [a21*b21 a22*b22 a23*b23]] I can't find one.. ... Gates, Michael BGI SFNov 9, 2005 at 7:26 pmNov 9, 2005 at 9:20 pm
• 8

#### [R] Solving Systems of Non-linear equations

I am trying to write a function that will solve a simple system of nonlinear equations for the parameters that describe the beta distribution (a,b) given the mean and variance. mean = a/(a+b) ... Scott StoryNov 30, 2005 at 3:14 pmDec 5, 2005 at 3:31 pm
• 8

#### [R] nlme question

I am using the package nlme to fit a simple random effects (variance components model) with 3 parameters: overall mean (fixed effect), between subject variance (random) and within subject variance ... Wassell, James T., Ph.D.Nov 16, 2005 at 4:01 pmNov 21, 2005 at 7:07 pm
• 8

#### [R] force apply() to return a list

Hi I have a function f() that I want to apply() to a matrix. I want the answer to be a list. However, sometimes all the vectors returned by f() are the same length and apply() returns a matrix. I do ... Robin HankinNov 21, 2005 at 8:16 amNov 21, 2005 at 2:29 pm
• 8

#### [R] OLS variables

Dear all, Is there any simple way in R that can I put the all the interactions of the variables in the OLS model? e.g. I have a bunch of variables, x1,x2,.... x20... I expect then to have interaction ... Leaf SunNov 6, 2005 at 8:10 amNov 7, 2005 at 11:35 pm
• 8

On page 22 of the R-introduction guide it's written: the quadratic form x^{'} A^{-1} x which is used in multivariate computations, should be computed by something like x%*%solve(A,x), rather than ... Alvarez PedroNov 3, 2005 at 1:01 pmNov 3, 2005 at 5:27 pm
• 7

#### [R] Fw: Re: Is there anything like a write.fwf() or possibility to print adata.frame without rownames?

write.table( tab, "file.txt", sep="", row.names=F) Can it do what you want? = = = = = = = = = = = = = = = = = = = = 2005-11-21 ------ Deparment of Sociology Fudan University My new mail addres is ... RongguiNov 21, 2005 at 1:03 pmJan 30, 2006 at 7:46 am
• 7

#### [R] What made us so popular Nov 16-20?

Our main US mirror is cran.mirrors.pair.com, AKA cran.us.r-project.org. Pair.com keeps statistics on traffic on the mirror sites, and I got all excited when I looked at this page ... Duncan MurdochNov 28, 2005 at 11:52 pmDec 3, 2005 at 8:59 pm
• 7

#### [R] Games-Howell, Gabriel, Hochberg

Hello, I read a book about statistics in psychology. The authors use SPSS. They talk about post hoc tests after ANOVA finds significant effects: - Gabriel's procedure (for equal or slightly different ... Claus AtzenbeckNov 28, 2005 at 1:57 pmNov 30, 2005 at 4:00 pm
• 7

#### [R] creating a factor from other factors and ifelse

Hi, Given ifelse(!is.na(sec00), sec00, NA )) We get  2 NA 2 1 2 1  "integer" I wonder why sec1 as above defined in not a factor, since it has been created from (logical operations and) ... Dimitri JoeNov 27, 2005 at 12:52 amNov 27, 2005 at 12:26 pm
• 7

#### [R] modifying code in contributed libraries - changes from versions 1.* to 2.*

Having finally updated from R 1.91 to R 2.2.0 with my installation of a new computer, I discovered that something has changed drastically about the way code for contributed packages is stored when ... Brian S CadeNov 22, 2005 at 3:35 pmNov 23, 2005 at 6:29 pm
• 7

How do I go about autoloading R Commander when I start R? Thanks in advance. -- Stephen P. Molnar, Ph.D. Life is a fuzzy set Foundation for Chemistry Stochastic and multivariant ... Stephen P. Molnar, Ph.D.Nov 19, 2005 at 3:35 pmNov 23, 2005 at 2:24 pm
• 7

#### [R] paste argument of a function as a file name

R-help, I have a function which is exporting the output to a file via write.table(df, file = "file name.xls" ) What I want is to paste the file name (above) by taking the argument to the function as ... Luis Ridao CruzNov 10, 2005 at 1:28 pmNov 23, 2005 at 9:26 am
• 7

#### [R] Portable R?

Hello list, A short time ago, I found http://johnhaller.com/jh/useful_stuff/portable_apps_suite/, which contains basically a complete set of office tools that can be run *entirely* from a USB key ... David MitchellNov 17, 2005 at 3:16 amNov 17, 2005 at 8:31 pm
• 7

#### [R] "Warning message: package '...' was built under R version 2.3.0"

Hi, While installing precompiled packages I often get warnings like the one in the subject. I usually ignore them, but I still do not understand why windows packages are build with unreleased ... Tuszynski, Jaroslaw W.Nov 16, 2005 at 4:12 pmNov 17, 2005 at 1:32 pm
• 7

#### [R] readline() and Rterm in Windows

I'm running an R script in Rterm and would like the user to be prompted for input as in: id <- readline("Please enter ID: ") myfunction(id) . . . etc. This works when I run one line at a time in ... Mikkel GrumNov 2, 2005 at 5:03 pmNov 3, 2005 at 1:35 pm
• 6

#### [R] SPSS and R – do they like each other?

Hi, I wonder how well SPSS and R communicate, because I need SPSS but would like to do some data manipulations in R. However I am very afraid of never ending import-export-complications ? especially ... Zorritillito-SecureNov 21, 2005 at 12:14 pmDec 5, 2005 at 12:33 pm
• 6

#### [R] Goodness fit test HELP!

Hi there, I'm a newbie, plesae bear with me. I have a dataset with about 10000 ~ 30000 data points. Would like fit to both Gamma and Normal distribution to see which one fits better. How do I do this ... David ZhaoNov 17, 2005 at 5:44 pmDec 3, 2005 at 9:05 pm
• 6

#### [R] help with R

Hi, New to R on Windows and also someone trying to learn how to use R in batch. My apologies if this posting is a little long but users may better understand the problems I'm having if I explain what ... Ed WangNov 29, 2005 at 5:50 pmDec 1, 2005 at 11:31 pm
• 6

#### [R] Random Effects for One-Way Anova

Hello to All. I'd want to use a one-way ANOVA. This means that I have only one factor, with, lets say, 5 levels. I made a dataframe, called "DATA", with two Columns: A, that is my response, and it is ... Giuseppe PalermoNov 30, 2005 at 10:19 amNov 30, 2005 at 2:10 pm
• 6

#### [R] How define global Variable?

Hello, I try to define a global variable. My example: R a <- "old" R test <- function () { a <- "new" } R test() R a # shoud be "new" This doesn't work. I would like to modify the variable "a" in a ... SvenknueppelNov 28, 2005 at 2:26 pmNov 28, 2005 at 3:24 pm
• 6

#### [R] Generating all possible partitions

Hellp! I would like to generate all possible partitions of length n with k clusters. It should be noted that the labels of the classes are irrelevant. Thanks for any suggestions! Best regards, Ales ... Ales ZibernaNov 25, 2005 at 10:13 amNov 26, 2005 at 8:13 am
• 6

#### [R] cointegration rank

Dear R - helpers, I am using the urca package to estimate cointegration relations, and I would be really grateful if somebody could help me with this questions: After estimating the unrestriced VAR ... Carlo FezziNov 19, 2005 at 2:23 pmNov 22, 2005 at 1:28 pm
• 6

#### [R] PNG-import into R

Hi there I'm looking for a function to read PNG-bitmap-images from a file into R. I only found: - the pixmap-package which cannot import png or similar formats - the rimage-package which can only ... Sydler, DominikNov 21, 2005 at 10:36 amNov 21, 2005 at 8:53 pm
• 6

#### [R] How to run R in batch mode

Hello to everybody! I want to run R in batch mode but it doen't work (Error: syntax error) I've found this in R help: R CMD BATCH [options] infile [outfile] I have tried differents commands: (I have ... BeatrizNov 18, 2005 at 3:20 pmNov 21, 2005 at 10:20 am
• 6

#### [R] repeated values, nlme, correlation structures

Dear listers, As an exercise, I am trying to fit a logistic model with nlme. Blue tit pulli (youngs) were weighted occasionnally (for field reasons) along time in 17 nestboxes. Individuals where not ... Patrick GiraudouxNov 7, 2005 at 7:27 pmNov 20, 2005 at 6:19 pm
• 6

#### [R] no package 'Matrix' at the repositories

Yesterday, I installed R2.2.0 for Windows [Version 2.2.0 (2005-10-06 r35749)]. Unfortunately, 'install.packages("Matrix")' produced the following message: Warning in download.packages(pkgs, destdir = ... Spencer GravesNov 11, 2005 at 1:38 pmNov 12, 2005 at 12:34 pm
• 6

#### [R] problems with for: warnings and segfault

Hi, I have two problem with a for looping using R Version 2.1.1 (2005-06-20) on a Debian Linux Testing. The first problem: warnings messages Look: ycoord[indice] <- ycoord } Warning messages: 1 ... Ronaldo Reis-Jr.Nov 11, 2005 at 3:12 pmNov 11, 2005 at 8:23 pm
• 6

#### [R] elements in a matrix to a vector

hi all, i'm trying to get elements in a matrix into a vector. i need a "streamlined" way to do it as the way i'm doing it is not very serviceable. an example is a 3x3 matrix like 0 0 3 2 0 0 0 4 0 to ... Mike JonesNov 9, 2005 at 4:14 pmNov 9, 2005 at 7:33 pm
• 6

#### [R] frequency() source code

Greetings: I am looking for the source code for the frequency function. I grepped the following dirs but no luck. R-2.2.0/src/appl/* R-2.2.0/src/main/* R-2.2.0/src/nmath/* R-2.2.0/src/library/stats/* ... Bob mccallNov 7, 2005 at 11:11 pmNov 9, 2005 at 6:18 pm
• 6

#### [R] lattice chart: different definitions for series

Hi enthusiasts, Trying to create a single chart in lattice with different plotting definitions for the different series (two series should be drawn with lines and the other without them) I am using a ... ManuelPerera-ChangNov 7, 2005 at 5:36 pmNov 9, 2005 at 10:49 am
• 6

#### [R] RODBC and Excel: Wrong Data Type Assumed on Import

The first column in my Excel sheet has mostly numbers but I need to treat it as character data:  "Plasmid Number" "Plasmid" "Concentration" "Comments" "Lost" # How is the type decided? I need a ... Earl F. GlynnNov 2, 2005 at 6:45 pmNov 5, 2005 at 7:04 am
• 6

#### [R] newbie graphics question: Two density plots in same frame ?

I swear I've scoured the help files and several texts before posting what feels like a dumb newbie question. How can I draw two kernel density plots in the same frame ? I have similar variables in ... Alpert, WilliamNov 3, 2005 at 4:45 pmNov 3, 2005 at 11:10 pm
• 5

#### [R] date/time arithmetic

On the help page "DateTimeClasses {base}" it says: "One can add or subtract a number of seconds or a difftime object from a date-time object, but not add two date-time objects." However,  ... Parlamis FranklinNov 23, 2005 at 8:02 pmNov 30, 2005 at 9:13 pm
• 5

#### [R] transform matrix

I run the following code and got a wrong message. Anyway to transform test1 to a 6 by 6 matrix? many thanks! 1 2 3 4 5 6 1 0.0000000 0.7760856 2.022222 0.6148687 3.0227028 3.2104434 2 0.7760856 ... RobertNov 29, 2005 at 11:46 amNov 29, 2005 at 1:00 pm
• 5

#### [R] residuals in logistic regression model

In the logistic regression model, there is no residual log (pi/(1-pi)) = beta_0 + beta_1*X_1 + ..... But glm model will return residuals What is that? How to understand this? Can we put some residual ... Urania SunNov 24, 2005 at 6:35 pmNov 25, 2005 at 3:07 pm                    