Re: [R] Hosmer- Lemeshow test

2008-09-17 Thread saggak
Dear Mr Frank,   I thank you for your prompt reply. However, I am not able to understand (may be since for me R is a new venture) the contents of your reply. If its a book you are referring to, I don't have access to it. How do I get @ARTICLE{hos97com and how do I run it in R?   Thanking you

Re: [R] R on a eeepc 901 ?

2008-09-17 Thread Sigbert Klinke
Hi, it seems that the directions in http://wiki.r-project.org/rwiki/doku.php?id=getting-started:installation:eeepc refer to installing R on a eeepc 701 and actually Yes, it does :) fail for a 901 at the first step. What exactly failed? You are actually do not need the KDE desktop.

Re: [R] rpart with only two small groups

2008-09-17 Thread Birgitle
Thanks Gavin and sorry to all for this unnecessary question. B. Gavin Simpson wrote: On Tue, 2008-09-16 at 10:47 -0700, Birgitle wrote: Hello R-User! I try to do the following: New-iris[c(1:7,90:97),1:5] New.rpart-rpart(Species~., data=New, method=class) New.rpart n= 15

Re: [R] R on a eeepc 901 ?

2008-09-17 Thread Dr Eberhard Lisse
Agustin, which EEE PC 901 is it? The one for Windoze or Linux (Xandros)? el on 9/16/08 6:50 PM Agustin Lobo said the following: Hi! it seems that the directions in http://wiki.r-project.org/rwiki/doku.php?id=getting-started:installation:eeepc refer to installing R on a eeepc 701 and

Re: [R] HI

2008-09-17 Thread nalluri pratap
If you have read the table as a data frame say, DF then the following should work   DF[DF==0]-NA --- On Tue, 16/9/08, Amit Patel [EMAIL PROTECTED] wrote: From: Amit Patel [EMAIL PROTECTED] Subject: [R] HI To: r-help@r-project.org Date: Tuesday, 16 September, 2008, 7:02 PM Does anyone know an

Re: [R] Different PCA results under Windows and Linux

2008-09-17 Thread Peter Dalgaard
Steven McKinney wrote: Not likely that anyone can explain, as there is not enough information in your email. Including the contents of the freqtest.txt file was a good idea, as the posting guide suggests (the posting guide is that clearly labeled bit at the bottom that looks like this:

Re: [R] question in value-based color in image()

2008-09-17 Thread Jim Lemon
M. wrote: Hello, I have a matrix A with value varying from -1 to 1. I hope to use scaled color based on its value to produce an image of this matrix. Suppose I hope to label those data in [-1,-0.5] with blue, label those [-0.5,0.8] with light blue (tone is proportional to its value, e.g.

[R] [ess] no waiting after submitting the command

2008-09-17 Thread whizvast
hi, useRs- i am using R with emacs/ESS (on xubuntu). currently, when i send a large script to ESS process, i have to wait for the whole script to finish. is there a way to immediately return to the editing window after submitting? if there is, how do i set it permanently? thank you in

[R] Exact test in nxm contingency table

2008-09-17 Thread Magnus Pettersson
Hello, I am trying to find a permutation test that works on a general nxm table. The data set is small enough to have cells with too small counts to make chi2-approximation invalid. If the table was a 2x2 contingency table I would like to use a Fsher exact test (fisher.test) but that wont work

[R] adding rows to table

2008-09-17 Thread Galanidis Alexandros
Greetings everyone, I'm trying to add a specific table or a specific number of rows (e.g.44) to a table with no success. This is my basic table head(dataA) yearplot spp prop.BDCA1DCA2DCA3DCA4 1 20001 a1 0.031079 -0.0776 -0.0009 0.0259 -0.0457 2 2000

[R] Question about panel.points

2008-09-17 Thread Ptit_Bleu
Hello, I'm trying to plot graphs using lattice with this script : xyplot(Y ~ X | factmod, panel = function(x, y) { panel.grid(h=-1, v=-1, col=gray) panel.xyplot(x, y, type=p, pch=20) panel.points(50,Idata, data=devdata, col=red) - this

Re: [R] Exact test in nxm contingency table

2008-09-17 Thread Søren Højsgaard
Using r2dtable() you can simulate general tables nxm with given margins. Based on these you acn calculate a Monte Carlo p-value for a conditional test for independence. Regards Søren -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Magnus

[R] ggplot2 - deprecated guide= argument in

2008-09-17 Thread Pedro Barros
In the help for scale_fill_identity, it is written ## Not run: colour - c(red,green,blue,yellow) qplot(1:4, 1:4, fill=colour, geom=tile) qplot(1:4, 1:4, fill=colour, geom=tile) + scale_fill_identity() # To get a legend, you also need to supply the

[R] adding rows to table

2008-09-17 Thread Galanidis Alexandros
Greetings everyone, I'm trying to add a specific table or a specific number of rows (e.g.44) to a table with no success. This is my basic table head(dataA) yearplot spp prop.BDCA1DCA2DCA3DCA4 1 20001a1 0.031079 -0.0776 -0.0009 0.0259 -0.0457 2

Re: [R] Converting Geo-Coordinates Unities

2008-09-17 Thread Roger Bivand
Rodrigo Aluizio r.aluizio at gmail.com writes: Thanks for the elucidation James. After reading the .pdf of proj4 and your answer, I believe I won't need proj4 package. Well, I still don't know all the kind of transformations we will need here. I'm just getting prepared to future data

Re: [R] Car.proper C[] matrix

2008-09-17 Thread Roger Bivand
Jason Gasper Jason.Gasper at noaa.gov writes: Here is the WinBUGS code Uwe Ligges wrote: If you want that people help to translate *code*, you have to specify it ... Uwe Ligges Please look at the nb2WB() function in the spdep package, I think that you'll find that it provides

Re: [R] creating horizontal dataframes with column names

2008-09-17 Thread Ted Harding
On 17-Sep-08 05:27:40, Alexy Khrabrov wrote: Exactly -- also found creating horizontal vector helps: df - data.frame(matrix(1:5,nrow=1)) colnames(df) - LETTERS[1:5] df A B C D E 1 1 2 3 4 5 Thanks, Alexy Another (though similar) approach (e.g. if you want to build up the

[R] Extracting subsets by factor level?

2008-09-17 Thread Rory.WINSTON
Hi I have a data frame which looks like the following (it is a table of commit logs to a source repo). The Author column is treated as a factor, by virtue of stringsAsFactors being set to TRUE, so I can extract the number of commits per author by using table(logs$Author). Is there an elegant

Re: [R] Extracting subsets by factor level?

2008-09-17 Thread Peter Dalgaard
[EMAIL PROTECTED] wrote: Hi I have a data frame which looks like the following (it is a table of commit logs to a source repo). The Author column is treated as a factor, by virtue of stringsAsFactors being set to TRUE, so I can extract the number of commits per author by using

Re: [R] Exact test in nxm contingency table

2008-09-17 Thread Peter Dalgaard
Søren Højsgaard wrote: Using r2dtable() you can simulate general tables nxm with given margins. Based on these you acn calculate a Monte Carlo p-value for a conditional test for independence. Regards Søren fisher.test(, simulate.p.value=TRUE) might be more direct. Also works for

Re: [R] Loop on vector name

2008-09-17 Thread Henrique Dallazuanna
Try this: sapply(ls(patt=^dat[0-9]), function(x)sd(get(x))) On Wed, Sep 17, 2008 at 8:50 AM, Megh Dal [EMAIL PROTECTED] wrote: [My previous message rejected, therefore I am sending same one with some modification] I have 3 vectors with object name : dat1, dat2, dat3 Now I want to create a

Re: [R] Loop on vector name

2008-09-17 Thread Dimitris Rizopoulos
you need to get(), e.g., try this: dat1 - rnorm(5) dat2 - rnorm(6) dat3 - rnorm(7) lis - lapply(paste(dat, 1:3, sep = ), get) lis sapply(lis, sd) I hope it helps. Best, Dimitris Megh Dal wrote: [My previous message rejected, therefore I am sending same one with some modification] I have

Re: [R] Hosmer- Lemeshow test

2008-09-17 Thread Frank E Harrell Jr
saggak wrote: Dear Mr Frank, I thank you for your prompt reply. However, I am not able to understand (may be since for me R is a new venture) the contents of your reply. If its a book you are referring to, I don't have access to it. How do I get @ARTICLE{hos97com and how do I run it in R?

[R] rgl: plot3d and ellipse3d

2008-09-17 Thread Michael Friendly
Hi I'm trying to make a 3d plot showing a point cloud, the corresponding data ellipse and the principal axes of the ellipse as vectors. library(rgl) data(trees) cov - cov(trees) mu - mean(trees) plot3d(trees, type=s, size=0.5, col=blue, cex=2) In this step, an extra box is added. I've tried

Re: [R] rgl: plot3d and ellipse3d

2008-09-17 Thread Yihui Xie
Hi Michael, You need to specify both 'box' and 'axes' to FALSE to avoid the box lines (if you don't specify the latter one, there will still be axes lines). Best, Yihui -- Yihui Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage:

[R] Dealing with missing EOL at end of file

2008-09-17 Thread Dennis Fisher
Colleagues, I am using R 2.7.2 on all three platforms (OS X; Windows; Linux) and I have encountered the following problem: I use R to issue a system call the execute a command in the OS. For example: system(DOSOMETHING TOSOMEFILE) In most situations, this task completes successfully and

[R] unix-type commandline keystrokes in the windows RGUI

2008-09-17 Thread mfrumin
Hi all, I am generally quite fond of the unix commandline keystrokes (e.g. searching back in your history with [CTRL]-R, and cutting/pasting with [CTRL]-K/Y) which work in the R commandline in *nix. Does anyone know if there's any way to get similar functionality in the Windows RGUI? I know

Re: [R] rgl: plot3d and ellipse3d

2008-09-17 Thread Michael Friendly
Yihui Xie wrote: Hi Michael, You need to specify both 'box' and 'axes' to FALSE to avoid the box lines (if you don't specify the latter one, there will still be axes lines). Hi Yihui I tried several variations, none of which would simply add the ellipse and nothing else to the original

Re: [R] rgl: plot3d and ellipse3d

2008-09-17 Thread Yihui Xie
No, I mean in plot3d(): plot3d(trees, type=s, size=0.5, col=blue, cex=2, box=FALSE, axes=FALSE) not in ellipse3d() Yihui -- Yihui Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037,

Re: [R] unix-type commandline keystrokes in the windows RGUI

2008-09-17 Thread Adaikalavan Ramasamy
Why not use a script? I feel that it is much better than using the history via [CTRL]-R in unix, which also pulls up errorneous commands. A script is vital for statistical analysis and research where you may want to or be asked to repeat or reproduce the analysis months later. Rgui (on

[R] using for variable as rowname

2008-09-17 Thread Ralikwen
Is there a way to use the cycle variable for rowname? v=1:6 for (a in 1:3){ for (b in 4:5) { v=rbind(v,a.b=1) } } v This above obviously does not work, but I couldn't find out how to use a and b to construct a rowname like 14, 15, 24, 25. Thanks for the help. Balazs -- View this message

Re: [R] using for variable as rowname

2008-09-17 Thread Richard . Cotton
Is there a way to use the cycle variable for rowname? v=1:6 for (a in 1:3){ for (b in 4:5) { v=rbind(v,a.b=1) } } v This above obviously does not work, but I couldn't find out how to use a and b to construct a rowname like 14, 15, 24, 25. Not pretty, but this does the trick.

Re: [R] using for variable as rowname

2008-09-17 Thread Ted Harding
On 17-Sep-08 14:22:11, Ralikwen wrote: Is there a way to use the cycle variable for rowname? v=1:6 for (a in 1:3){ for (b in 4:5) { v=rbind(v,a.b=1) } } v This above obviously does not work, but I couldn't find out how to use a and b to construct a rowname like 14, 15, 24,

[R] Unexpected behaviour when testing for independence with multiple factors

2008-09-17 Thread Javier Acuña
Hi, I'm a new user of R. My background is Electrical Engineering, so please bear with me if this is a silly question. I'm trying to assess whether the results of an experiment satisfy the hypothesis of homoscedasticity (my ultimate goal is to use ANOVA). The result of the experiment is mean

Re: [R] RCurl compilation error on ubuntu hardy

2008-09-17 Thread Vincent Goulet
Emmanuel, Please see inline for comments. Le mer. 17 sept. à 00:59, Emmanuel Levy a écrit : Dear list members, I encountered this problem and the solution pointed out in a previous thread did not work for me. (e.g. install.packages(RCurl, repos = http://www.omegahat.org/R;) I work with

[R] How to replicate probit regression analysis done by the priprobit software using R?

2008-09-17 Thread Jenny Tan
I wonder if anyone is familiar with the priprobit software (Sakuma M. 1998. Probit analysis of preference data. Appl Entomol Zool. 33:339–34). I would like to replicate the same analysis and output in R. Of note, I want to determine the analytical sensitivity, defined as 95% cut-off value. j

[R] Inserting new values in the place of NULL

2008-09-17 Thread Rajasekaramya
Hi there, I have a dataframe D.F1 dim (D.F1) 14351 9 This dataframe has values and for some 1000 rows it holds NULL values.I hace found the missing values for about 500 and have those in another dataframe D.F.sub.2 dim(D.F.sub.2) 500 9 as dataframe is a subset of D.F1 the coulmn 1 in

Re: [R] rgl: plot3d and ellipse3d

2008-09-17 Thread Duncan Murdoch
On 9/17/2008 9:40 AM, Michael Friendly wrote: Yihui Xie wrote: Hi Michael, You need to specify both 'box' and 'axes' to FALSE to avoid the box lines (if you don't specify the latter one, there will still be axes lines). Hi Yihui I tried several variations, none of which would simply add

Re: [R] Question about panel.points

2008-09-17 Thread Richard . Cotton
I'm trying to plot graphs using lattice with this script : xyplot(Y ~ X | factmod, panel = function(x, y) { panel.grid(h=-1, v=-1, col=gray) panel.xyplot(x, y, type=p, pch=20) panel.points(50,Idata, data=devdata, col=red) - this

Re: [R] trouble printing from graphics device in R 2.7.2

2008-09-17 Thread Tom Fletcher
Is there a setting change (or other minor fix) that can be done without an install of either the patched or development versions to address the printing issue described below. It is my understanding that these versions are 'source code' and not compiled for 'easy' installation. Thanks Tom

[R] inserting values for null

2008-09-17 Thread Rajasekaramya
I have a dataframe D.F1 dim (D.F1) 14351 9 This dataframe has values and for some 1000 rows it holds NULL values.I hace found the missing values for about 500 and have those in another dataframe D.F.sub.2 dim(D.F.sub.2) 500 9 as dataframe is a subset of D.F1 the coulmn 1 in D.F.sub.2 is a

Re: [R] RCurl compilation error on ubuntu hardy

2008-09-17 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Emanuel. The best thing to do is upgrade to R-2.7.2 (or any 2.7.*) and the problem should disappear. It relates to encoding of strings. D. Emmanuel Levy wrote: Dear list members, I encountered this problem and the solution pointed out

Re: [R] How to find the index

2008-09-17 Thread Greg Snow
Others have told you about order, also note that order(order(x)) gives the indexes to return a sorted x variable back to its original order. Hope this helps, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Peng Jiang Sent: Tuesday,

[R] Reference design with technical and bilogical replicates

2008-09-17 Thread Radolf,Martin
Hi, I would be extremely grateful if somebody can help with following problem. We have done an experiment using a reference design with technical and biological replicates where the target file looks like this: FileName Cy3 Cy5 xxx A REF xxx

[R] Spectrum of a kernel

2008-09-17 Thread rkevinburton
For purely educational purposes I would like to see the spectrum of a kernel. I tried: spectrum(kernel(daniell, 100), taper=0, log=no) but I get: Error in complete.cases(object) : not all arguments have the same length I can plot the kernel but that is only in the time-domain. I would like to

Re: [R] Blank certain areas of a contour plot

2008-09-17 Thread Greg Snow
After you have interpolated your data, replace the values in the areas of the ocean with NA, then filled.contour will not plot in those areas. Hope this helps, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Victor Homar Sent: Tuesday,

Re: [R] ggplot2 - deprecated guide= argument in

2008-09-17 Thread hadley wickham
On Wed, Sep 17, 2008 at 5:34 AM, Pedro Barros [EMAIL PROTECTED] wrote: In the help for scale_fill_identity, it is written ## Not run: colour - c(red,green,blue,yellow) qplot(1:4, 1:4, fill=colour, geom=tile) qplot(1:4, 1:4, fill=colour, geom=tile) +

[R] t-test between percentages

2008-09-17 Thread Bunny, lautloscrew.com
Hi all, though i know this is a simple question, i really hope someone could. I am just trying to compare percents respectively the difference in percents by a simple test. t.test usually compares means and is working like it is supposed to be. Now i wonder how i can use a test in R to

Re: [R] unix-type commandline keystrokes in the windows RGUI

2008-09-17 Thread David Winsemius
On Sep 17, 2008, at 9:26 AM, mfrumin wrote: Hi all, I am generally quite fond of the unix commandline keystrokes (e.g. searching back in your history with [CTRL]-R, and cutting/pasting with [CTRL]- K/Y) which work in the R commandline in *nix. Does anyone know if there's any way to

Re: [R] t-test between percentages

2008-09-17 Thread Bert Gunter
Sounds like a homework problem. Consult any basic statistics text. Hint: You don't use a t-test to test for a difference in percentages. Check chi-squared and/or contingency table. Cheers, Bert Gunter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

Re: [R] unix-type commandline keystrokes in the windows RGUI

2008-09-17 Thread mfrumin
Adaikalavan, thanks. Perhaps I was not so specific enough in what I want, for those not so familiar with unix commandline featuers. I'm looking for the 'reverse search' functionality where you hit CTRL-R, then start typing a bit of text and it finds previous commands with that bit of text,

Re: [R] unix-type commandline keystrokes in the windows RGUI

2008-09-17 Thread Vincent Goulet
Look at GNU Emacs with ESS, you'll get what you want out of the box --- and much more! See http://vgoulet.act.ulaval.ca/en/emacs [shameless plug] for a distribution of Emacs bundled with ESS. HTH Vincent Le mer. 17 sept. à 09:26, mfrumin a écrit : Hi all, I am generally quite

Re: [R] t-test between percentages

2008-09-17 Thread David Winsemius
On Sep 17, 2008, at 12:41 PM, Bunny, lautloscrew.com wrote: Hi all, though i know this is a simple question, i really hope someone could. I am just trying to compare percents respectively the difference in percents by a simple test. t.test usually compares means and is working like it is

[R] rgl: How to position a window during open3d call

2008-09-17 Thread Koen Stegen
Dear all, The documentation on the function open3d in the rgl package, reads: open3d opens a new rgl device, and sets the parameters as requested. I want the new rgl device (window) to be sized and positioned in a specific place on my screen. So, I try to set the windowRect parameter as

[R] selecting dataframe values that are not nulls

2008-09-17 Thread Rajasekaramya
Hi, I have a dataframe with 14319rows and 9 colums. for some rows there are null values.I want a dataframe without these null values.I wanna select only those that have values !=NA. kindly let me know how to do that. Ramya -- View this message in context:

[R] Graphical Display of Values' Distribution

2008-09-17 Thread Steve Murray
Dear all, I have a column within a dataframe of values which range between 1 and 2. I want to display graphically the distribution of these values (i.e. are they clustered towards either exteme? Or spread evenly?). What is a good way of doing this in R? I've tried a few things, including

Re: [R] Car.proper C[] matrix

2008-09-17 Thread jgasper
I have been using the nb2WB() package for the car.normal function in WinBUGS, but it will not create the C[] matrix; it only creates adj[], num[], and weights[]. I was planning on using this function to create the C[] matrix (by using the num matix) required for the car.proper, but I got slipped

[R] Command Prompt Question

2008-09-17 Thread Farr, David
Could someone please tell me how to stop the package/function name from being included before the command prompt? This started happening today after I made some changes to my Rprofile.site file and I don't know why. For example: if I enter example(AIC), instead of just getting the regular ''

[R] R 2.8.0 is scheduled for October 20

2008-09-17 Thread Peter Dalgaard
This is to announce that we plan to release R version 2.8.0 on Monday, October 20, 2008. Release procedures start Friday, September 19. The detailed schedule can be found on http://developer.r-project.org The source tarballs will be made available daily (barring build troubles) and the tarballs

Re: [R] rgl: How to position a window during open3d call

2008-09-17 Thread Duncan Murdoch
On 9/17/2008 1:13 PM, Koen Stegen wrote: Dear all, The documentation on the function open3d in the rgl package, reads: open3d opens a new rgl device, and sets the parameters as requested. I want the new rgl device (window) to be sized and positioned in a specific place on my screen. So, I

Re: [R] unix-type commandline keystrokes in the windows RGUI

2008-09-17 Thread Richard M. Heiberger
Mike, There are several options to pursue, depending on your answer to the question: Why are you staying within the Rgui if you are already an Emacs ESS user? 1. If you don't need any other feature of Rgui on Windows, then don't use it. From emacs, enter M-x R and you will immediately

Re: [R] Command Prompt Question

2008-09-17 Thread Peter Dalgaard
Farr, David wrote: Could someone please tell me how to stop the package/function name from being included before the command prompt? This started happening today after I made some changes to my Rprofile.site file and I don't know why. For example: if I enter example(AIC), instead of just

Re: [R] Creating smooth color regions with panel.contourplot()

2008-09-17 Thread Deepayan Sarkar
On 9/15/08, Waichler, Scott R [EMAIL PROTECTED] wrote: When I use panel.contourplot() with filled color regions, the coloring follows the stair-step edge of the underlying grid instead the smooth contour lines themselves. How can I get the latter behavior? I would guess there is a much

Re: [R] Command Prompt Question

2008-09-17 Thread Duncan Murdoch
On 9/17/2008 1:42 PM, Farr, David wrote: Could someone please tell me how to stop the package/function name from being included before the command prompt? This started happening today after I made some changes to my Rprofile.site file and I don't know why. For example: if I enter example(AIC),

[R] Stacked Area Plot

2008-09-17 Thread Josip Dasovic
Hi: I've searched the archives and the Internet for hours but have yet to find a way to do stacked area plots (like the kind in Excel) in R. I think that polygon may work but it would require a bit of manipulation of my data. I was hoping for an easier way. An example of what I'm trying to

Re: [R] Stacked Area Plot

2008-09-17 Thread hadley wickham
On Wed, Sep 17, 2008 at 1:01 PM, Josip Dasovic [EMAIL PROTECTED] wrote: Hi: I've searched the archives and the Internet for hours but have yet to find a way to do stacked area plots (like the kind in Excel) in R. I think that polygon may work but it would require a bit of manipulation of

Re: [R] Graphical Display of Values' Distribution

2008-09-17 Thread Ben Bolker
Steve Murray smurray444 at hotmail.com writes: Dear all, I have a column within a dataframe of values which range between 1 and 2. I want to display graphically the distribution of these values (i.e. are they clustered towards either exteme? Or spread evenly?). What is a good way of

Re: [R] Different PCA results under Windows and Linux

2008-09-17 Thread Mark Difford
Hi Jathine, I hope this can explain the problem a bit more clearly. Why PCA gives different results on the two different platforms? What is amazing, Jathine, is how nearly exactly identical the two sets of results are, not that they begin to differ at the 16th decimal place. To assuage your

[R] Is there a way to not use an explicit loop?

2008-09-17 Thread Juancarlos Laguardia
I have a problem in where i generate m independent draws from a binomial distribution, say draw1 = rbinom( m , size.a, prob.a ) then I need to use each draw to generate a beta distribution. So, like using a beta prior, binomial likelihood, and obtain beta posterior, m many times. I

Re: [R] Graphical Display of Values' Distribution

2008-09-17 Thread Philipp Pagel
I have a column within a dataframe of values which range between 1 and 2. I want to display graphically the distribution of these values (i.e. are they clustered towards either exteme? Or spread evenly?). What is a good way of doing this in R? I've tried a few things, including using the

[R] A Simple Question

2008-09-17 Thread Gao, Aijun
Hi: I am trying to run your SCHOOLS example as following and I get an error message stated that : Error: could not find function bugs Would you please help me since I would like to run some WINBUG programs from your R by reading external data and I am new to R? Do I missing some function?

[R] Re adout row and column of a matrix value

2008-09-17 Thread Chris82
Hello R users, I want to readout the row and column postion from a certain matrix value into a csv file. I have only found this syntax which(a == b, arr.ind = T) so I get a = matrix [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,]11222112 [2,]123

Re: [R] Different PCA results under Windows and Linux

2008-09-17 Thread jathine
Thank you for your reply. Here are some more info, I hope this can explain the problem a bit more clearly. Why PCA gives different results on the two different platforms? freqtest.txt file line text : M1 M2 M3 M4 M5 M6 M7 M8 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 0 0

[R] Metadata in attributes or a list?

2008-09-17 Thread Thaden, John J
I wrote a function that reads data from a file and manipulates it to build and return a matrix with a million rows and three columns. I also need to return some metadata: these are about a half-dozen single numbers or short character strings, plus one numeric vector of length 5,000. I've been

Re: [R] Blank certain areas of a contour plot

2008-09-17 Thread Victor Homar
Thanks a lot for your suggestion but... Can I do that using the/a land-sea information from the 'worldHires' database (from mapdata)? Best, Víctor. Greg Snow wrote: After you have interpolated your data, replace the values in the areas of the o cean with NA, then

Re: [R] Different PCA results under Windows and Linux

2008-09-17 Thread Mark Difford
Hi Jathine, And then to see things more clearly still, you can do something like this on your test results: format(formatC(p1$var$coord, digits=15, format=f), justify=right) and format(formatC(p1$var$coord, digits=16, format=f), justify=right) Though I do hope that the second command doesn't

Re: [R] Re adout row and column of a matrix value

2008-09-17 Thread Jorge Ivan Velez
Hi Chris82, Try this: res=c(which(a == max(a), arr.ind = T),max(a)) names(res)=c('row','col','value') write.csv(res,C://yourfile.csv,row.names=TRUE) HTH, Jorge On Wed, Sep 17, 2008 at 1:47 PM, Chris82 [EMAIL PROTECTED] wrote: Hello R users, I want to readout the row and column postion

Re: [R] A Simple Question

2008-09-17 Thread Ben Bolker
Gao, Aijun Aijun.Gao at i3statprobe.com writes: Hi: I am trying to run your SCHOOLS example as following and I get an error message stated that : Error: could not find function bugs Would you please help me since I would like to run some WINBUG programs from your R by reading external

Re: [R] Blank certain areas of a contour plot

2008-09-17 Thread Duncan Murdoch
On 9/17/2008 2:29 PM, Victor Homar wrote: Thanks a lot for your suggestion but... Can I do that using the/a land-sea information from the 'worldHires' database (from mapdata)? Yes, you use the map.where function to identify the location of the points. If NA, it's out in the ocean

Re: [R] Is there a way to not use an explicit loop?

2008-09-17 Thread Victor Hernando Cervantes Botero
Hi, you might try this: set.seed(100) m - 10 size.a- 10 prob.a- 0.3 prior.constant = 0 draw1 = rbinom( m , size.a, prob.a ) beta.draws - function(draw, size.a, prior.constant, n) { rbeta(n, prior.constant + draw, prior.constant + size.a - draw) } bdraws -

Re: [R] Is there a way to not use an explicit loop?

2008-09-17 Thread Dan Davison
Both shape parameters of rbeta can be vectors; for x - rbeta(n, shape1, shape2) x[i] ~ Beta(shape1[i], shape2[i]) so bbsim - function(m=1000, num.post.draws=1e4, size.a=100, prob.a=.27, prior.count=1) { data.count - rbinom(m, size.a, prob.a) shape1 - rep(prior.count + data.count,

[R] fMultivar functions not loading under R-2.7

2008-09-17 Thread Theodore Van Rooy
I submitted this to rmetrics help list as well... I've been using R-2.4 with Rmetrics successfuly for a year or two. I recently moved to Ubuntu Linux 8.04, loaded R via apt-get install R-base etc. etc... then in the R interface i ran install.packages(fMultivar), chose the CRAN mirror and it

Re: [R] Exact test in nxm contingency table

2008-09-17 Thread Thomas Lumley
On Wed, 17 Sep 2008, Peter Dalgaard wrote: fisher.test(, simulate.p.value=TRUE) might be more direct. Also works for chisq.test(). And, contrary to popular belief, fisher.test() does work for larger than2x2 tables, although you may run into space/time limitations. The 'exact' test

Re: [R] Graphical Display of Values' Distribution

2008-09-17 Thread Philipp Pagel
I therefore wish to examine all values of urban.long[,3] which are greater than 1. I have tried the following, but receive error messages each time: hist(urban.long[,3]1) Error in hist.default(urban.long[, 3] 1) : 'x' must be numeric hist(urban.long[urban.long[,3]1]) Error in

Re: [R] Creating smooth color regions with panel.contourplot()

2008-09-17 Thread David Carslaw
I think this is a very useful function that I imagine has wide appeal - thanks. Using the code below produces the plot OK but when I try and copy/save it (as a metafile) I receive the following error and an hourglass: Error: invalid graphics state [using XP, 2.72, lattice 0.17.13] Regards,

[R] modifying patterns in a matrix

2008-09-17 Thread Stacey Burrows
Dear R-users, I have some very simple data where 1's represent events and zeroes non-events, e.g. temp - rbind(c(0,1,0,0,1,1,1,0), c(0,0,0,1,0,0,0,0)) For each row in the matrix, I would like to replace a singelton event by a 0. That is, any 1 surrounded by zeroes (010) should be replaced by a

Re: [R] Re adout row and column of a matrix value

2008-09-17 Thread David Winsemius
On Sep 17, 2008, at 3:36 PM, Jorge Ivan Velez wrote: Hi Chris82, Try this: res=c(which(a == max(a), arr.ind = T),max(a)) names(res)=c('row','col','value') write.csv(res,C://yourfile.csv,row.names=TRUE) I wasn't sure that max(x) or whatever target was specified would be unique, and in the

Re: [R] modifying patterns in a matrix

2008-09-17 Thread Henrique Dallazuanna
Try this: do.call(rbind, strsplit(gsub(010, 000, apply(temp, 1, paste, collapse = )), NULL)) On Wed, Sep 17, 2008 at 4:50 PM, Stacey Burrows [EMAIL PROTECTED]wrote: Dear R-users, I have some very simple data where 1's represent events and zeroes non-events, e.g. temp -

Re: [R] Creating smooth color regions with panel.contourplot()

2008-09-17 Thread Deepayan Sarkar
On Wed, Sep 17, 2008 at 1:12 PM, David Carslaw [EMAIL PROTECTED] wrote: I think this is a very useful function that I imagine has wide appeal - thanks. Using the code below produces the plot OK but when I try and copy/save it (as a metafile) I receive the following error and an hourglass:

[R] trouble with tkgetOpenFile

2008-09-17 Thread Gang Chen
I'm trying to use the following loop to open a window multiple times to select files, but only the last window shows up. What am I missing? library(tcltk) nWin - 6 fn - vector('list', nWin) for (ii in nWin) { fn[[ii]] - tclvalue( tkgetOpenFile( filetypes = {{Files} {.1D}} {{All files}

Re: [R] Unexpected behaviour when testing for independence with multiple factors

2008-09-17 Thread Ben Bolker
Javier Acuña javier.acuna.o at gmail.com writes: Hi, I'm a new user of R. My background is Electrical Engineering, so please bear with me if this is a silly question. I'm trying to assess whether the results of an experiment satisfy the hypothesis of homoscedasticity (my ultimate goal is

Re: [R] Creating smooth color regions with panel.contourplot()

2008-09-17 Thread Deepayan Sarkar
On Wed, Sep 17, 2008 at 1:25 PM, Deepayan Sarkar [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 1:12 PM, David Carslaw [EMAIL PROTECTED] wrote: I think this is a very useful function that I imagine has wide appeal - thanks. Using the code below produces the plot OK but when I try and

Re: [R] How to do Clustered Standard Errors for Regression in R?

2008-09-17 Thread Kingsford Jones
Bo, Try using RSiteSearch with the strings 'huber-white', 'sandwich' or even 'clustered standard errors'. You may also want to consider a mixed models approach -- see: http://www.stat.columbia.edu/~cook/movabletype/archives/2007/11/clustered_stand.html HTH, Kingsford Jones On Tue, Sep 16,

[R] how to extend the whisker in boxplot?

2008-09-17 Thread cathelf
Hi, Sorry for bothering your guys. I am still working on boxplot. How can I extend the whisker to the 5% and the 95% quantiles? What I should do if I only want to show the most extreme outlier, like 0.01% and 99.99% percentiles? I saw something on boxplot.stat, but I even donot know how to

[R] ANOVA contrast matrix vs. TukeyHSD?

2008-09-17 Thread Sam Yeaman
Dear Help List, Thanks in advance for reading...I hope my questions are not too ignorant. I have an experiment looking at evolution of wing size [centroid] in fruitflies and the effect of 6 different experimental treatments [treatment]. I have five replicate populations [replic] in each

[R] creating rainbow gradients

2008-09-17 Thread Gillian Silver
Hi, how can I create a rainbow gradient in R? For example, let's say I have a plot of y = x...and I want the plot to go from red - orange - yellow - green - blue - etc. Right now, I know how to do something like go from red to blue, using the plotrix library: library(plotrix) redToBlue -

Re: [R] inserting values for null

2008-09-17 Thread milton ruser
Dear Raja, Give a look on merge() function. Case you need more help, send us a short sample of your D.F1 and DF.sub.2 dataframes. Hope this helps, best wishes, miltinho astronauta brazil On Wed, Sep 17, 2008 at 2:13 PM, Rajasekaramya [EMAIL PROTECTED]wrote: I have a dataframe D.F1 dim

Re: [R] creating rainbow gradients

2008-09-17 Thread stephen sefick
plot(1:20, col=rainbow(20)) On Wed, Sep 17, 2008 at 4:58 PM, Gillian Silver [EMAIL PROTECTED] wrote: Hi, how can I create a rainbow gradient in R? For example, let's say I have a plot of y = x...and I want the plot to go from red - orange - yellow - green - blue - etc. Right now, I know how

Re: [R] creating rainbow gradients

2008-09-17 Thread Jorge Ivan Velez
Dear Gillian, See ?rainbow and its example. HTH, Jorge On Wed, Sep 17, 2008 at 4:58 PM, Gillian Silver [EMAIL PROTECTED]wrote: Hi, how can I create a rainbow gradient in R? For example, let's say I have a plot of y = x...and I want the plot to go from red - orange - yellow - green - blue

Re: [R] creating rainbow gradients

2008-09-17 Thread Gillian Silver
What would I do if I have something like: x - rnorm(1:1000) y - rnorm(1:1000) z - x + y and I want the rainbow to increase with z? (i.e., red for lowest z...all the way up to the last color in the rainbow for the highest z) On Wed, Sep 17, 2008 at 2:05 PM, stephen sefick [EMAIL PROTECTED]

  1   2   >