Re: [R] strange split behavior?

2009-09-23 Thread Peter Dalgaard
Peng Yu wrote: Hi, Please see the command with a comment below. I don't find 'A630039F22Rik' in y. But 'A630039F22Rik' is in z. Can somebody let me know what the problem is? Most obvious guess is that your factor y has a level that is not present in data. That is perfectly normal, even

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread Girish A.R.
Here's the code that does the job for quartiles (0,25,50,75,100). To get to your objective of (5,10,25,75,90) is left as an exercise. There are several well-written introductory books in R, in addition to the freely available presentations and other online resources. I think you should spend some

[R] BLUP with missing data

2009-09-23 Thread Marcio Resende
hello guys, I need to do a BLUP in the simplest model y = Xm + Zg + e however I have missing data in the analysis which I can´t consider as 0(zero). So I need to generate the matrix X'Z, Z'X and Z'Z step by step; I can´t use crossprod(x) #neither X'X - t(x)%*%x because I should skip the

[R] reading web log file into R

2009-09-23 Thread Sebastian Kruk
If I have a web log file as follows: #Software: Microsoft Internet Information Services 5.0 #Version: 1.0 #Date: 2007-12-03 13:50:17 #Fields: date time c-ip cs-username s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs-bytes time-taken cs(User-Agent) cs(Cookie) cs(Referer)

Re: [R] BLUP with missing data

2009-09-23 Thread Marcio Resende
Sorry, I sent it quickly and forgot to thank in advance Marcio Marcio Resende wrote: hello guys, I need to do a BLUP in the simplest model y = Xm + Zg + e however I have missing data in the analysis which I can´t consider as 0(zero). So I need to generate the matrix X'Z, Z'X and Z'Z step

[R] Sum of Product in a Matrix

2009-09-23 Thread Marcio Resende
Hi, I am new in R and I don´t know how to sum the product of two elements at the time in a matrix X=[ 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16] I would like to do (1*5+2*6+3*7+4*8) I need to do it step by step because I will further put a conditional in the formula

[R] Odp: Sum of Product in a Matrix

2009-09-23 Thread Petr PIKAL
Hi I am not sure if I understand what you want but if your matrix is not so big you can try x[,1]*x[,2] [1] 5 12 21 32 cumsum(x[,1]*x[,2]) [1] 5 17 38 70 and than check value of cumsum according to your condition. Regards Petr r-help-boun...@r-project.org napsal dne 23.09.2009

Re: [R] Ford Fulkerson

2009-09-23 Thread Gábor Csárdi
Hi, with a different (faster) algorithm, but maximum flows are implemented in package igraph, although for some networks only calculating the flow value is supported, giving the flow itself is not. Best, Gabor On Wed, Sep 23, 2009 at 3:37 AM, shuva gupta shuvagu...@yahoo.com wrote: Hi, Is

Re: [R] Handling missing data

2009-09-23 Thread Dr. S. B. Nguah
Reproducible code.??? premmad wrote: I have to remove missing data both in character and numeric datatype.I tried using NA condition but it is not working ,please help me to solve this. - Blay S KATH Kumasi, Ghana. -- View this message in context:

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread Girish A.R.
Replace your qfu as follows: qfu - function(x, digits=3,sci=F,...){ c(q=fivenum(x, ...) ) } Look up fivenum function for more information. cheers, -Girish = premmad wrote: Thanks for the help.I got the required quantiles by altering ur code as follows

[R] Variable as a filename

2009-09-23 Thread Lucas Sevilla García
Hi R community, I have a question. I have 5 files in a directory. Each file has a year as a name (file 1 -2004, file 2- 2005, ...). I want to build a for loop where I call first file, do some calculations, go to second file, do some calculations, etc. Somethin like this: year-2003 nfiles -

Re: [R] Variable as a filename

2009-09-23 Thread baptiste auguie
Hi, The short answer would be ?paste (as in paste(year, .csv, sep=) ), but I'd suggest you try this instead, lf - list.files(pattern = .csv) lf # [1] 2003.csv 2004.csv 2005.csv ln - gsub(.csv, , lf) ln # [1] 2003 2004 2005 length(ln) lapply(lf, read.csv) ?list.files ?lapply HTH, baptiste

Re: [R] Ford Fulkerson

2009-09-23 Thread stefano iacus
one implementation is in the optmatch package as far as I remember stefano On 23/set/09, at 03:37, shuva gupta wrote: Hi, Is there any R implementation of the well-known algorithm from the Operations Research literature, the Ford-Fulkerson algorithm of maximum flow in networks with

[R] Sorting

2009-09-23 Thread Chris Li
Hello, Say I have a dataset as followed: Category Value b1 b2 a7 a1 Then, if I: levels(Category) It will return: [a], [b] But I want to keep the original order, i.e.: [b], [a] Is it possible to do it in R? Thanks in

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread premmad
Thanks for the help.I got the required quantiles by altering ur code as follows qfu-function(x,digits=3,sci=F,...) {c(q=quantile(x,probs=c(5,90)/100)) } and my result of the R system is different from my sas system output for the same function .could anyone help me in this and what is the

Re: [R] Semi continous variable- define bounds using lpsolve

2009-09-23 Thread pragathichi
thank a lot it works Hans W. Borchers wrote: But of course, it is always possible to emulate a semi-continuous variable by introducing a binary variable and use some big-M trick. That is, with a new binary variable b we add the following two conditions: x3 - 3.6 * b = 0 and x3

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread premmad
I tried thanks for your help and got the same result for percentile 5 95 as in SAS.But if i need to calculate quantiles (1,5,10,99,etc.) it will not be possible with fivenum as explained in the help page .If i need those quantiles what is the change i need to make in the function

[R] graduation

2009-09-23 Thread MKHABELA,SN
Hi everyone I want help in graduating the attached rates and checking for goodness of fit and smoothness using R please help. Many thnk TOo every one around the world This message and attachments are subject to a disclaimer. Please refer to

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread ONKELINX, Thierry
You might need to change the type quantile. The default is type = 7, whereas default for SAS is type = 3 and for SPSS type = 6. Have a look at the helpfile of quantile() for more details on the type. HTH, Thierry ir.

Re: [R] run R script automatically by double-clicking WinXP desktopicon

2009-09-23 Thread Franzini, Gabriele [Nervianoms]
Hello Chris, I had the same problem, and I ended up driving R Gui through an Autoit script, see http://www.autoitscript.com/autoit3/ Regards, Gabriele Franzini -Original Message- From: cr...@binghamton.edu [mailto:cr...@binghamton.edu] Sent: 22 September 2009 19:37 To:

Re: [R] glm analysis repeated for 900 variables

2009-09-23 Thread Christian Schulz
Hi, nvars - 902 data - as.data.frame(matrix(runif(100*nvars),ncol=nvars)) colnames(data)[901] - c('phenotype') colnames(data)[902] - c('outcome') ### catch all aic values ### res - matrix(nrow=900,ncol=2) for (i in 1:(length(data)-2)) { res[i,1] - names(data)[i] res[i,2] -

Re: [R] Evaluating expresssions as parameter values

2009-09-23 Thread Peter Ehlers
Can't you just use get()? What am I missing? f - function(fo, data, groups) { g - xyplot(as.formula(fo), groups = get(groups), data) print(g) } f(yield ~ variety | site, data = barley, groups = year) Peter Ehlers Erich Neuwirth wrote: Thanks, that completely solves the

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread Girish A.R.
See if this works: qfun2 - function(x, digits=3,sci=F,...){ c(q=quantile(x, probs=c(1,5,10,95,99)/100,type=6,...) ) } cheers, -Girish === premmad wrote: I tried thanks for your help and got the same result for percentile 5 95 as in SAS.But if i need to calculate

[R] Problem in graph plotting

2009-09-23 Thread FMH
Dear All, Let: dp: depth of the river tp: temperature with respect to depth We can have a simple scatter plot, between depth as y-axis and temperature as x-axis, by using a plot function as shown below. #  dp - c(1,4,3,2,5,7,9,8,9,2) tp - 1:10 plot(tp,dp, type= 'l')

Re: [R] Problem in graph plotting

2009-09-23 Thread jim holtman
try this: plot(tp,dp, type= 'l',ylim=rev(range(dp))) On Wed, Sep 23, 2009 at 7:58 AM, FMH kagba2...@yahoo.com wrote: Dear All, Let: dp: depth of the river tp: temperature with respect to depth We can have a simple scatter plot, between depth as y-axis and temperature as x-axis, by

Re: [R] Sorting

2009-09-23 Thread Henrique Dallazuanna
Try this: DF$Category - factor(DF$Category, levels = c(b, a)) On Wed, Sep 23, 2009 at 4:16 AM, Chris Li chri...@austwaterenv.com.au wrote: Hello, Say I have a dataset as followed: Category     Value b                1 b                2 a                7 a                1 Then, if

Re: [R] Sorting

2009-09-23 Thread jim holtman
Here is a way of doing it x - read.table(textConnection(Category Value + b1 + b2 + a7 + a1), header=TRUE, as.is=TRUE) # now keep level in original order x$Category - factor(x$Category, levels=unique(x$Category)) str(x)

Re: [R] use of class variable in r as in Proc means of sas

2009-09-23 Thread premmad
Ya it works thanks for the help -- View this message in context: http://www.nabble.com/use-of-class-variable-in-r-as-in-Proc-means-of-sas-tp25530654p25531102.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] Problem in graph plotting

2009-09-23 Thread David Winsemius
On Sep 23, 2009, at 7:58 AM, FMH wrote: Dear All, Let: dp: depth of the river tp: temperature with respect to depth We can have a simple scatter plot, between depth as y-axis and temperature as x-axis, by using a plot function as shown below. # dp -

Re: [R] reading web log file into R

2009-09-23 Thread jim holtman
Here is a way to do it. I assume that you data has each record on a line; it came through the email as multiple lines. x - readLines(/tempxx.txt) # remove '#Fields: so it can be used as a header x - sub(^#Fields: , , x) # remove comment lines x - x[-grep(^#, x)] # remove quotes x -

Re: [R] Sorting

2009-09-23 Thread baptiste auguie
yet another way, x - read.table(textConnection(Category Value + b1 + b2 + a7 + a1), header=TRUE) y = transform(x, Category = relevel(Category, c(b))) str(y) 'data.frame': 4 obs. of 2 variables: $ Category: Factor w/ 2

Re: [R] strange split behavior?

2009-09-23 Thread Peng Yu
On Wed, Sep 23, 2009 at 1:24 AM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Peng Yu wrote: Hi, Please see the command with a comment below. I don't find 'A630039F22Rik' in y. But 'A630039F22Rik' is in z. Can somebody let me know what the problem is? Most obvious guess is that your  

Re: [R] retrieve certain part from html

2009-09-23 Thread Rene
Dear All, Can someone please guide me how to get the certain part from a long html language? e.g. tda href='2005-01.html'2005-01/a/tdtda href='2006-01.html'2006-01/a/tdtda href='2007-01.html'2007-01/a/tdtda href='2008-01.html'2008-01/a/tdtda href='2009-01.html'2009-01/a/td How to

Re: [R] reading web log file into R

2009-09-23 Thread Jay Emerson
Sebastian, There is rarely a completely free lunch, but fortunately for us R has some wonderful tools to make this possible. R supports regular expressions with commands like grep(), gsub(), strsplit(), and others documented on the help pages. It's just a matter of constructing and algorithm

Re: [R] Problem in graph plotting

2009-09-23 Thread Jim Lemon
On 09/23/2009 09:58 PM, FMH wrote: Dear All, Let: dp: depth of the river tp: temperature with respect to depth We can have a simple scatter plot, between depth as y-axis and temperature as x-axis, by using a plot function as shown below. # dp- c(1,4,3,2,5,7,9,8,9,2) tp-

Re: [R] retrieve certain part from html

2009-09-23 Thread Romain Francois
Hi, The R4X package can help you. (I have wrapped your td's into one tr) x - xml( trtda href='2005-01.html'2005-01/a/tdtda + href='2006-01.html'2006-01/a/tdtda + href='2007-01.html'2007-01/a/tdtda + href='2008-01.html'2008-01/a/tdtda + href='2009-01.html'2009-01/a/td/tr ) x[td/a/#] td

Re: [R] Problem in graph plotting

2009-09-23 Thread baptiste auguie
Hi, It's trivial with ggplot2, library(ggplot2) qplot(tp,dp, geom=line) + scale_y_reverse() HTH, baptiste 2009/9/23 David Winsemius dwinsem...@comcast.net: On Sep 23, 2009, at 7:58 AM, FMH wrote: Dear All, Let: dp: depth of the river tp: temperature with respect to depth We can have

[R] Reading data

2009-09-23 Thread Ashta
Dear R-users, I am a new user for R. I am eager to lean about it. I wanted to read and summary of the a simple data file I used the following, rel - read.table(C:/Documents and Settings/ashta/My Documents/R_data/rel.dat, quote=,header=FALSE,sep=,col.names= c(id,orel,nrel))

Re: [R] retrieve certain part from html

2009-09-23 Thread Henrique Dallazuanna
Try using XML package: Lines - tda href='2005-01.html'2005-01/a/tdtda href='2006-01.html'2006-01/a/tdtda href='2007-01.html'2007-01/a/tdtda href='2008-01.html'2008-01/a/tdtda href='2009-01.html'2009-01/a/td library(XML) xpathApply(htmlParse(Lines), //a, xmlAttrs) On Wed, Sep 23, 2009 at 9:29

Re: [R] graduation

2009-09-23 Thread David Winsemius
On Sep 23, 2009, at 4:54 AM, MKHABELA,SN wrote: Hi everyone I want help in graduating the attached rates and checking for goodness of fit and smoothness using R please help. Mortality rates for males and females.txt__ You have provided the

Re: [R] strange split behavior?

2009-09-23 Thread Philipp Pagel
On Wed, Sep 23, 2009 at 07:29:30AM -0500, Peng Yu wrote: On Wed, Sep 23, 2009 at 1:24 AM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Peng Yu wrote: Is there an operation on a factor to get a subset and keep only the corresponding levels (see commented line below)? Yes, there is: call

Re: [R] graduation

2009-09-23 Thread David Winsemius
On Sep 23, 2009, at 8:44 AM, David Winsemius wrote: On Sep 23, 2009, at 4:54 AM, MKHABELA,SN wrote: Hi everyone I want help in graduating the attached rates and checking for goodness of fit and smoothness using R please help. Mortality rates for males and

Re: [R] Reading data

2009-09-23 Thread Keo Ormsby
Hello Ashta, You need to use double blackslashes, liike: C:\\Documents and Settings\\ashta\\MyDocuments\\R_data\\rel.dat I usually use the following to avoid writing the path: #select file from a popup window f - file.choose() #read the file. the is Rese for any other arguments e.g.

Re: [R] Maximum Likelihood Est. regarding the degree of freedom of a multivariate skew-t copula

2009-09-23 Thread Ravi Varadhan
Why are you using SANN for optimizing over a smooth function of a scalar parameter? Simulated annealing is generally quite slow, and is typically used for nasty functions with multiple bumps and valleys. Try `optimize' instead. Ravi.

Re: [R] any way to make it work faster (deleting rows that contain certain values)

2009-09-23 Thread Dimitri Liakhovitski
Chuck, thank you, but I am not sure I understood what you meant. There are a lot of rows in index where at least 2 columns have equal values and a lot of rows where column 1 has 2 and some other column has 5 - same for 3 in column 1 and 6 in some other column, etc. Thanks a lot for clarifying!

[R] percent data being treated as categorical

2009-09-23 Thread Larry White
I have the following data exported as a .txt file on Windows. Everything is working fine, except that the the data in the 10th column is treated as a factor. Date Week Time Completed Work_Delta Mean_Delta Balance Total Total_Delta Work Index Open_Bugs Bug_Delta Bug_Delta2 8/17/2009 4 11.8% 64 64

[R] Error in package management on R 2.9.2 GUI 1.29 Tiger build 32-bit

2009-09-23 Thread Jean-Baptiste Marquette
Dear R gurus, I use the above release on my MacPro under Leopard 10.5.8 and I have no more access to the package manager and the CRAN binary list on package installer. Error messages in the console are : Erreur : impossible de trouver la fonction package.manager (impossible to find

[R] Fwd: confirm 60c6d87144c82778d7053d4f81d1e06f92f9f1e7

2009-09-23 Thread Tobias Erik Reiners
-- Tobias Erik Reiners Justus Liebig University IFZ - Department of Animal Ecology Heinrich-Buff-Ring 26-32 D-35392 Giessen Germany www.uni-giessen.de/cms/fbz/fb08/biologie/tsz/tieroekologie/mitarbeiter/diplomanden-innen/tobias-erik-reiners

Re: [R] Reading data

2009-09-23 Thread Don MacQueen
What it is telling you is that it can't find the file. This could be because the file isn't there, or you've got a typo in the file name, that sort of thing. In your email, you have split the filename argument between two lines. I don't know whether this comes from what you did in R, or

[R] mapproject returns NAs

2009-09-23 Thread Tobias Erik Reiners
Dear Helpers, usually I try to find the answers on my own, but this one beated me. I have to use the package Geneland which requires coordinates in Lambert projection. I have latitude and longitude (please copy to an .txt and read.table() ) X Y 3458231 5544356 3458263 5544301 3459143

Re: [R] percent data being treated as categorical

2009-09-23 Thread Larry White
Resolved. Thanks. On Wed, Sep 23, 2009 at 9:52 AM, Larry White ljw1...@gmail.com wrote: I have the following data exported as a .txt file on Windows. Everything is working fine, except that the the data in the 10th column is treated as a factor. Date Week Time Completed Work_Delta

Re: [R] compute differences

2009-09-23 Thread jude.ryan
Alessandro Carletti wrote: Hi, I have a problem. I have a data frame looking like: ID val A? .3 B? 1.2 C? 3.4 D? 2.2 E? 2.0 I need to CREATE the following TABLE: CASE?? DIFF A-A??? 0 A-B??? -0.9 A-C??? -3.1 A-D??? -1.9 A-E??? -1.7 B-A??? ... B-B??? ... B-C B-D

Re: [R] strange split behavior?

2009-09-23 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 23.09.2009 14:49:38: On Wed, Sep 23, 2009 at 07:29:30AM -0500, Peng Yu wrote: On Wed, Sep 23, 2009 at 1:24 AM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Peng Yu wrote: Is there an operation on a factor to get a subset and keep only the

Re: [R] compute differences

2009-09-23 Thread Petr PIKAL
Hi You can use outer. If your data are in data frame test then DIFF - as.vector(t(outer(test$val, test$val, -))) returns a vector, You just need to add suitable names to rows. CASE - as.vector(t(outer(test$ID, test$ID, paste, sep=-))) data.frame(CASE, DIFF) will put it together. Regards

Re: [R] compute differences

2009-09-23 Thread jude.ryan
Thanks Petr! It is good to see multiple solutions to the same problem. Best, Jude -Original Message- From: Petr PIKAL [mailto:petr.pi...@precheza.cz] Sent: Wednesday, September 23, 2009 10:59 AM To: Ryan, Jude Cc: alxmil...@yahoo.it; r-help@r-project.org Subject: Re: [R] compute

[R] Fortran vs R

2009-09-23 Thread Paul Simonin
Hello R users, I have a basic computer programing question. I am a student currently taking a course that uses Fortran as the main programming language, but the instructors are open to students using any language they are familiar with. I have used R previously, and am wondering if there is

[R] p value from F value and dfs

2009-09-23 Thread Sascha Wolfer
Dear List, is there an easy and fast way to compute the p value from a given F value and given degrees of freedom for an effect and the dfs for the residuals? I think of a function like this: compute.p(F.value, numerator.dfs, denominator.dfs) which returns the p value. Thanks, Sascha

[R] Function to check if a vector contains a given value?

2009-09-23 Thread Dimitri Liakhovitski
Dear R'rs, is there a function that checks if a given vector contains a certain value. E.g., x-c(1,2,3,4). How can I get a TRUE or FALSE for whether x contains a 2? -- Dimitri Liakhovitski Ninah.com dimitri.liakhovit...@ninah.com __

[R] R: Function to check if a vector contains a given value?

2009-09-23 Thread Guazzetti Stefano
?any any(x==2) Stefano -Messaggio originale- Da: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]per conto di Dimitri Liakhovitski Inviato: mercoledì 23 settembre 2009 17.38 A: R-Help List Oggetto: [R] Function to check if a vector contains a given value? Dear R'rs,

Re: [R] p value from F value and dfs

2009-09-23 Thread Jorge Ivan Velez
Hi Sascha, Take a look at ?pf HTH, Jorge On Wed, Sep 23, 2009 at 11:34 AM, Sascha Wolfer wrote: Dear List, is there an easy and fast way to compute the p value from a given F value and given degrees of freedom for an effect and the dfs for the residuals? I think of a function like this:

Re: [R] Function to check if a vector contains a given value?

2009-09-23 Thread Jorge Ivan Velez
Hi Dimitri, See either ?any, ?%in%, or ?intersect any(x == 2) # [1] TRUE HTH, Jorge On Wed, Sep 23, 2009 at 11:37 AM, Dimitri Liakhovitski wrote: Dear R'rs, is there a function that checks if a given vector contains a certain value. E.g., x-c(1,2,3,4). How can I get a TRUE or FALSE for

Re: [R] Fortran vs R

2009-09-23 Thread Duncan Murdoch
On 9/23/2009 11:13 AM, Paul Simonin wrote: Hello R users, I have a basic computer programing question. I am a student currently taking a course that uses Fortran as the main programming language, but the instructors are open to students using any language they are familiar with. I have used

Re: [R] Fortran vs R

2009-09-23 Thread Charlie Sharpsteen
-- Forwarded message -- From: Charlie Sharpsteen ch...@sharpsteen.net Date: Wed, Sep 23, 2009 at 8:47 AM Subject: Re: [R] Fortran vs R To: Paul Simonin paul.simo...@uvm.edu Cc: r-h...@r-project.or On Wed, Sep 23, 2009 at 8:13 AM, Paul Simonin paul.simo...@uvm.edu wrote: Hello

Re: [R] Function to check if a vector contains a given value?

2009-09-23 Thread Dimitri Liakhovitski
Thanks a lot, Jorge! On Wed, Sep 23, 2009 at 11:42 AM, Jorge Ivan Velez jorgeivanve...@gmail.com wrote: Hi Dimitri, See either ?any,  ?%in%, or  ?intersect any(x == 2) # [1] TRUE HTH, Jorge On Wed, Sep 23, 2009 at 11:37 AM, Dimitri Liakhovitski wrote: Dear R'rs, is there a function

Re: [R] Fortran vs R

2009-09-23 Thread Charles Annis, P.E.
WARNING! Biased opinion. I'm an old guy who learned programming nearly 50 years ago when FORTRAN (IV) was it, unless you wanted to write machine language which, being an engineer, I was less interested in than in getting an answer so I could get on with things. I like FORTRAN, but I can't think

Re: [R] No parametric methods

2009-09-23 Thread Greg Snow
For power studies you need to think about what the data will look like under the alternative hypothesis. Is the data shifted over a certain amount? (the most common assumption), or scaled? Or both? Or a completely different shape? Etc. My preferred method for power studies in this case is to

[R] ROCR.plot methods, cross validation averaging

2009-09-23 Thread Tim Howard
Dear R-help and ROCR developers (Tobias Sing and Oliver Sander) - I think my first question is generic and could apply to many methods, which is why I'm directing this initially to R-help as well as Tobias and Oliver. Question 1. The plot function in ROCR will average your cross validation

Re: [R] How to read zip file?

2009-09-23 Thread Benilton Carvalho
and note that if, instead of zip files, you were using gzip files, you could: conn - gzfile(file.gz, rt) theData - read.table(conn) close(conn) b On Sep 22, 2009, at 11:21 PM, Gabor Grothendieck wrote: Linux is a type of UNIX so follow the instructions I gave for UNIX. On Tue, Sep 22,

[R] re peated measures

2009-09-23 Thread pompon
Hi, I am performing a repeated measures 2-way ANOVA to assess the influence of plant and leaf on aphid fecundity. Fecundity is measured for each aphid on a single leaf. Here is what I typed. wingless - reshape(Wingless, varying =

Re: [R] Problem in graph plotting

2009-09-23 Thread baptiste auguie
Try this, d - na.omit(data.frame(tp,dp)) plot(d, t=l, ylim=rev(range(d$dp))) ?na.omit HTH, baptiste 2009/9/23 FMH kagba2...@yahoo.com: Thank you for the code. I found that the coding does not work if there is an NA in dp variable. For instance; # dp -

[R] memory problems for fixed effect models

2009-09-23 Thread Jörg Schaber
Hi, I am trying to fit a simple two-way fixed effect linear model (o ~ y + s - 1). However, my problem is large (length(o)=79333). I am already using slm.fit with a dense design matrix (ddm), but still: fit - slm.fit(ddm,o) Error: cannot allocate vector of size 9.1 Gb Is there a way to

Re: [R] retrieve certain part from html

2009-09-23 Thread Tony Breyal
maybe you could modify the following to suit your situation (i use this xPath expression to get links from google): ?htmlTreeParse ?getNodeSet library(XML) link -

Re: [R] generating unordered combinations

2009-09-23 Thread Dan
Thanks Bryan, sorry for the late reply - I only just noticed this post. I'm not specifically interested in that sum, but something related to the sum so this may also be very useful. Dan On 18 Sep, 18:24, Bryan Keller bskel...@wisc.edu wrote: The combn solution offered by Bill is great.  It

[R] Numerical integration problem

2009-09-23 Thread Marcus Rowcliffe
Hi there I'm trying to construct a model of mortality risk in 2D space that requires numerical integration of a hazard function, for which I'm using the integrate function. I'm occasionally encountering parameter combinations that cause integrate to terminate with error Error in integrate... the

Re: [R] Function to check if a vector contains a given value?

2009-09-23 Thread Henrique Dallazuanna
You can try this also: is.element(2, x) On Wed, Sep 23, 2009 at 12:37 PM, Dimitri Liakhovitski ld7...@gmail.com wrote: Dear R'rs, is there a function that checks if a given vector contains a certain value. E.g., x-c(1,2,3,4). How can I get a TRUE or FALSE for whether x contains a 2? --

[R] Compiled Rcmdr Plugin package (zip) has no etc/menus.txt

2009-09-23 Thread Tobias Schoch
Dear Rcmdr users, I use R-2.9.2, Rcmdr 1.5-1 and the latest Rtools bundle (and the html help workshop) under Windows XP. I wrote a RcmdrPlugin for some important functions of Thomas Lumley's survey package. Problem: Package compilation works without displaying any errors. That is 1) R CMD build

Re: [R] Problem in graph plotting

2009-09-23 Thread Henrique Dallazuanna
Try this: plot(tp, dp, type = 'l', ylim = rev(range(dp, na.rm = TRUE))) On Wed, Sep 23, 2009 at 1:44 PM, FMH kagba2...@yahoo.com wrote: Thank you for the code. I found that the coding does not work if there is an NA in dp variable. For instance; # dp -

Re: [R] Numerical integration problem

2009-09-23 Thread Ravi Varadhan
Hi Marcus, I always use a smaller error tolerance in `integrate' than the default value. I generally use 1.e-07, whereas the default is only about 1.e-04. Sometimes you may also need to increase the number of subdivisions from its default value of 100. Your problem disappears if you use a

[R] [R-pkgs] survey package (3.18)

2009-09-23 Thread Thomas Lumley
Version 3.18 of the survey package is now percolating through CRAN. Since the last announcement on this list, in February, the main additions are - standard errors for survival curves (both Kaplan-Meier and Cox model) - svyciprop() for confidence intervals on proportions, especially in small

[R] any advice on web interfaces to R?

2009-09-23 Thread Mitchell Maltenfort
I saw http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Web-Interfaces and I'm still not sure yet which platform (Linux, Windows, etc.) I'll be working on -- and no, it's not under my control to pick. I was wondering if anyone out there had good advice, that would save me time and stomach acid, on

Re: [R] memory problems for fixed effect models

2009-09-23 Thread Daniel Malter
Are y and s continuous or is one of them a factor/dummy variable? From the mle specification I grasp that s is the unit of observation and is factor-coded. If that is so, then estimating lm(o~y+s) includes a lot of dummy/factor variables (lots of columns of 0/1 in the X matrix), and then there

Re: [R] Fortran vs R

2009-09-23 Thread Thomas Lumley
On Wed, 23 Sep 2009, Paul Simonin wrote: Hello R users, I have a basic computer programing question. I am a student currently taking a course that uses Fortran as the main programming language, but the instructors are open to students using any language they are familiar with. I have used R

Re: [R] dotchart to barplots

2009-09-23 Thread Henrique Dallazuanna
Try this: barplot(t(as.matrix(intersect.data[,2:5])), beside = T, horiz = T, names.arg = intersect.data[,1], cex.axis = 0.7, cex.names = 0.7) On Wed, Sep 23, 2009 at 4:01 PM, Nair, Murlidharan T mn...@iusb.edu wrote: Hi, I am trying to plot the following data so that it

[R] logLik() in urca function

2009-09-23 Thread karla hernandez villafuerte
Dear Group: I want to get the loglik of the regresion associated to the estimation of the unit root test Zivot-Andrews of the package urca. I am new using R, then I simply tried the next sequence: A-ur.za(var,model=intercept,lag=2) logLik(A) but the result is an error, and I think it

[R] stripchart with pch %in% 21:25 with bg

2009-09-23 Thread Jean lobry
Dear all, consider: ### x - round(rnorm(50)) stripchart(x, pch = 21, col = black, bg = pink, method = jitter) points(0.5, 1, pch = 21, col = black, bg = pink, cex = 2) ### Under R 2.9.0 the points produced by stripchart are not colored, while points() gives the desidered output (magnified

Re: [R] dotchart to barplots

2009-09-23 Thread Nair, Murlidharan T
I had tried names.arg=c(intersect.data[,1]) so that was the problem. That solves part of what need. I there a way to rotate how it is written on the y-axis? Also, use designs instead of gray scale and making keys for it? Thanks for chipping in. Cheers../Murli -Original Message- From:

Re: [R] dotchart to barplots

2009-09-23 Thread Nair, Murlidharan T
Ok, I could make it perpendicular by specifying las=2 barplot(t(as.matrix(intersect.data[,2:5])), beside = T, horiz = T, names.arg = intersect.data[,1], cex.axis = 0.7, cex.names = 0.7, las=2) Still working on the other though. Cheers../Murli -Original Message-

Re: [R] dotchart to barplots

2009-09-23 Thread Henrique Dallazuanna
Sorry, byt what you mean by 'designs'? You can add a legend with: barplot(t(as.matrix(intersect.data[,2:5])), beside = T, horiz = T, legend.text = names(intersect.data)[-1], names.arg = intersect.data[,1], cex.axis = 0.7, cex.names = 0.7, las=2) On Wed, Sep 23, 2009 at 4:26

Re: [R] dotchart to barplots

2009-09-23 Thread Nair, Murlidharan T
What I mean by design is a black and white lines or something that is more distinguishing than the grey levels? Thanks for the legends :) Cheers../Murli -Original Message- From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Wednesday, September 23, 2009 3:32 PM To: Nair,

Re: [R] Best way to arrange data

2009-09-23 Thread Jim Silverton
Hello, I have the following data: gene Actualgroupsreps 11213 12 22123 23 33 2 12 44 12 2 3 51 0 1 1 62 34 2 2 73

Re: [R] dotchart to barplots

2009-09-23 Thread Henrique Dallazuanna
Perhaps a white border: barplot(t(as.matrix(intersect.data[,2:5])), border = 'white', beside = T, horiz = T, legend.text = names(intersect.data)[-1], names.arg = intersect.data[,1], cex.axis = 0.7, cex.names = 0.7, las=2) Or you can use the 'col' argument to select

Re: [R] dotchart to barplots

2009-09-23 Thread Nair, Murlidharan T
The journal wants black and white only :) -Original Message- From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Wednesday, September 23, 2009 3:41 PM To: Nair, Murlidharan T Cc: r-help@r-project.org Subject: Re: [R] dotchart to barplots Perhaps a white border:

Re: [R] dotchart to barplots

2009-09-23 Thread Greg Snow
The current recommendation is to not put designs/hash lines/pictures/etc. into the bars, but to use a single solid color (gray in your case). Back when a quality graph meant using a pen plotter, hash lines made sense as a way to distinguish between bars, but quality graphics no longer depend

Re: [R] dotchart to barplots

2009-09-23 Thread Peter Ehlers
Murli, Two points: 1. I think you might want las=1; 2. have a look at the density= argument, i.e. add density=c(10,20,30,40) to your call. Peter Ehlers Henrique Dallazuanna wrote: Perhaps a white border: barplot(t(as.matrix(intersect.data[,2:5])), border = 'white', beside =

Re: [R] Barplot+Table

2009-09-23 Thread gunksta
Marc Schwartz-3 wrote: Using the data that is in the online plot rather than the above, here is a first go. Note that I am not drawing the background grid in the barplot or the lines for table below it. These could be added if you really need them. Note: I snipped out the syntax

Re: [R] glm analysis repeated for 900 variables

2009-09-23 Thread Rolf Turner
On 23/09/2009, at 11:26 PM, Christian Schulz wrote: Hi, nvars - 902 data - as.data.frame(matrix(runif(100*nvars),ncol=nvars)) colnames(data)[901] - c('phenotype') colnames(data)[902] - c('outcome') snip Just ***WHAT*** do you think the ``c( )'' is doing for you in the

Re: [R] dotchart to barplots

2009-09-23 Thread Nair, Murlidharan T
Thanks Peter. Where did you find that option? It's really cool Cheers../Murli -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Wednesday, September 23, 2009 3:56 PM To: Nair, Murlidharan T Cc: r-help@r-project.org Subject: Re: [R] dotchart to barplots Murli,

Re: [R] Best way to arrange data

2009-09-23 Thread David Winsemius
On Sep 23, 2009, at 3:47 PM, Jim Silverton wrote: Hello, I have the following data: gene Actualgroupsreps 11213 12 22123 23 33 2 12 44 12 2 3 51 0 1

Re: [R] dotchart to barplots

2009-09-23 Thread Nair, Murlidharan T
Guess, I miss the argument when I ?barplot. Cheers../Murli -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Wednesday, September 23, 2009 3:56 PM To: Nair, Murlidharan T Cc: r-help@r-project.org Subject: Re: [R] dotchart to barplots Murli, Two points: 1. I

Re: [R] dotchart to barplots

2009-09-23 Thread Peter Ehlers
Well, it was easy to find: ?barplot and look at all the arguments. But I agree with Greg that this kind of look is (and should be) pretty much history. I'm not very fond of barplots with as many groups as you have. Since your variable X appears to be a discretized continuous variable, why not

  1   2   >