Re: [R] factanal and plotting?

2008-03-17 Thread Mark Wardle
Dear Martin, The plot you refer to is a scree plot. One option (there are many) is to have a look at the nFactors package. Despite its package description, it includes the function plotnScree. You will find it helpful to search google for "scree plot R" and/or use rseek.org as there are many pos

Re: [R] Overloading %*%

2008-03-17 Thread Martin Maechler
> "SpG" == Spencer Graves <[EMAIL PROTECTED]> > on Sun, 16 Mar 2008 19:47:29 -0700 writes: SpG> Dear Martin: This is wonderful. Thank you very much. SpG> It would be a great help if your suggestions SpG> could be added to "See Also" and "Examples" for SpG> "meth

[R] driving R from MATLAB

2008-03-17 Thread Moshe Hoshen
I am trying to use R functions from my MATLAB code using a DCOM server. I am working under Windows XP. While I mange to run basic functions and run them using scripts, when I try a more complicated set of functions I fail. I am trying to perform survival analysis, using Surv Surv(recruTime,recu

Re: [R] driving R from MATLAB

2008-03-17 Thread Dieter Menne
Moshe Hoshen rosettagenomics.com> writes: > > I am trying to use R functions from my MATLAB code using a DCOM server. > I am working under Windows XP. .. > I am trying to perform survival analysis, using Surv > > Surv(recruTime,recur) > > Surv creates a somewhat complex output and I get the

Re: [R] How to assign text string as object?

2008-03-17 Thread Michal Kneifl
One more question Jim. What if the names of the columns are not a combination of a letter and an integer? Suppose they are just "names" of craniometric characteristics, like "nasal length", "orbital width" etc? Thanks for you reply. Michael - Original Message - From: "jim holtman" <[EM

Re: [R] Using a DCOM server ( driving R from MATLAB)

2008-03-17 Thread Prof Brian Ripley
This is about 'a' DCOM server. You haven't told us which (there are at least two possibilities), but if it is the one by Thomas Baier it has its own mailing list. This is not an R issue (and I suspect not a MATLAB one either), so please try to use an accurate subject line. On Mon, 17 Mar 200

Re: [R] setAs vs setIs

2008-03-17 Thread Christophe Genolini
I works, great ! So using your code, we can define 'as','as<-' and 'is' with setIt. Is there still any interest using setAs ? Christophe > > It seems to me your problem here is simply that you did not define a > coerce cal in setIs, so it does not know how to turn a C object into a > B object,

[R] how to plot a map on a non-rectilinear grid

2008-03-17 Thread Costas Douvis
Hi everyone I have a matrix (let's say that it contains the values of elevation) and want to plot its values on a map using a function such as image.plot or filled.contour. The problem is that my grid is not rectilinear, it is bended. Here is an example lon<-matrix(0,20,25) lat<-matrix(0,20,25) e

Re: [R] driving R from MATLAB

2008-03-17 Thread Moshe Hoshen
Dear Dieter Thanks I have my script working perfectly now, thanks to you Cheers -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dieter Menne Sent: Monday, March 17, 2008 10:51 AM To: [EMAIL PROTECTED] Subject: Re: [R] driving R from MATLAB Moshe Hoshen r

[R] Creating plots for all variables in a data frame and printing them with the variable name in the main title

2008-03-17 Thread Uli Kleinwechter
Dear all, I'm just trying to create plots for all variables in a dataframe (named "x") using the following: png() apply(x,2,hist) Just as intended, it produces one plot for each variable. Unfortunately, the main title of each graph is "Histogram of newX[,i]" instead of "Histogram of name of v

Re: [R] setAs vs setIs

2008-03-17 Thread Martin Maechler
> "CG" == Christophe Genolini <[EMAIL PROTECTED]> > on Mon, 17 Mar 2008 09:42:09 +0100 writes: CG> I works, great ! CG> So using your code, we can define 'as','as<-' and 'is' with setIt. Is CG> there still any interest using setAs ? Well, ?setIs contains >> This fun

[R] contextstack overflow

2008-03-17 Thread Gisela Sturm
Hi all, I´m an absolute beginner in R programming…I have a really long R-code with many variables. When I run the program I always get an error at the same place called “contextstack overflow”. Does anybody know what to do in this case? Are there so strict limitations in R? If yes, is it possib

[R] How does one do simple string concatenation?

2008-03-17 Thread Ajay Shah
How does one convert objects c("a","b","c") and "d" into "abcd"? > paste(c("a","b","c"), "d") of course yields [1] "a d" "b d" "c d" -- Ajay Shah http://www.mayin.org/ajayshah [EMAIL PROTECTED] http://ajayshahblog.blogspot.

Re: [R] How does one do simple string concatenation?

2008-03-17 Thread Henrique Dallazuanna
Try; paste(c(c("a","b","c"), "d"), collapse="") On 17/03/2008, Ajay Shah <[EMAIL PROTECTED]> wrote: > How does one convert objects c("a","b","c") and "d" into "abcd"? > >> paste(c("a","b","c"), "d") > of course yields >[1] "a d" "b d" "c d" > > -- > Ajay Shah

Re: [R] How does one do simple string concatenation?

2008-03-17 Thread Gabor Csardi
First 'c' and then 'paste' with 'collapse': paste(collapse="", c(c("a", "b", "c"), "d")) See ?paste G. On Mon, Mar 17, 2008 at 04:26:17PM +0530, Ajay Shah wrote: > How does one convert objects c("a","b","c") and "d" into "abcd"? > >> paste(c("a","b","c"), "d") > of course yields >[1] "

Re: [R] How does one do simple string concatenation?

2008-03-17 Thread Romain Francois
Hi, See collapse argument in ?paste R> paste( paste(c("a","b","c"), collapse = ""), "d", sep = "") [1] "abcd" Cheers, Romain Ajay Shah wrote: > How does one convert objects c("a","b","c") and "d" into "abcd"? > >> paste(c("a","b","c"), "d") > of course yields >[1] "a d" "b d" "c d" >

Re: [R] How does one do simple string concatenation?

2008-03-17 Thread ONKELINX, Thierry
have a look at the collapse argument in ?paste. paste(paste(c("a","b","c"), collapse = ""), "d", sep = "")) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and

Re: [R] contextstack overflow

2008-03-17 Thread Prof Brian Ripley
On Mon, 17 Mar 2008, Gisela Sturm wrote: > I?m an absolute beginner in R programming?I have a really long R-code with > many variables. When I run the program I always get an error at the same > place called ?contextstack overflow?. Does anybody know what to do in this > case? Are there so strict

Re: [R] Creating plots for all variables in a data frame and printing them with the variable name in the main title

2008-03-17 Thread Henrique Dallazuanna
Try: x <- data.frame(A=rnorm(100), B=rnorm(100), C=runif(100)) sapply(names(x), function(i)hist(x[,i], main = i)) On 17/03/2008, Uli Kleinwechter <[EMAIL PROTECTED]> wrote: > Dear all, > > I'm just trying to create plots for all variables in a dataframe (named > "x") using the following: > > p

[R] Summary Regard with Lme does not work without a random effect (UN CLASSIFIED)

2008-03-17 Thread Park, Kyong H Mr ECBC
Classification: UNCLASSIFIED Caveats: NONE R users, This is a summary for the responses I got from Sandra Dorai-Raj and Simon Blomberg followed by my question. Sandra suggested using lm instead of lme for a model without a random effect, and Simon suggested anova.lme instead of anova.lm for co

Re: [R] Creating plots for all variables in a data frame and printing them with the variable name in the main title

2008-03-17 Thread Prof Brian Ripley
On Mon, 17 Mar 2008, Uli Kleinwechter wrote: > Dear all, > > I'm just trying to create plots for all variables in a dataframe (named > "x") using the following: > > png() > apply(x,2,hist) Please don't use apply() on a data frame: you want lapply(x, hist) here. > Just as intended, it produces on

Re: [R] rgl build warnings and loading error on Linux

2008-03-17 Thread Paul Smith
On Sun, Mar 16, 2008 at 7:38 PM, Liviu Andronic <[EMAIL PROTECTED]> wrote: > I have several problems in using rgl-0.77 (and recent earlier > versions) on Gentoo Linux with a custom-built v. 2.6.22 kernel. > Currently I use R-2.6.1. > > When I build rgl, > # R CMD INSTALL "/home/liviu/inst/dwn/

Re: [R] contextstack overflow

2008-03-17 Thread Gisela Sturm
> I am an absolute beginner in R programming? I have a really long R-code with > many variables. When I run the program I always get an error at the same > place called "contextstack overflow". Does anybody know what to do in this > case? Are there so strict limitations in R? If yes, is it possible

Re: [R] contextstack overflow

2008-03-17 Thread Prof Brian Ripley
On Mon, 17 Mar 2008, Gisela Sturm wrote: >> I am an absolute beginner in R programming? I have a really long R-code > with >> many variables. When I run the program I always get an error at the same >> place called "contextstack overflow". Does anybody know what to do in this >> case? Are there so

Re: [R] How to assign text string as object?

2008-03-17 Thread jim holtman
I think one of the other solutions suggested a way of doing it if "AGE" was one of the columns and you wanted to plot against all the others. It would probably be done in this fashion: for (i in names(df)[!(names(df) %in% "AGE")]){ plot(df$AGE, df[[i]], main=i, type='l') } On 3/17/08, Micha

Re: [R] filehash

2008-03-17 Thread Roger D. Peng
Yes, the file will be created in the current working directory and is probably the reason for the error in 'dbInit'. This is a bit of a dumbo on my part---thanks for copying me. -roger Prof Brian Ripley wrote: > I suspect you have a file permission problem, and noticed filehash has > some bug

Re: [R] (no subject)

2008-03-17 Thread John Kane
Your loop assumes p has a length of 10 but length(p) is 2. --- Kathy Maher <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to use the Fisher scoring method with a > geometric distribution, > with p = .07, 100 observations from the geom > distrib, and 10 iterations. > I cannot quite get the

[R] Writing GLM/GEE Ouput to Text File

2008-03-17 Thread Charles Willis
Hello, How can one write the output of a GLM/GEE model to a text file, such that the results appear in text file in the same (or similar) format they appear in the R console? For instance, I have the following model: Traitresult <- compar.gee(Y~X, data = data, family = "binomial", phy = tree, sc

Re: [R] Std errors in glm models w/ and w/o intercept

2008-03-17 Thread David Winsemius
Prof Brian Ripley <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Mon, 17 Mar 2008, David Winsemius wrote: >> >> I am doing a reanalysis of results that have previously been >> published. My hope was to demonstrate the value of adoption of more >> modern regression methods in preferenc

Re: [R] (no subject)

2008-03-17 Thread bartjoosen
There are several mistakes: Why are you using only p[1], p[2]? Afterwards you try (for i in 1:10) p[i] so you should go to p[10]? Then you should make a pnew wich holds 10 values, so pnew[i] This should get you back on track Bart Kathy Maher wrote: > > Hi, > > I am trying to use the Fisher

[R] how do i save data to txt file? are there marcos to save tables to word?

2008-03-17 Thread Tom Willems
Dear R-ussers, I would like to save a newly created data file, out of R in to a text file. It is a rather big dataset, and recalculating the new variables takes a long time. The quickest way to read data is when it is saved as ".txt", this is why i hope to read the data from the old txt, than

[R] get a expression as String

2008-03-17 Thread jcgonzales
Hi, I'm working with Rserve, and in R I have this expression ab <- y ~ a + b, but the problem with Rserve is I can't get the expression, is there some way to convert this expression in String or in List?..thanks -- View this message in context: http://www.nabble.com/get-a-expression-as-String

Re: [R] Creating plots for all variables in a data frame and printing them with the variable name in the main title

2008-03-17 Thread bartjoosen
Here is one way: lapply(1:ncol(x),function(i) hist(x[,i], main =paste("Histogram of",names(x)[i]))) Bart Uli Kleinwechter wrote: > > Dear all, > > I'm just trying to create plots for all variables in a dataframe (named > "x") using the following: > > png() > apply(x,2,hist) > > Just as int

[R] problems with rgl in Ubuntu 'gutsy'

2008-03-17 Thread Foadi, J (James)
Dear R users/gurus, I have recently installed Ubuntu 7.10 (Gutsy) on my Dell Latitude D520. First time for me, as I have always used Fedora. R installation using "apt" has proceeded fine, both for r-base and r-base-dev. Next, I need to install various other packages, "rgl" being first in the line

Re: [R] get a expression as String

2008-03-17 Thread jim holtman
Is this what you want? > x <- capture.output(dput(ab)) > x [1] "y ~ a + b" > On 3/17/08, jcgonzales <[EMAIL PROTECTED]> wrote: > > Hi, I'm working with Rserve, and in R I have this expression ab <- y ~ a + > b, but the problem with Rserve is I can't get the expression, is there some > way to c

Re: [R] how do i save data to txt file? are there marcos to save tables to word?

2008-03-17 Thread jim holtman
?write.table On 3/17/08, Tom Willems <[EMAIL PROTECTED]> wrote: > Dear R-ussers, > > I would like to save a newly created data file, out of R in to a text > file. > It is a rather big dataset, and recalculating the new variables takes a > long time. > The quickest way to read data is when it is s

Re: [R] how do i save data to txt file? are there marcos to save tables to word?

2008-03-17 Thread Gabor Grothendieck
If the only reason you are writing it out is just to read it back in later rather than writing it out as a text file use save() and load(). See WordOpen in the svViews package. On Mon, Mar 17, 2008 at 11:20 AM, Tom Willems <[EMAIL PROTECTED]> wrote: > Dear R-ussers, > > I would like to save a new

Re: [R] Writing GLM/GEE Ouput to Text File

2008-03-17 Thread jim holtman
?capture.output ?sink On 3/17/08, Charles Willis <[EMAIL PROTECTED]> wrote: > Hello, > > How can one write the output of a GLM/GEE model to a text file, such that > the results appear in text file in the same (or similar) format they appear > in the R console? For instance, I have the following m

Re: [R] problems with rgl in Ubuntu 'gutsy'

2008-03-17 Thread Dirk Eddelbuettel
On 17 March 2008 at 15:32, Foadi, J (James) wrote: | Dear R users/gurus, | I have recently installed Ubuntu 7.10 (Gutsy) on my Dell Latitude D520. | First time for me, as I have always used Fedora. | | R installation using "apt" has proceeded fine, both for r-base and r-base-dev. | | Next, I nee

Re: [R] how to plot a map on a non-rectilinear grid

2008-03-17 Thread Roger Bivand
Costas Douvis geol.uoa.gr> writes: > > Hi everyone > > I have a matrix (let's say that it contains the values of elevation) and > want to plot its values on a map using a function such as image.plot or > filled.contour. The problem is that my grid is not rectilinear, it is > bended. Here is an

[R] Windows Vista 64-bit support

2008-03-17 Thread Daniel Gatti
Where does the R build for Vista X64 stand? The last update message is from July last year (see [R] Improved Windows Vista compatibility from Prof Brian Ripley on 2007-07-11). Is it likely to happen in 2008? I suspect that more people will start using it as Vista is adopted more widely. And

Re: [R] Writing GLM/GEE Ouput to Text File

2008-03-17 Thread Lanre Okusanya
have you tried using sink() ? LAnre On Mon, Mar 17, 2008 at 12:07 PM, jim holtman <[EMAIL PROTECTED]> wrote: > ?capture.output > ?sink > > On 3/17/08, Charles Willis <[EMAIL PROTECTED]> wrote: > > Hello, > > > > How can one write the output of a GLM/GEE model to a text file, such that > > t

Re: [R] how do i save data to txt file? are there marcos to save tables to word?

2008-03-17 Thread John Kane
--- Tom Willems <[EMAIL PROTECTED]> wrote: > Dear R-ussers, > One other thing i d like to know is how to save a > Table output from R, directly to a table in word? > copy paste destroys the layout of the table. One way that is not absolutely direct but which works nicely is the xtable package.

Re: [R] problems with rgl in Ubuntu 'gutsy'

2008-03-17 Thread Foadi, J (James)
Yes. It gives me exactly the same problems. In fact I have tried the pre-built first and then the source, hoping it would, then, compile. J Dr James Foadi PhD Membrane Protein Laboratory (MPL) Diamond Light Source Ltd Diamond House Harewell Science and Innovation Campus Chilton, Didcot Oxfordshi

Re: [R] Windows Vista 64-bit support

2008-03-17 Thread chaogai
The standard windows build works in Vista 64. A 64 bits build depends on tools outside the realm of the R-core team; a 64 bits compiler On Monday 17 March 2008 06:17:31 pm Daniel Gatti wrote: > Where does the R build for Vista X64 stand? The last update message is > from July last year (see [R]

[R] Table of basic descriptive statistics like SPSS

2008-03-17 Thread ukoenig
Dear list readers, I want to: 1. Get a table of basic descriptive statistics for my variables with the variable names one below the other like SPSS descriptive statistics: Varname N Min Max Mean SD x x xx x xxx x x xx x 2. Delete some variables from a data frame

[R] summary of summaries

2008-03-17 Thread Bernd Jagla
Hi, I have a few hundreds files with numerical information of different length but with the same column structure. I use the following code to get summary statistics fplist <- list.files(pattern=".*analysis") for (fp in fplist){ x2 <- read.delim(fp) summary(x2)

[R] R.matlab errors and slow con

2008-03-17 Thread Christina Curtis
Hi, I have noticed that when using R.matlab that the connection can become quite slow though it remains open. I have to kill both my R session and Matlab to start over and establish a new connection (eg. close(matlab) - seems hung). Is there a way around this? I have been doing the following to

[R] sqlSave (RODBC) question

2008-03-17 Thread Olivier Lefevre
I am having a hard time understanding how to make sure the right types (esp. in the case of dates) are passed to the db, partly because of a lack of concrete examples in the docs and partly because the docs are a bit elliptic: the docs merely say that "the types are selected by consulting argum

Re: [R] Anova

2008-03-17 Thread Douglas Bates
On Sun, Mar 16, 2008 at 6:39 AM, Gavin Simpson <[EMAIL PROTECTED]> wrote: > On Sat, 2008-03-15 at 12:48 -0500, daniel jupiter wrote: > > Hi all, > > > > I apologize for what might be a silly question. > > > > I am interested in doing a one way anova. > > This is not too hard in and of itself,

Re: [R] Table of basic descriptive statistics like SPSS

2008-03-17 Thread Hank Stevens
Hi Udo, See the Hmisc and Design libraries by Frank Harrell, and some associated PDF docs by Alzola and Harrell describing data management and display. Hank On Mar 17, 2008, at 2:05 PM, [EMAIL PROTECTED] wrote: > Dear list readers, > I want to: > > 1. Get a table of basic descriptive statistic

Re: [R] summary of summaries

2008-03-17 Thread Henrique Dallazuanna
Try this: summary(do.call(rbind, lapply(list(df1, df2), sapply, summary))) On 17/03/2008, Bernd Jagla <[EMAIL PROTECTED]> wrote: > Hi, > > > > I have a few hundreds files with numerical information of different length > but with the same column structure. I use the following code to get summary

Re: [R] Table of basic descriptive statistics like SPSS

2008-03-17 Thread John Kane
#How Can I create a text file with the output of "describe"? ?sink ?write.table ?write.csv #delete some variables. ?Extract df[,-(10:12)] df[, 1:9] --- [EMAIL PROTECTED] wrote: > Dear list readers, > I want to: > > 1. Get a table of basic descriptive statistics for > my variables > with the

[R] arules - getting transaction data in

2008-03-17 Thread Amnon Melzer
Hi All Hoping someone can help me with the "transactions" object. I am struggling to get my data in. I know the answer is in the help somewhere I'm sure, I just cannot find it. Essentially, I have data in this format (though I can change it if it particularly unsuitable) Transaction_id, store

Re: [R] problems with rgl in Ubuntu 'gutsy'

2008-03-17 Thread Hans Ekbrand
On Mon, Mar 17, 2008 at 05:43:58PM -, Foadi, J (James) wrote: > Yes. It gives me exactly the same problems. > In fact I have tried the pre-built first and then the source, hoping it > would, then, compile. [...] [Top posting makes it more difficult to add to you discussion.] > | This has d

[R] how to get accumulate contingency table

2008-03-17 Thread alex chin
Hi, all. I got a lot of help from the this mailing list, it save me a lot of time. Here is my question. x<-rep(c(2,3,4),20) y<-sample(rep(c(0,1),30)) tr<-rep(c(1:5),6) data1<-data.frame(x,y,tr) data1<-data1[order(data1$tr),] > data1 x y tr1 2 0 16 4 1 111 3 0 116 2 0 121 4

[R] how to get accumulate contingency table

2008-03-17 Thread alex chin
Hi, all. I got a lot of help from the this mailing list, it save me a lot of time. Here is my question. x<-rep(c(2,3,4),20)y<-sample(rep(c(0,1),30))tr<-rep(c(1:5),6)data1<-data.frame(x,y,tr)data1<-data1[order(data1$tr),]> data1 x y tr1 2 0 16 4 1 111 3 0 116 2 0 121 4 0 126 3

Re: [R] problems with rgl in Ubuntu 'gutsy'

2008-03-17 Thread Foadi, J (James)
On Mon, Mar 17, 2008 at 05:43:58PM -, Foadi, J (James) wrote: > Yes. It gives me exactly the same problems. > In fact I have tried the pre-built first and then the source, hoping it > would, then, compile. [...] [Top posting makes it more difficult to add to you discussion.] > | This has

Re: [R] Table of basic descriptive statistics like SPSS

2008-03-17 Thread Liviu Andronic
On Mon, Mar 17, 2008 at 7:05 PM, <[EMAIL PROTECTED]> wrote: > 1. Get a table of basic descriptive statistics for my variables > with the variable names one below the other > like SPSS descriptive statistics: [trimmed] > 2. Delete some variables from a data frame or exclude variables > from be

Re: [R] Help in estimating HURST parameter

2008-03-17 Thread AA
have a look at the following packages ITSA see http://www.jstatsoft.org/v23/i05 and Rmetircs (fseries). good luck. AA. - Original Message - From: "Deepak Jadhav" <[EMAIL PROTECTED]> To: Sent: Wednesday, March 12, 2008 10:56 AM Subject: [R] Help in estimating HURST parameter > Hi, >

Re: [R] rgl build warnings and loading error on Linux

2008-03-17 Thread Liviu Andronic
On Sun, Mar 16, 2008 at 10:00 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > It sounds as though it is not finding the OpenGL libs when it > configures. That function should be in libGL.so. This is what I have on my system: localhost liviu # locate libGL.so /usr/lib/opengl/xorg-x11/lib/libGL.s

[R] Weighted histograms / distributions

2008-03-17 Thread guy se1
Hi all, I'd be greatful for any assistance with these two problem I'm facing: 1. How can I combine weighted.hist() and multhist() from the plotrix library so that I can display two weighted histograms on the same chart ? (if anyone is familiar with a different library or function tha

Re: [R] rgl build warnings and loading error on Linux

2008-03-17 Thread Liviu Andronic
On Mon, Mar 17, 2008 at 1:54 AM, Charles C. Berry <[EMAIL PROTECTED]> wrote: > emerge -pD R > > to see what would get rebuilt. (This should rebuild out-of-date > dependencies.) emerge -tvaD R proposes me to emerge all out-dated packages found on my system, from gimp to dbus (currently 29

Re: [R] rgl build warnings and loading error on Linux

2008-03-17 Thread Duncan Murdoch
Liviu Andronic wrote: > On Sun, Mar 16, 2008 at 10:00 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > >> It sounds as though it is not finding the OpenGL libs when it >> configures. That function should be in libGL.so. >> > > This is what I have on my system: > localhost liviu # locate l

Re: [R] rgl build warnings and loading error on Linux

2008-03-17 Thread Charles C. Berry
On Mon, 17 Mar 2008, Liviu Andronic wrote: > On Mon, Mar 17, 2008 at 1:54 AM, Charles C. Berry <[EMAIL PROTECTED]> wrote: >> emerge -pD R >> >> to see what would get rebuilt. (This should rebuild out-of-date >> dependencies.) > > emerge -tvaD R proposes me to emerge all out-dated package

[R] Weighted histograms / distributions (retry)

2008-03-17 Thread guy se1
Hi all, I'd be greatful for any assistance with these two problem I'm facing: 1. How can I combine weighted.hist() and multhist() from the plotrix library so that I can display two weighted histograms on the same chart ? (if anyone is familiar with a different library or function that already do

[R] 'distance' between a vector and a permutation of the vector

2008-03-17 Thread Rajarshi Guha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I've been trying to identify a good way to do the following: Say I have a vector of unique, integers x <- c(1,3,2,4,5) I then have a permuted version of the above vector, say y <- c(1,3,5,2,4) Is there an easy way to get the "distance" between

Re: [R] Table of basic descriptive statistics like SPSS

2008-03-17 Thread Frank E Harrell Jr
John Kane wrote: > #How Can I create a text file with the output of > "describe"? sink('my.txt') describe( ) sink() If you use LaTeX you'll get more (and better) output including tiny high-resolution histograms of continuous variables. Frank > > ?sink > ?write.table > ?write.csv > > #delete

[R] problem with merge

2008-03-17 Thread Mark W Kimpel
I have used merge regularly and thought I understood how it worked, but I must not. I have two dataframes with identical colnames from two different experiments, TL01 and LC01. Each dataframe has a column named "Entrez.Gene", which I have converted to "as.character" just to make sure merge is n

[R] Updating selected variables in a data frame

2008-03-17 Thread Andrew C. Ward
Dear list, I'd like to update certain rows/columns in a data frame with new values. The application is that survey respondents may give an answer of "Other" to a categorical question and then provide some text describing what they mean. This text is then reviewed and placed into a category. These

Re: [R] Updating selected variables in a data frame

2008-03-17 Thread Gabor Grothendieck
Try this. It uses the fact that 2 column matrices can be used as subscripts (as described in the Matrices and arrays section of ?Extract): with(recodes, replace(as.matrix(main), cbind(id, qst + 1), value)) It returns a matrix so use as.data.frame on that to turn it back to a data frame, if need b