[R] Converting variance covariance matrix to correlation matrix

2008-05-19 Thread Arun Kumar Saha
Suppose I have a Variance-covariance matrix A. Is there any fast way to calculate correlation matrix from 'A' and vice-versa without emplying any 'for' loop? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Opening more than 1 R console in Windows

2008-05-19 Thread Prof Brian Ripley
On Sun, 18 May 2008, Anh Tran wrote: Hi all, I recently found out that R does not utilize fully the Duo Core capability when you only run one instance of R. How surprising was that? Do you have any programs that do? Very few Windows programs make effective use of multiple CPUs, and of

Re: [R] Converting variance covariance matrix to correlation matrix

2008-05-19 Thread Peter Dalgaard
Arun Kumar Saha wrote: Suppose I have a Variance-covariance matrix A. Is there any fast way to calculate correlation matrix from 'A' and vice-versa without emplying any 'for' loop? C - cov2cor(A) The other way around is ill-defined, but if d is the vector of variances, d - sqrt(diag(A)) A

Re: [R] Converting variance covariance matrix to correlation matrix

2008-05-19 Thread Dimitris Rizopoulos
check the following: # covariance matrix V - var(matrix(rnorm(10*4), 10, 4)) cov2cor(V) # correlation matrix R - cov2cor(V) # vector of std. dev. sds - rnorm(4)^2 R * sds * rep(sds, each = nrow(R)) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of

Re: [R] Opening more than 1 R console in Windows

2008-05-19 Thread Charles Plessy
Le Mon, May 19, 2008 at 07:39:11AM +0100, Prof Brian Ripley a écrit : On Sun, 18 May 2008, Anh Tran wrote: I recently found out that R does not utilize fully the Duo Core capability when you only run one instance of R. How surprising was that? Do you have any programs that do? Very few

Re: [R] Opening more than 1 R console in Windows

2008-05-19 Thread Prof Brian Ripley
On Mon, 19 May 2008, Charles Plessy wrote: Le Mon, May 19, 2008 at 07:39:11AM +0100, Prof Brian Ripley a écrit : On Sun, 18 May 2008, Anh Tran wrote: I recently found out that R does not utilize fully the Duo Core capability when you only run one instance of R. How surprising was that? Do

[R] RSQLite and undefined symbol:sqlite3_bind_in

2008-05-19 Thread Maya Bercovich
Hi All, I tried to install AnnotationDBI like so: source(http://bioconductor.org/biocLite.R;) biocLite(AnnotationDbi) and got this error: Loading required package: RSQLite Error in dyn.load(file, ...) : unable to load shared library '/RHEL3/local/lib64/R/library/

[R] Startin R from .RData in linux

2008-05-19 Thread Agustin Lobo
Hi! Is it possible to start R by clicking the .RData file in linux as in Windows? I've tried with ubuntu hardy using the right button and selecting R, but does not work. Is there any way to set it up? (I know R can by started from the terminal, selecting the appropriate directory). Thanks

[R] Log or diary file

2008-05-19 Thread Agustin Lobo
Hi! Is it possible to set a file to which both commands and output would get automatically saved? I've tried with sink(), but only get the output. I mean something like a combined history and sink, as you get with File/Save to File.. in the windows GUI. Tis is done with diary filename in Matlab,

Re: [R] *apply function for arrays?

2008-05-19 Thread Uwe Ligges
Hesen Peng wrote: Hi, Thank you so much for the help. apply does work for the first situation. For the second situation, I'm currently using: temp.a-function(i,j){ return(G(M[i,],N[j,])) } temp.v-Vectorize(temp.a) result-outer(1:nrow(M),1:nrow(N),FUN=temp.v) Looks pretty good! Uwe

Re: [R] Converting variance covariance matrix to correlation matrix

2008-05-19 Thread Peter Dalgaard
Peter Dalgaard wrote: Arun Kumar Saha wrote: Suppose I have a Variance-covariance matrix A. Is there any fast way to calculate correlation matrix from 'A' and vice-versa without emplying any 'for' loop? C - cov2cor(A) The other way around is ill-defined, but if d is the vector of

Re: [R] two curves at one graph

2008-05-19 Thread Jim Lemon
hanen wrote: i try to use par(new=TRUE) i get them at the same graph but the y_axis and x_axis are drowen with two unevenly graduations that graph become unreadable. Hi Hanen, If you want to plot two sets of values that fit into the same range, plot the one with the larger range first, then

[R] Select certain elements from dataframe

2008-05-19 Thread SebastianEck
Hello, I have a specific problem, I have a large dataframe, and after clustering I want to select certain colums, the elements of a subcluster. My dataframe looks like this : colnames(data) [1] 101KF4319097339 102KF4319101170 103KF4319047549 104KF4319046389 [5] 105KF4319013260

[R] How hist() decides breaks?

2008-05-19 Thread Ted Harding
Hi Folks, I'd like to know how hist() decides how many cells to use when it ignores my suggestion to use say 'hist(...,breaks=50)'. More specifically, I have the results of 1 simulations, each returning an 8-vector, therefore 8 variables each with 1 values. Some of these 8 have somewhat

Re: [R] Select certain elements from dataframe

2008-05-19 Thread jim holtman
'xx1' is a 'factor' and you have to convert to a character before selecting: data.xx1-data[ ,as.character(xx1)] On Mon, May 19, 2008 at 5:20 AM, SebastianEck [EMAIL PROTECTED] wrote: Hello, I have a specific problem, I have a large dataframe, and after clustering I want to select certain

Re: [R] How hist() decides breaks?

2008-05-19 Thread jim holtman
Why don't you specifically tell hist what breaks to use: hist(x, breaks=seq(min(x), max(x), length=50), include.lowest=TRUE) On Mon, May 19, 2008 at 5:31 AM, Ted Harding [EMAIL PROTECTED] wrote: Hi Folks, I'd like to know how hist() decides how many cells to use when it ignores my suggestion

Re: [R] How hist() decides breaks?

2008-05-19 Thread Peter Dalgaard
(Ted Harding) wrote: Hi Folks, I'd like to know how hist() decides how many cells to use when it ignores my suggestion to use say 'hist(...,breaks=50)'. More specifically, I have the results of 1 simulations, each returning an 8-vector, therefore 8 variables each with 1 values. Some

Re: [R] Startin R from .RData in linux

2008-05-19 Thread Marianne Promberger
On 05/19/08 09:06, Agustin Lobo wrote: Hi! Is it possible to start R by clicking the .RData file in linux as in Windows? I've tried with ubuntu hardy using the right button and selecting R, but does not work. Is there any way to set it up? You presumably need to associate the file type

Re: [R] How hist() decides breaks?

2008-05-19 Thread Ted Harding
On 19-May-08 10:00:10, Peter Dalgaard wrote: (Ted Harding) wrote: Hi Folks, I'd like to know how hist() decides how many cells to use when it ignores my suggestion to use say 'hist(...,breaks=50)'. More specifically, I have the results of 1 simulations, each returning an 8-vector,

[R] Sort matrix with duplicate row names alphabetically by rowname

2008-05-19 Thread Paul Geeleher
Hi, I've a matrix that contains 4 replicates of each rowname. (4 a's, 4 b's, 4 c's in no particular order) Like this: # c 32 a 1 b 4 c 87 c 34 b 54 a 23 a 12 b 9 a 3 b 87 c 43 There are a couple of more columns but I'm using the above as an example I need to sort it so that the same

Re: [R] Sort matrix with duplicate row names alphabetically by rowname

2008-05-19 Thread john seers (IFR)
Try: mat - mat[order(rownames(mat)), ] --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Geeleher Sent: 19 May 2008 12:07 To: r-help@r-project.org Subject: [R] Sort matrix with duplicate row names alphabetically by rowname Hi, I've a

[R] From strings to numbers

2008-05-19 Thread Naira
Dear all, I would like to know if there is an easy to transform a vector of strings to a vector of integers. Ex: (ab,ab,bb,cat,cat,ab) will be (1, 1, 2, 3, 3, 1) Thx, Naira -- View this message in context: http://www.nabble.com/From-strings-to-numbers-tp17315179p17315179.html Sent from the

[R] RExcel - foreground server

2008-05-19 Thread Werner Wernersen
Hi, I have a problem using RExcel with a foreground server: in RExcel menu as well as in the window called by set server the foreground server option is grayed out. I have installed the rcom package and also tried to open R and type require(rcom), as explained on

Re: [R] Sort matrix with duplicate row names alphabetically by rowname

2008-05-19 Thread Paul Geeleher
Ah, job done, that was simple! Thanks, -Paul. On Mon, May 19, 2008 at 12:24 PM, john seers (IFR) [EMAIL PROTECTED] wrote: Try: mat - mat[order(rownames(mat)), ] --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Geeleher Sent: 19 May

Re: [R] From strings to numbers

2008-05-19 Thread Chuck Cleland
On 5/19/2008 6:13 AM, Naira wrote: Dear all, I would like to know if there is an easy to transform a vector of strings to a vector of integers. Ex: (ab,ab,bb,cat,cat,ab) will be (1, 1, 2, 3, 3, 1) X - c(ab,ab,bb,cat,cat,ab) as.numeric(as.factor(X)) [1] 1 1 2 3 3 1 Thx, Naira -- Chuck

Re: [R] From strings to numbers

2008-05-19 Thread Jim Lemon
Naira wrote: Dear all, I would like to know if there is an easy to transform a vector of strings to a vector of integers. Ex: (ab,ab,bb,cat,cat,ab) will be (1, 1, 2, 3, 3, 1) Hi Naira, It's not all that hard... newfactor-as.factor(c(ab,ab,bb,cat,cat,ab)) newfactor [1] ab ab bb cat cat

[R] Odp: Sort matrix with duplicate row names alphabetically by rowname

2008-05-19 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 19.05.2008 13:06:33: Hi, I've a matrix that contains 4 replicates of each rowname. (4 a's, 4 b's, 4 c's in no particular order) Like this: # c 32 a 1 b 4 c 87 c 34 b 54 a 23 a 12 b 9 a 3 b 87 c 43 There are a couple of more columns

Re: [R] From strings to numbers

2008-05-19 Thread Naira Naouar
Jim and Chuck, Thanks a lot for your replies :) I knew that there was a better way than the complex thing I was planning to apply :p (with a lot of for/while/apply arghhh) I also remembered to use factor when my brain woke up ;) I did something like unclass(factor(c(ab,ab,bb,cat,cat,ab)))

[R] Rank Values in a Matrix

2008-05-19 Thread Jens Oldeland
Dear All, a short and maybe simple question: I have to rank all values in a matrix from 0 to X, [1] [2] [3] [4] [1] 0.1 2 03 [2] 50 3 31 [3] 100 1 10 [4] 100 2 20 0-0 0.1-1 2-2 3-3 50-4 100-5 (X=5) is there any function for this? i have looked in several

[R] R syntax, space smaller than space

2008-05-19 Thread Torsten Wiebke
Hi, I changed something in the package climatol especially in the function diagwl. Dos anybody know where I can put the code in the Internet to discuss it? I made from C for gradcelsius °C with: unit - list( temp = expression (paste(#T , degree,C)) ) mtext(unit$temp

Re: [R] Rank Values in a Matrix

2008-05-19 Thread Doran, Harold
If your matrix below is called aa, you could do this matrix(rank(aa, ties='min'), ncol=ncol(aa)) [,1] [,2] [,3] [,4] [1,]481 11 [2,] 14 11 115 [3,] 15551 [4,] 15881 This doesn't assign the values you list, but it does rank them. OTOH, if

Re: [R] Rank Values in a Matrix

2008-05-19 Thread Naira Naouar
Hi Jens, If the matrix you described is m. Then, you can do unique(as.vector(m)) [1] 0.1 2.0 0.0 3.0 50.0 1.0 100.0 order(unique(as.vector(m))) [1] 3 1 6 2 4 5 7 Hope this helps :) Naira Jens Oldeland wrote: Dear All, a short and maybe simple question: I have to rank all

Re: [R] Rank Values in a Matrix

2008-05-19 Thread Doran, Harold
Whoops, I inadvertently created a dataframe called aa and not a matrix, so the code below assumes aa is a dataframe and not a matrix. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold Sent: Monday, May 19, 2008 8:15 AM To: Jens

[R] svIDE and Tinn-R

2008-05-19 Thread Patrick Giraudoux
Probably an old moon since evoqued one year ago in this link: http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15738.html but I have recently re-installed Tinn-R with R 2.7.0 and forgot to insert options(warn=-1) library(svIDE) ... options(warn=0) in Rprofile.site... and could see that we have

[R] oligo ids

2008-05-19 Thread Eleni Christodoulou
Dear list, I am having a set of human oligo ids (H26022 H22025 H34703 H20442 H25719 H300018350) which I want to map to Ensembl or RefSeq. I am sure R has a function to do that. I downloaded the {oligo} package and tried to use the probeNames function. Although the factor of

Re: [R] From strings to numbers

2008-05-19 Thread Gabor Grothendieck
On Mon, May 19, 2008 at 7:41 AM, Naira Naouar [EMAIL PROTECTED] wrote: Jim and Chuck, Thanks a lot for your replies :) I knew that there was a better way than the complex thing I was planning to apply :p (with a lot of for/while/apply arghhh) I also remembered to use factor when my brain

Re: [R] Font settings in xfig

2008-05-19 Thread Robert
The main goal is to include graphics from R in a LaTeX document. Thanks a lot for all your help - its working now. /Robert On 16 Maj, 17:31, Greg Snow [EMAIL PROTECTED] wrote: If the main goal is to include graphs created by R in LaTeX documents and have them look nice, and usingxfigwas just

[R] three-dimensional (volumetric) estimation from x,y,z points

2008-05-19 Thread milton ruser
Hi people, sorry for this reposting. I sent it yesterday to the list, but as I don´t received a copy I suppose that occourred some problem. Kind regards, miltinho -- Forwarded message -- From: milton ruser [EMAIL PROTECTED] Date: May 18, 2008 10:35 PM Subject: three-dimensional

Re: [R] oligo ids

2008-05-19 Thread Ben Bolker
Eleni Christodoulou elenichri at gmail.com writes: Dear list, I am having a set of human oligo ids (H26022 H22025 H34703 H20442 H25719 H300018350) which I want to map to Ensembl or RefSeq. [snip snip snip] I think you're more likely to get an answer to this

[R] labels in multiple plot

2008-05-19 Thread Bruno C.
My code is the following: point_type-c(black,gray20,red) ... for (i in 1:dim(m)[1]) { par(pch=(18+i)) par(fg=point_type[i]) plot(m[i,], type='b', ylim = c(lower, upper), type = l, ...) par(new=T) } Now I need to add an

[R] Least Squares Restricted Estimator

2008-05-19 Thread Villoria, Nelson B
It is there any implementation of a Least Squares Restricted Estimator for a single equation in R? I have seen in the list some examples in which linear constraints are embedded within the equation, but let's say that I have a large number of coefficients (on factors) that I want them to sum up to

Re: [R] Log or diary file

2008-05-19 Thread Greg Snow
The R2HTML package has tools for creating an HTML log of your session (see ?HTMLStart). Or the TeachingDemos package has a text based set of tools (see ?txtStart) for creating a log of your session. Neither is perfect (and imperfect in different ways), but could be what you are looking for.

Re: [R] svIDE and Tinn-R

2008-05-19 Thread Philippe Grosjean
Hello, This does not seem to be something in the svIDE package, but something send by Tinn-R to R through the DDE connection for the first two warnings. I'll eliminate the last one for next version of the package. Best, Philippe Grosjean Patrick Giraudoux wrote: Probably an old moon since

Re: [R] Log or diary file

2008-05-19 Thread Vincent Goulet
Agustin, Given this message and your previous one about starting R by clicking on the .RData file, I would suggest/recommend you have a look at the Emacs + ESS combination; see http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-and-Emacs In my opinion, this is the best multi-platform

Re: [R] labels in multiple plot

2008-05-19 Thread Greg Snow
It is not clear what exactly you are trying to do, but you may want to look at ?matplot for an alternative to your loop, then look at ?legend for adding explanations. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801)

Re: [R] [BioC] oligo ids

2008-05-19 Thread Eleni Christodoulou
Thanks Sean! Your reply was very helpful. I already got almost what I wanted. I have some NA values but I will look if I can find them through bibliography or an external tool. Best Regards, Eleni On Mon, May 19, 2008 at 6:07 PM, Sean Davis [EMAIL PROTECTED] wrote: On Mon, May 19, 2008 at

[R] constrOptim converging not to the optimal values

2008-05-19 Thread Carlo Fezzi
Dear helpers, I am using constrOptim to minimize a function subject to inequality constraint. It works well when the number of parameters to optimize is low (e.g. 4) but when they are more (e.g. 10) it does not produce the expected results. The function is minus the determinant of a binomial

[R] reshape a wide data frame from wide to a long format with metadata columns

2008-05-19 Thread ALAN SMITH
Hello R users and developers, I have a general question about reshaping a wide data frame using the reshape command. I have a data frame consisting of 108 columns that I would like to convert to a long table and remove the metadata (embedded in the column names of the wide table) to new metadata

Re: [R] Least Squares Restricted Estimator

2008-05-19 Thread Bert Gunter
Nelson: 1. Please read the posting guide: your question is practically unintelligible. You are far more likely to get a useful response if you follow its recommendations. 2. However, I'll make a stab. **If** what you mean is simply to be able to choose arbitrary contrasts to estimate in linear

Re: [R] reshape a wide data frame from wide to a long format with metadata columns

2008-05-19 Thread hadley wickham
Hi Alan, I have a general question about reshaping a wide data frame using the reshape command. I have a data frame consisting of 108 columns that I would like to convert to a long table and remove the metadata (embedded in the column names of the wide table) to new metadata columns in the

[R] Error in building library - R CMD build mypkg.

2008-05-19 Thread Ajay DAS
Hi, I am getting an error when I am trying to build a library in R for windows . I am using R 2.7.0 in windows. I am following the instructions listed in the R Help for package creation. require(stats) ## two functions and two data sets : f - function(x,y) x+y g - function(x,y) x-y d -

Re: [R] RSQLite and undefined symbol:sqlite3_bind_in

2008-05-19 Thread Marc Carlson
Hi Maya, You might want to post emails about specialized bioconductor packages to the bioconductor mailing list. You can sign up for it here: http://www.bioconductor.org/docs/mailList.html Please post your question over there and also tell us: how did you install RSQLite? Did you use

[R] Re : three-dimensional (volumetric) estimation from x,y,z

2008-05-19 Thread francois Guilhaumon
You may use the geometry package and the convhulln function. This will allow you to compute the convex hull volume of a set of points in a n-dimensional space. -- Guilhaumon François Laboratoire Ecosystèmes Lagunaires UMR 5119 cc 93 Bat 24 Université Montpellier II 34 095 Montpellier France

[R] how can i sort a column of data.frame ?

2008-05-19 Thread hanen
i have a data.frame with several columns that i want to sort one of them (one column) by descending order in such way that this sorting out recover all colums. what should i do? -- View this message in context:

Re: [R] how can i sort a column of data.frame ?

2008-05-19 Thread Dieter Menne
hanen hanen.mastouri at yahoo.fr writes: i have a data.frame with several columns that i want to sort one of them (one column) by descending order in such way that this sorting out recover all colums. what should i do? Maybe I missed something special you need, because I don't fully

Re: [R] how can i sort a column of data.frame ?

2008-05-19 Thread Weidong Gu
? order df-data.frame(a=rnorm(20),b=rpois(20,5),c=runif(20)) or-order(df$b,decreasing=T) df.or-df[or,] Weidong Gu Department of Medicine University of Alabama, Birmingham 1900 University Blvd., Birmingham, Alabama 35294 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] question for Logic Regression

2008-05-19 Thread coldeyes
thanks for you response, i try predict command, it is doesn't work. i list a simulate code below: X - matrix(as.numeric(runif(400) 0.5), 50,8) colnames(X) - paste(X, 1:ncol(X), sep=) rownames(X) - paste(case, 1:nrow(X), sep=) # Define expected result: Y = (NOT X2) AND X6 Y -

[R] How to get confidence interval and coefficient in Logic Regression

2008-05-19 Thread coldeyes Liao
sorry to bother everyone. i have question to get the coefficient and confidence interval in Logic Regression with Logistic model. below i list the R code X - matrix(as.numeric(runif(400) 0.5), 50,8) colnames(X) - paste(X, 1:ncol(X), sep=) rownames(X) - paste(case, 1:nrow(X), sep=) # Define

Re: [R] heatmap on pre-established hclust output?

2008-05-19 Thread Gregory. R. Warnes
Try this: library(gplots) x - as.matrix(USArrests) hc - hclust(dist(USArrests), ave) dend1 - as.dendrogram(hc) heatmap.2(x, Rowv=dend1) -G On May 16, 2008, at 12:23PM , Jeremiah Rounds wrote: To: [EMAIL PROTECTED] From: [EMAIL PROTECTED] Date: Fri, 16 May 2008 17:55:26 +0200

[R] i want to export a data.frame to file.xls

2008-05-19 Thread hanen
in order to export a data.frame to sheet.xls i try: write(df,file=file_name.xls) but when i open it a message appears: impossible to oppen this file. her format is unvalid knowen that i work with excel_2007 what is the solution ? -- View this message in context:

[R] Help on nested FOR loops

2008-05-19 Thread Philip Twumasi-Ankrah
I am new to more radical programming in R. I am trying to write a nested 'for' loop to produce output that takes subscripts like: for i taking values 1,2,3,4,5 and j taking values 1,2,3 I want to output for a computation using the combination values of i and j a value x like this; i j

[R] recoding data with loops

2008-05-19 Thread Donald Braman
# I'm new to R and am trying to get the hang of how it handles # dataframes loops. If anyone can help me with some simple tasks, # I'd be much obliged. # First, i'd like to generate some random data in a dataframe # to efficiently illustrate what I'm up to. # let's say I have six variables as

Re: [R] Help on nested FOR loops

2008-05-19 Thread Henrique Dallazuanna
Try: paste(x, as.vector(t(outer(1:4, 1:3, FUN=paste, sep=))), sep=) or paste(x, apply(expand.grid(1:4, 1:3), 1, paste, collapse=), sep=) On Mon, May 19, 2008 at 4:40 PM, Philip Twumasi-Ankrah [EMAIL PROTECTED] wrote: I am new to more radical programming in R. I am trying to write a nested

Re: [R] labels in multiple plot

2008-05-19 Thread Bruno C.
Yep sorry I need to use the legend command but am not so good at: Given this pseudo-code: point_type-c(black,gray20,red) ... for (i in 1:dim(m)[1]) { par(pch=(18+i)) par(fg=point_type[i]) plot(m[i,], type='b', ylim = c(lower, upper), type = l,

Re: [R] recoding data with loops

2008-05-19 Thread Bert Gunter
If you're serious, start by reading the docs, especially An Introduction to R. There are also other learning resources listed on CRAN. -- Bert gunter Genentech -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Donald Braman Sent: Monday, May 19, 2008

Re: [R] recoding data with loops

2008-05-19 Thread Donald Braman
Thanks for quick response! I have done. I have tried many configurations of the various examples given there, but the examples are pretty short and none explain how to loop through nonconsecutive variables in a data frame. I've also read dozens of pages that come up when I google data.frame

Re: [R] i want to export a data.frame to file.xls

2008-05-19 Thread Jorge Ivan Velez
Hi Hanen, Take a look at ?write.table. Also, try this: write.table(df,file_name.xls,col.names=FALSE,row.names=FALSE,sep=\t) or write.table(df,file_name.xls,sep=\t) HTH, Jorge On Mon, May 19, 2008 at 3:27 PM, hanen [EMAIL PROTECTED] wrote: in order to export a data.frame to sheet.xls i

Re: [R] i want to export a data.frame to file.xls

2008-05-19 Thread Blay
hanen wrote: in order to export a data.frame to sheet.xls i try: write(df,file=file_name.xls) but when i open it a message appears: impossible to oppen this file. her format is unvalid knowen that i work with excel_2007 what is the solution ? Hi, write.csv(df,filename.csv)

Re: [R] recoding data with loops

2008-05-19 Thread Erik Iverson
Hello - Donald Braman wrote: # I'm new to R and am trying to get the hang of how it handles # dataframes loops. If anyone can help me with some simple tasks, # I'd be much obliged. # First, i'd like to generate some random data in a dataframe # to efficiently illustrate what I'm up to. #

[R] [R-pkgs] Updated package adimpro

2008-05-19 Thread Karsten Tabelow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This package implements tools for manipulationg digital images and the Propagation Separation approach for smoothing digital images. Version 0.6.1 is a major update with many new features: Input/Output: - - we now keep exif information as comment

[R] [R-pkgs] Updated package fmri

2008-05-19 Thread Karsten Tabelow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 fmri is a contributed package for R, that implements functions for analyzing single-subject fmri data with structural adaptive smoothing methods. New in version 1.2-6 - ~ - new function cutroi() ~ - plot.fmridata() is now

[R] [R-pkgs] New package dti

2008-05-19 Thread Karsten Tabelow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 dti is a new contributed package for R, that implements functions for smoothing Diffusion-weighted MR data with structural adaptive smoothing methods. Version 0.5-2 contains functions for smoothing DW data in the context of the Diffusion Tensor

Re: [R] recoding data with loops

2008-05-19 Thread Donald Braman
Many thanks -- You are right; I had rnorm() and sample() mixed up in my code. I'll work on generating a normal ordinal sample next. Cheers, Don On Mon, May 19, 2008 at 4:07 PM, Erik Iverson [EMAIL PROTECTED] wrote: Hello - Donald Braman wrote: # I'm new to R and am trying to get the hang

[R] Histograms without bars

2008-05-19 Thread Andre Nathan
Hello I'd like to plot a histogram of some data composed of real numbers. The bin width I'm using is ~ 0.01, which results in high values in the y axis, so that the area under each bar corresponds to the probability of the data in that range. Is is possible to plot points whose y coordinate

Re: [R] labels in multiple plot

2008-05-19 Thread Greg Snow
Try: m - matrix( rnorm(30, rep(c(10,12,15), 10)), nrow=3 ) matplot(y=t(m), pch= rep(19:21, 10), type='b', col=c('red','green','blue')) legend('bottomright', legend=c('ABC','DEF','GHI'), pch=19:21, + col=c('red','green','blue')) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

Re: [R] interactive rotatable 3d scatterplot

2008-05-19 Thread Duncan Murdoch
On 16/05/2008 6:43 PM, Ben Bolker wrote: francois Guilhaumon francoisguilhaumon at gmail.com writes: I am facing the same problem than Mark Kimpel with the rgl package : Running various 3D rendering I'm always faced with a static 3d plot, which does not rotate when I click and mouse over it.

Re: [R] recoding data with loops

2008-05-19 Thread Donald Braman
Erik, Your example was just what I needed to generate the data -- many, many thanks! The names() function was something I had not grasped fully. I now have this and it works very nicely: var_list - c(HEQUAL, EWEALTH, ERADEQ, HREVDIS1, EDISCRIM, HREVDIS2) mdf -

Re: [R] question for Logic Regression

2008-05-19 Thread Yasir Kaheil
try: alltrees - predict(logicfit) coldeyes wrote: thanks for you response, i try predict command, it is doesn't work. i list a simulate code below: X - matrix(as.numeric(runif(400) 0.5), 50,8) colnames(X) - paste(X, 1:ncol(X), sep=) rownames(X) - paste(case, 1:nrow(X), sep=)

Re: [R] R is a virus, spyware or malware (gasp!)

2008-05-19 Thread Tony Plate
And the installed Rgui.exe in 2.6.2 is 10240 bytes, which is their most common file size. They also say (fill in your own comments...): RGUI.EXE has been seen to perform the following behavior(s): * Can communicate with other computer systems using HTTP protocols * This Process

[R] Draw Polygon with a Circular Side

2008-05-19 Thread ermimi
Hello Friends!!! I would want draw a circular histogram, and I would like draw a polygon with a circular side. This is easy if I use the functions polygon and arc, but I want that the polygon with a circular side have background colour. The polygon created with function polygon can have

Re: [R] Histograms without bars

2008-05-19 Thread Charilaos Skiadas
Hi Andre, On May 19, 2008, at 4:28 PM, Andre Nathan wrote: Hello I'd like to plot a histogram of some data composed of real numbers. The bin width I'm using is ~ 0.01, which results in high values in the y axis, so that the area under each bar corresponds to the probability of the data

Re: [R] R is a virus, spyware or malware (gasp!)

2008-05-19 Thread Daniel Nordlund
I looked at the home website and found a contact form which someone could use to inform the company of the error of their ways. http://www.prevx.com/contactus.asp I will leave it to those who may be better equipped to deal with any replies from the company to contact them. Dan Daniel

Re: [R] Help on nested FOR loops

2008-05-19 Thread Julian Burgos
Hey Philip, I'm not sure if I understand what your x11, x12, etc. are. You can combine the values of your two vectors using the expand.grid function. There is no need to do nester FOR loops: i=c(1,2,3,4,5) j=c(1,2,3) x=expand.grid(i,j) print (x) Var1 Var2 1 11 2 21 3

[R] R static is dynamically linked!!

2008-05-19 Thread George Georgalis
Hi, After doing all I could find with the confiure script... I set some env too... export enable_R_static_lib=yes export want_R_static=yes export WANT_R_STATIC_TRUE=yes ./configure \ --prefix=${i} \ --enable-R-static-lib \ --enable-static \ --without-readline \

[R] useR! 2008: abstracts online

2008-05-19 Thread Achim Zeileis
Dear useRs, we are happy to inform you that an overview of the presentations (including all abstracts) for the useR! 2008 conference in Dortmund (August 12-14) is now available online at http://www.R-project.org/useR-2008/presentations.html (A more detailed program will become available in the

[R] 2.7.0 graphics changes and png devices

2008-05-19 Thread Oliver Soong
Hi, I have a question about the graphics changes in 2.7.0. The example is this bit of code: par(mfcol = c(2, 3)) for(i in 1:6) plot(1:10, 1:10, xlab = xlab, ylab = ylab, main = main) In 2.7.0, if I do this interactively (using windows()), I get bold titles. If I do this through a png device,

Re: [R] 2.7.0 graphics changes and png devices

2008-05-19 Thread Oliver Soong
Apologies for the double-post, but I figured I should be slightly more specific. I'm using the windows version of 2.7.0 and 2.6.2. My calls to png is simply png(2.7.0.png) and png(2.6.2.png), respectively, followed by the appropriate dev.off(). Oliver On 5/19/08, Oliver Soong [EMAIL

[R] boxplot subsets

2008-05-19 Thread Phil taylor
Hello, I am a new user to R and have a(proabably very basic) question relating to a boxplot with eleven sites in a river system where i measured Chlorophyll a concentrations. The eleven sites are made up of three sites above a point source pollution site; three sites below this pollution

[R] Need help in matrix multiplication error

2008-05-19 Thread Jason Lee
Hi, I have a data file which is named test.txt as below. Prior to that, I have converted the last row from nominal to numeric using as.integer. Statement T1001 T1002 T1003 T1004 T1005 T100 T1014 T1021 T1022 T1023 1 0 0 0 0 0 00 0 1 0 0 20

Re: [R] recoding data with loops

2008-05-19 Thread Erik Iverson
Got it, I did not know of the 'recode' function in car. So you would like to recode those specific columns then? Once again, we can do it without a loop, this time with the help of a function called lapply, which applies a function to each item in a list in turn. Try: reverse_me_varnames -

Re: [R] Histograms without bars

2008-05-19 Thread hadley wickham
Is is possible to plot points whose y coordinate correspond to that probability, instead of plotting the histogram bars? In other words, instead of having a bar of width 0.01 and height, say, 80, I'd like to have a single point at y = 0.8. Very easily with ggplot2: install.packages(ggplot2)

Re: [R] R static is dynamically linked!!

2008-05-19 Thread George Georgalis
On Mon 19 May 2008 at 06:39:39 PM -0400, George Georgalis wrote: Hi, After doing all I could find with the confiure script... I set some env too... export enable_R_static_lib=yes export want_R_static=yes export WANT_R_STATIC_TRUE=yes ./configure \ --prefix=${i} \

[R] contr.treatments query

2008-05-19 Thread Ted Harding
Hi Folks, I'm a bit puzzled by the following (example): N-factor(sample(c(1,2,3),1000,replace=TRUE)) unique(N) # [1] 3 2 1 # Levels: 1 2 3 So far so good. Now: contrasts(N)-contr.treatment(3, base=1, contrasts=FALSE) contrasts(N) # 1 2 # 1 1 0 # 2 0 1 # 3 0 0 whereas: contr.treatment(3,

Re: [R] recoding data with loops

2008-05-19 Thread Donald Braman
Many, many thanks Erik! For anyone who is searching around looking for a way to recode in R, here's the full code Erik provided: var_list - c(HEQUAL, EWEALTH, ERADEQ, HREVDIS1, EDISCRIM, HREVDIS2) ## my original list of variables mdf - data.frame(replicate(length(var_list), sample(7,100,

Re: [R] Need help in matrix multiplication error

2008-05-19 Thread jim holtman
Is this what you want: you need the 'drop=FALSE' to make sure it stays a matrix. data - read.table(textConnection( Statement T1001 T1002 T1003 T1004 T1005 T100 T1014 T1021 T1022 T1023 + 1 0 0 0 0 0 00 0 1 0 0 + 20 0 0 0 0

Re: [R] 2.7.0 graphics changes and png devices

2008-05-19 Thread Prof Brian Ripley
The titles are in bold. Because the text is small, the weight is lower than in full-sized plots. The difference from 2.6.2 is that the text is correctly sized for the default 72dpi plots. Try something like png(width=7, height=7, units=in, res=96) for comparability with windows(). On