Re: [R] Building static HTML help pages in R 2.10.x on Windows

2010-01-08 Thread Dieter Menne
Duncan Murdoch wrote: What's so hard about leaving an R session running, and using bookmarks as Dieter described? It pollutes my space, and I am a Window-closing maniac, so it won't survive the next attack.

Re: [R] generate XML

2010-01-08 Thread S Devriese
On 01/07/2010 11:36 AM, robert-mcfad...@o2.pl wrote: Dnia 7 stycznia 2010 11:30 S Devriese sdmaill...@gmail.com napisał(a): you might try # open file connection sink(item1.xml) # print object my.matrix # close file connection sink() Unfortunately, It does not code letter

[R] Bug: more information on a crash

2010-01-08 Thread Christophe Genolini
Hi the list, In the package KmL (new version, not release yet), the main function seems to work correctly but once in a while, R crash (full crash, anything link with R is closed and windows ask if it can send a crash report). More precisely, when I run it in a loop on 1000 data sets, the

Re: [R] Print data frame as list including row/column name

2010-01-08 Thread Henrique Dallazuanna
Try this: writeLines(do.call(paste, c(as.data.frame.table(as.matrix(x)), sep = ;))) On Fri, Jan 8, 2010 at 12:03 AM, sugimoto iey...@sugimoto.at wrote: Hi all, I have the following problem: I have a data frame (actually it is a prop.table) which I want to print as a list, e.g.:          

[R] Zeilenweiser Plot einer Matrix

2010-01-08 Thread Oliver Gondring
Liebe Liste, bin noch absoluter R-Anfänger und trotz fleißigen Lesens der Dokumentation noch nicht zur Lösung des folgenden Problems vorgedrungen. Die Werte einer 2D-Matrix sollen in einem einzigen 2D-Plot dargestellt werden, in dem jeweils für die Werte einer Zeile ein Graph aus mit Linien

Re: [R] Building static HTML help pages in R 2.10.x on Windows

2010-01-08 Thread Duncan Murdoch
Michal Kulich wrote: On 7.1.2010 20:22, Duncan Murdoch wrote: A more useful example than ls() would be methods(). I think it would be nice to have a list of methods included in the man page for a generic function, and links to their pages if they have their own man pages. You might want

Re: [R] Building static HTML help pages in R 2.10.x on Windows

2010-01-08 Thread Duncan Murdoch
Dieter Menne wrote: Duncan Murdoch wrote: What's so hard about leaving an R session running, and using bookmarks as Dieter described? It pollutes my space, and I am a Window-closing maniac, so it won't survive the next attack.

Re: [R] Building static HTML help pages in R 2.10.x on Windows

2010-01-08 Thread Dieter Menne
Hi, Duncan, If that works, writing up instructions would be a useful contribution. It was always a bit of a mess, and after 15 minutes this morning I had to go. So I hoped someone else would jump the wagon. Dieter -- View this message in context:

Re: [R] Zeilenweiser Plot einer Matrix

2010-01-08 Thread Uwe Ligges
On 08.01.2010 12:18, Oliver Gondring wrote: Liebe Liste, bin noch absoluter R-Anfänger und trotz fleißigen Lesens der Dokumentation noch nicht zur Lösung des folgenden Problems vorgedrungen. Die Werte einer 2D-Matrix sollen in einem einzigen 2D-Plot dargestellt werden, in dem jeweils für die

[R] Standard errors from a randomization test?

2010-01-08 Thread jjh
Hello- Is it possible to estimate standard errors for a multiple regression model using a randomization test approach? I have seen a lot on using the procedure to get a test statistic, but nothing that talks about getting actual standard errors. Is this possible? How might I do this in R? Thank

Re: [R] Building static HTML help pages in R 2.10.x on Windows

2010-01-08 Thread hadley wickham
I see. Well, I never lacked any of these capabilities... Please understand that people who use R to do their work may have different objectives than the developers - and they form the majority of R users. Well how about a documentation system that could look back over your history and notice

[R] Online R documentation

2010-01-08 Thread Hadley Wickham
Dear list, Many people seem unhappy with the new documentation server because you need to have R running to access it, and it's not immediately obvious how to bookmark references so they work long-term. One solution to this problem is to have a globally available website that provides access to

[R] fast lm se?

2010-01-08 Thread ivo welch
dear R experts---I am using the coef() function to pick off the coefficients from an lm() object. alas, I also need the standard errors and I need them fast. I know I can do a summary() on the object and pick them off this way, but this computes other stuff I do not need. Or, I can compute (X'

[R] Fitting chi-squared distribution

2010-01-08 Thread Trafim Vanishek
Dear all, I would like to ask if there is a simple was in R to fit the chi-squared distribution to the empirical data? Thanks a lot! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] fast lm se?

2010-01-08 Thread Henrique Dallazuanna
You can get SE with this: coef(summary(your_model))[,'Std. Error'] On Fri, Jan 8, 2010 at 11:35 AM, ivo welch ivo...@gmail.com wrote: dear R experts---I am using the coef() function to pick off the coefficients from an lm() object.  alas, I also need the standard errors and I need them

Re: [R] Online R documentation

2010-01-08 Thread Jonathan Baron
On 01/08/10 07:15, Hadley Wickham wrote: Dear list, Many people seem unhappy with the new documentation server because you need to have R running to access it, and it's not immediately obvious how to bookmark references so they work long-term. One solution to this problem is to have a

Re: [R] fast lm se?

2010-01-08 Thread Liaw, Andy
From: ivo welch dear R experts---I am using the coef() function to pick off the coefficients from an lm() object. alas, I also need the standard errors and I need them fast. I know I can do a summary() on the object and pick them off this way, but this computes other stuff I do not

Re: [R] Fitting chi-squared distribution

2010-01-08 Thread Karl Ove Hufthammer
On Fri, 8 Jan 2010 14:39:34 +0100 Trafim Vanishek rdapam...@gmail.com wrote: I would like to ask if there is a simple was in R to fit the chi-squared distribution to the empirical data? Sure. Use the 'fitdistr' function in the 'MASS' package. -- Karl Ove Hufthammer

Re: [R] fast lm se?

2010-01-08 Thread Gabor Grothendieck
See ?display in the arm package. On Fri, Jan 8, 2010 at 8:35 AM, ivo welch ivo...@gmail.com wrote: dear R experts---I am using the coef() function to pick off the coefficients from an lm() object.  alas, I also need the standard errors and I need them fast.  I know I can do a summary() on the

Re: [R] Online R documentation

2010-01-08 Thread Karl Ove Hufthammer
On Fri, 8 Jan 2010 08:41:49 -0500 Jonathan Baron ba...@psych.upenn.edu wrote: Many people seem unhappy with the new documentation server because you need to have R running to access it, and it's not immediately obvious how to bookmark references so they work long-term. One solution to

Re: [R] Online R documentation

2010-01-08 Thread Hadley Wickham
Many people seem unhappy with the new documentation server because you need to have R running to access it, and it's not immediately obvious how to bookmark references so they work long-term. One solution to this problem is to have a globally available website that provides access to all

Re: [R] Online R documentation

2010-01-08 Thread Hadley Wickham
http://pledgie.com/campaigns/7707 - here you can donate as much or as little as you like to support this project.  You won't pay until the total amount has been pledged. I misread the documentation - do you actually pay right away. If I don't reach the $1000, I'll pass on the money to a good

Re: [R] Anybody can suggest a better method to build a package while ignoring some functions

2010-01-08 Thread Michael Dewey
At 01:18 06/01/2010, rusers.sh wrote: Hi, Say i have three functions in a new package, a,b and c. I only want the one function a to be exported for use. b and c are not very stable. If i specify to export all the three functions in the NAMESPACE file (export(a,b,c)), no errors appeared after

[R] Creating Table from Boxplot

2010-01-08 Thread Lorenzo Isella
Dear All, I know how to use the boxplot() function to generate a boxplot, but I would like to (automatically) extract 5 numbers (median and the 4 quantiles) for each column and possibly save them into a convenient format. Can anyone point me to the right direction? I am sure there must be an

Re: [R] fast lm se?

2010-01-08 Thread Dirk Eddelbuettel
On 8 January 2010 at 08:35, ivo welch wrote: | dear R experts---I am using the coef() function to pick off the coefficients | from an lm() object. alas, I also need the standard errors and I need them | fast. I know I can do a summary() on the object and pick them off this | way, but this

Re: [R] fast lm se?

2010-01-08 Thread ivo welch
naive questions--- why is this not part of the standard R distribution? fast regression is *not* an obscure need. why would an se() function not be part of the standard R distribution, given that coef() can be? naive suggestion to add to the ?lm text The underlying low level functions,

Re: [R] Creating Table from Boxplot

2010-01-08 Thread David Winsemius
On Jan 8, 2010, at 9:08 AM, Lorenzo Isella wrote: Dear All, I know how to use the boxplot() function to generate a boxplot, but I would like to (automatically) extract 5 numbers (median and the 4 quantiles) for each column and possibly save them into a convenient format. Can anyone point

Re: [R] Online R documentation

2010-01-08 Thread Jonathan Baron
On 01/08/10 14:56, Karl Ove Hufthammer wrote: On Fri, 8 Jan 2010 08:41:49 -0500 Jonathan Baron ba...@psych.upenn.edu wrote: Many people seem unhappy with the new documentation server because you need to have R running to access it, and it's not immediately obvious how to bookmark

[R] how to flatten a list to the same level?

2010-01-08 Thread Mark Heckmann
I have a nested list l like: l - list(A=c(1,2,3), B=c(a, b)) l - list(l,l, list(l,l)) I want the list to be unlisted, but not on the lowest level of each branch. I want the lowest level of each list branch to remain as it is. So unlist or unlist(rec=F) do not work here as the level of

Re: [R] Online R documentation

2010-01-08 Thread Karl Ove Hufthammer
On Fri, 8 Jan 2010 10:03:31 -0500 Jonathan Baron ba...@psych.upenn.edu wrote: In case anybody is looking for ideas in how to improve the above site, inclusion of rendered example graphs, similar to the ones at http://www.metaresearch.de/exlib/;, would be nice. Why should I bother when

[R] how to organize a lot of R source files

2010-01-08 Thread Hao Cen
Hi, I wonder what is a better way to organize a lot of R source files. I have a lot of utility functions written and store them in several source files (e.g util1.R, util2.R,..utilN.R). I also have a master file in which the source command is used to load all the util.R files. When I need to use

Re: [R] Ridge regression

2010-01-08 Thread Eleni Christodoulou
Hello again and Happy 2010! I was looking back at this email because I need to do some additional processing now. I was thinking that if I take the coef(ans) I get n+1 coefficients. I guess that the coef(ans)[1] is the constant term... Do I need to add it when I calculate the estimated value for

Re: [R] Ridge regression

2010-01-08 Thread Eleni Christodoulou
I am sorry, I just pressed the send button by accident before completing my e-mail. The yest are the estimated values according to the ridge model. Is the way that I calculate them correct? Or should I cut the *+coef(ridge.test)[1] *term? Thanks a lot! Eleni On Fri, Jan 8, 2010 at 6:16 PM, Eleni

[R] inclusion of intercept=FALSE in regsubsets() in leaps package produces an error

2010-01-08 Thread James C. McGrath
Hello, I have encountered a problem which may be arising from details of my data and or the statistics I am trying to do, or may be arising due to the way leaps works internally. Unfortunately, I am not yet savvy enough to tell why. I can say that this statement works (or at least works to the

Re: [R] Ridge regression

2010-01-08 Thread Ravi Varadhan
Yes, you need to have the intercept term when you predict model-based response. This is what you need: ridge.test=lm.ridge(tey_values~tedata, lambda) yest - drop(cbind(1, tedata) %*% coef(ridge.test)) Hope this helps, Ravi.

Re: [R] February 2010***New R Courses*** by XLSolutions Corp at 9 USA Cities: San Francisco, New York, Washington DC, Houston, Boston, Las Vegas, Seattle, etc

2010-01-08 Thread Sue Turner
Greetings Milton, Our R-PLUS has features of S-PLUS and we use it to teach and those with laptops without S-PLUS get R-PLUS. Get a free trial of R-PLUS at: www.xlsolutions-corp.com/order Regards - Sue Original Message Subject: Re: [R] February 2010***New R Courses*** by

Re: [R] Ridge regression

2010-01-08 Thread Eleni Christodoulou
Thanks a lot! Eleni On Fri, Jan 8, 2010 at 6:35 PM, Ravi Varadhan rvarad...@jhmi.edu wrote: Yes, you need to have the intercept term when you predict model-based response. This is what you need: * ridge.test=lm.ridge(tey_values~tedata, lambda)* * * * yest - drop(cbind(1,

Re: [R] svm

2010-01-08 Thread Amy Hessen
Hi Steve, Thank you very much for your reply. Your code is more readable and obvious than mine… Could you please help me in these questions?: 1) “Formula” is an alternative to “y” parameter in SVM. is it correct? 2) I forgot to remove the “class label” from the dataset besides I gave

[R] how to get perfect fit of lm if response is constant

2010-01-08 Thread Jan-Henrik Pötter
Hello. Consider the response-variable of data.frame df is constant, so analytically perfect fit of a linear model is expected. Fitting a regression line using lm result in residuals, slope and std.errors not exactly zero, which is acceptable in some way, but errorneous. But if you use summary.lm

[R] Newbie question on precision

2010-01-08 Thread Paul Evans
Hi all, How can I get R to change the default precision value? For example: x=0.9 1-x [1] 0 Is there a way that I can get a non-zero value using some parameter, or some package? many thanks. [[alternative HTML version deleted]]

Re: [R] how to flatten a list to the same level?

2010-01-08 Thread Henrique Dallazuanna
Try something about like this: split(unlist(l), rep(1:length(idx - rapply(l, length)), idx)) On Fri, Jan 8, 2010 at 1:35 PM, Mark Heckmann mark.heckm...@gmx.de wrote: I have a nested list l like: l - list(A=c(1,2,3), B=c(a, b)) l - list(l,l, list(l,l)) I want the list to be unlisted, but

[R] Directory operations

2010-01-08 Thread anupam sinha
Dear all, I have this directory structure : Dir1 Dir2 Dir3 Dir4 . A.xml D.xmlG.xml B.xml E.xml H.xml C.xml F.xml I.xml Within each of these directories (Dir1, Dir2 etc) there are a num of xml files (A.xml, B.xml

Re: [R] Directory operations

2010-01-08 Thread jim holtman
?list.files ?file.info ?setwd You can get a list of all the files in a directory (list.files) and then do a file.info to determine which ones are the directories you want to search. A list.files on that directory will give you the list of file names that you can then process. On Fri, Jan 8,

Re: [R] Newbie question on precision

2010-01-08 Thread Ted Harding
On 08-Jan-10 16:56:25, Paul Evans wrote: Hi all, How can I get R to change the default precision value? For example: x=0.9 1-x [1] 0 Is there a way that I can get a non-zero value using some parameter, or some package? many thanks. The problem here is that, as far as R

Re: [R] Newbie question on precision

2010-01-08 Thread jim holtman
FAQ 7.31 The precision of a floating point number is about 16 digits and your 'x' is at that limit. If you reduce it, you will see a result: x=0.9 1-x [1] 0 print(1-x, digits=20) [1] 0 x=0.99 print(1-x, digits=20) [1] 0.00999200722162641 On Fri,

Re: [R] Newbie question on precision

2010-01-08 Thread Magnus Torfason
Paul Evans wrote: How can I get R to change the default precision value? For example: x=0.9 1-x [1] 0 Is there a way that I can get a non-zero value using some parameter, or some package? many thanks. The 'gmp' package allows calculation with arbitrary precision rationals

Re: [R] how to get perfect fit of lm if response is constant

2010-01-08 Thread Peter Ehlers
You need to review the assumptions of linear models: y is assumed to be the realization of a random variable, not a constant (or, more precisely: there are assumed to be deviations that are N(0, sigma^2). If you 'know' that y is a constant, then you have two options: 1. don't do the regression

Re: [R] Strange behaviour of as.integer()

2010-01-08 Thread Ted Harding
See below. From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ulrich Keller Sent: Thursday, January 07, 2010 4:32 AM To: r-help@r-project.org Subject: [R] Strange behaviour of as.integer() I have encountered a strange behaviour of as.integer() which

[R] Arguments of a function

2010-01-08 Thread Lisa
Dear all, I have a question about how to set arguments in my own function. For example, I have a function that looks like this: my.f - function(a = x1, b = x2) { x1 = equation 1 x2 = equation 2 x3 = equation 3 y = a + b } x1, x2, and x3 are temporary variables (intermediate

Re: [R] Newbie question on precision

2010-01-08 Thread Magnus Torfason
On 1/8/2010 1:29 PM, Magnus Torfason wrote: Paul Evans wrote: How can I get R to change the default precision value? For example: x=0.9 1-x [1] 0 Is there a way that I can get a non-zero value using some parameter, or some package? many thanks. The 'gmp' package allows

[R] function by: order within subsets

2010-01-08 Thread Daniel Murphy
When the 'by' function forms subsets, are the rows in the same order as they are in the original data frame? For example, I want to use 'by' to calculate cumulative sums of a value 'v' by date 'd' for different levels of a factor 'f':

Re: [R] A question about the ff package

2010-01-08 Thread OS
Thank you Jens. I will try your solutions and post the solutions/problems I have. Cheers Peter 2010/1/7 Jens Oehlschlägel oehl_l...@gmx.de Peter, ff objects are not allowed as subscripts to ff objects. You can take several routes 1) use bit objects instead of logical or ff logical. This is

[R] can´t start help in Win7

2010-01-08 Thread Daniel Victoria
Just installed R 2.10.1 in win7 and when I try to run help.start() firefox will pop up but display an error saying it could not find the url http://127.0.0.1:16396/doc/html/index.html and that permission is denied. Has anyone seen this? How can I fix it? Thanks daniel

[R] postscript, greek lellters

2010-01-08 Thread bernardo lagos alvarez
Dear useRs, How can I, writting the correct greek letter using postscrip or pdf function. In my figures appears only the first letter (a of alpha, n of nu) when include the graphs in my .tex doxument. I am using title( expression(bar(T)(paste(-x,;,alpha))-G(paste(x,;,alpha,,,J title(

[R] Panel order in lattice with xyplot

2010-01-08 Thread Carol
Dear all, I am a new user of R ;-) (I started three months ago) and I am going very slow…. I am using lattice and am trying to draw a multipanel figure. The problems are that I am not able to find out how to: 1. Set the order of the panels. 2. Set the order of the x axes. :rules: The codes I

Re: [R] Arguments of a function

2010-01-08 Thread Henrique Dallazuanna
Try this: my.f - function(a, b) { x1 - 2 * 3 x2 - 3 / 6 x3 - 4 * 4 / 5 - sqrt(2) y - get(deparse(substitute(a))) + get(deparse(substitute(b))) return(y) } my.f(x1, x2) On Fri, Jan 8, 2010 at 4:15 PM, Lisa lisa...@gmail.com wrote: Dear all, I have a

Re: [R] function by: order within subsets

2010-01-08 Thread Henrique Dallazuanna
Try this: transform(df, v = unlist(with(df, tapply(v, f, cumsum On Fri, Jan 8, 2010 at 4:10 PM, Daniel Murphy chiefmur...@gmail.com wrote: When the 'by' function forms subsets, are the rows in the same order as they are in the original data frame? For example, I want to use 'by' to

Re: [R] plyr: issue with column names when converting one element list to dataframe

2010-01-08 Thread hadley wickham
Hi Mark, It'll be fixed in the next version of plyr. If you want to fix it yourself, inspect the source of list_to_dataframe and change the first data.frame to as.data.frame. Hadey On Wed, Jan 6, 2010 at 8:53 AM, Mark Heckmann mark.heckm...@gmx.de wrote: Hadley, thanks for the quick reply:

[R] Using outer with function predict

2010-01-08 Thread Etienne Stockhausen
Hey everybody, I have a problem with the combination of the commands outer() and predict(). I want to visualize the solutions of a regression modell in a matrix. Therefore I want to use the command predict for a linear modell as the function inside the command outer. I've made a small example:

Re: [R] Using outer with function predict

2010-01-08 Thread Henrique Dallazuanna
Try this: outer(x, y, FUN = function(x, y)predict(lm.1, data.frame(x, y))) On Fri, Jan 8, 2010 at 5:49 PM, Etienne Stockhausen einohr2...@web.de wrote: Hey everybody, I have a problem with the combination of the commands outer() and predict(). I want to visualize the solutions of a

[R] time series analysis for a time series without a regular frequency

2010-01-08 Thread Erin Hestir
Hello, I am trying to conduct a time series analysis on historic hydrologic data, but I cannot coerce it into class ts because it does not have regular sampling intervals (some years have 20 samples, other have 8). Specifically I am trying to perform a CUSUM or or other step change detection, but

Re: [R] Identifying outliers in non-normally distributed data

2010-01-08 Thread Jerry Floren
Thank you Kevin. I'm looking forward to trying your function when I get back to the office. Jerry Floren Minnesota Department of Agriculture Kevin Wright-5 wrote: Here is a simple function I use. It uses Median +/- 5.2 * MAD. If I recall, this flags about 1/2000 of values from a true

Re: [R] Online R documentation

2010-01-08 Thread Peter Keller
Karl Ove Hufthammer wrote: On Fri, 8 Jan 2010 10:03:31 -0500 Jonathan Baron ba...@psych.upenn.edu wrote: In case anybody is looking for ideas in how to improve the above site, inclusion of rendered example graphs, similar to the ones at http://www.metaresearch.de/exlib/;, would be

Re: [R] time series analysis for a time series without a regular frequency

2010-01-08 Thread Gabor Grothendieck
The zoo package supports irregularly spaced time series and if your create a zoo object z from your data then tt - as.ts(z) will give you a ts object, tt. Since a ts object must be regularly spaced this will add NAs to ensure that it is. On Fri, Jan 8, 2010 at 3:05 PM, Erin Hestir

[R] Variable Combinations in Regression

2010-01-08 Thread Richardson, Patrick
Let's say I have 8 variables and I want to generate all combinations of those variables (In pairs, threes fours, etc) to run in multiple linear regression. Is there a built-in function to do that in R? Or at a minimum, how could I take those variables and generate all possible combinations.

Re: [R] function by: order within subsets

2010-01-08 Thread Gabor Grothendieck
Try ave: transform(df, v = ave(v, f, FUN = cumsum)) On Fri, Jan 8, 2010 at 1:10 PM, Daniel Murphy chiefmur...@gmail.com wrote: When the 'by' function forms subsets, are the rows in the same order as they are in the original data frame? For example, I want to use 'by' to calculate cumulative

Re: [R] Arguments of a function

2010-01-08 Thread Lisa
That's what I want. Thank you so much. Lisa Henrique Dallazuanna wrote: Try this: my.f - function(a, b) { x1 - 2 * 3 x2 - 3 / 6 x3 - 4 * 4 / 5 - sqrt(2) y - get(deparse(substitute(a))) + get(deparse(substitute(b))) return(y) } my.f(x1, x2) On

Re: [R] Variable Combinations in Regression

2010-01-08 Thread Whit Armstrong
?expand.grid On Fri, Jan 8, 2010 at 3:26 PM, Richardson, Patrick patrick.richard...@vai.org wrote: Let's say I have 8 variables and I want to generate all combinations of those variables (In pairs, threes fours, etc) to run in multiple linear regression. Is there a built-in function to do

Re: [R] how to get perfect fit of lm if response is constant

2010-01-08 Thread Jan-Henrik Pötter
Thanks for the answer. The situation is that I don't know anything of y a priori. Of course I then would not do a regression on constant y's, but isn't it a problem of stability of the algorithm, if I get an adj RSquare of 0.6788 for a least square fit on this type of data? I think lm should

Re: [R] how to get perfect fit of lm if response is constant

2010-01-08 Thread Ista Zahn
Just to clarify this point: I don't think the problem is that y is perfectly fittable, but that it is constant. Since the variance of a constant is zero, there is no variance to explain. -Ista On Fri, Jan 8, 2010 at 2:32 PM, Jan-Henrik Pötter henrik.poet...@gmx.de wrote: Thanks for the answer.

[R] How to Merge based on Rows

2010-01-08 Thread MRKidd
Let's say that I have a bunch of matrices. They look like this (pardon using fruit for examples, my actual data tables are far too enormous): Matrix1 Apples Oranges Pears A 5 6 7 B 5 3 4 C 8 9 10 D 11

[R] A better way to Rank Data that considers ties

2010-01-08 Thread MRKidd
This will start off sounding very easy, but I think it will be very complicated. Let's say that I have a matrix, which shows the number of apples that each person in a group has. OriginalMatrix-matrix(c(2,3,5,4,6),nrow=5,ncol=1,byrow=T,dimnames=list(c(Bob,Frank,Joe,Jim,David),c(Apples)))

Re: [R] A better way to Rank Data that considers ties

2010-01-08 Thread Daniel Malter
Type ?rank in the prompt and look at the ties.method argument. Best, Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of MRKidd Sent: Friday,

[R] Singularity problem

2010-01-08 Thread Moohwan Kim
Dear R family I have a problem with invertibility in a matrix. m1 - ar(x, method='mle') Error in solve.default(res$hessian * length(x)) : Lapack routine dgesv: system is exactly singular How could I avoid this problem? Best Moohwan __

Re: [R] A better way to Rank Data that considers ties

2010-01-08 Thread Ted Harding
On 08-Jan-10 21:09:08, MRKidd wrote: This will start off sounding very easy, but I think it will be very complicated. Let's say that I have a matrix, which shows the number of apples that each person in a group has. OriginalMatrix-matrix(c(2,3,5,4,6),nrow=5,ncol=1,byrow=T,

Re: [R] How to Merge based on Rows

2010-01-08 Thread jim holtman
Is this what you want: x1$names - rownames(x1) x1 Apples Oranges Pears names A 5 6 7 A B 5 3 4 B C 8 910 C D 11 1314 D E 15 3 8 E F 1 4 5 F x2$names - rownames(x2) x2 Apples

Re: [R] Online R documentation

2010-01-08 Thread Jim Lemon
On 01/09/2010 12:41 AM, Jonathan Baron wrote: ... Such a website exists: http://finzi.psych.upenn.edu Right near the top is a set of links to (almost) all package documentation. Duncan Murdoch helped here by including an option to build static pages in the R source. There is also a search

Re: [R] solving cubic/quartic equations non-iteratively -- comparisons

2010-01-08 Thread Larry Hotchkiss
Hi, I'm responding to a post about finding roots of a cubic or quartic equation non-iteratively. One obviously could create functions using the explicit algebraic solutions. One post on the subject noted that the square-roots in those solutions also require iteration, and one post claimed

Re: [R] Variable Combinations in Regression

2010-01-08 Thread David Winsemius
On Jan 8, 2010, at 3:26 PM, Richardson, Patrick wrote: Let's say I have 8 variables and I want to generate all combinations of those variables (In pairs, threes fours, etc) to run in multiple linear regression. Is there a built-in function to do that in R? The formula syntax allows that.

Re: [R] How to Merge based on Rows

2010-01-08 Thread Gabor Grothendieck
Try this. (The second line removes the suffixes in the column names.) out - merge(x1, x2, by = 0, all = TRUE)[-1] names(out) - sub(\\..*, , names(out)) out Apples Oranges Pears Apples Oranges Pears 1 5 6 7 5 3 9 2 5 3 4 3 2 1 3

Re: [R] Singularity problem

2010-01-08 Thread David Winsemius
On Jan 8, 2010, at 4:50 PM, Moohwan Kim wrote: Dear R family I have a problem with invertibility in a matrix. m1 - ar(x, method='mle') Error in solve.default(res$hessian * length(x)) : Lapack routine dgesv: system is exactly singular How could I avoid this problem? Take out the

[R] strange behavior of R

2010-01-08 Thread Fahim
Hi I observed an interesting behavior of R. Can you find where is the bug, or it is not a bug but made deliberately. - Hide quoted text - arr = c();#defined the empty array a= c(x1, x2); b = c(y1, y2); arr = rbind(arr,a);#row bind the first

Re: [R] strange behavior of R

2010-01-08 Thread Sarah Goslee
You need to reread the help for [, specifically the drop argument. ?[ Sarah On Fri, Jan 8, 2010 at 5:57 PM, Fahim fahim...@gmail.com wrote: Hi I observed an interesting behavior of R. Can you find where is the bug, or it is not a bug but made deliberately. - Hide quoted text - arr =

Re: [R] strange behavior of R

2010-01-08 Thread David Winsemius
On Jan 8, 2010, at 5:57 PM, Fahim wrote: Hi I observed an interesting behavior of R. Can you find where is the bug, or it is not a bug but made deliberately. - Hide quoted text - arr = c();#defined the empty array a= c(x1, x2); b = c(y1, y2); arr = rbind(arr,a);

[R] Functions for QUAIDS and nonlinear SUR?

2010-01-08 Thread Werner W.
Hi, I would like to estimate a quadratic almost ideal demand system in R which is estimated usually by nonlinear seemingly unrelated regression. But there is no such function in R yet but it is readily available in STATA (nlsur), see B. Poi (2008): Demand-system estimation: Update, Stata

Re: [R] how to organize a lot of R source files

2010-01-08 Thread Jim Lemon
Hi Jeff, Your request makes a lot of sense. I often modify files in the packages I maintain, typically by loading the package, then working on a copy of the function, continually sourcing the new code until it works correctly, and then checking and building the package. Apart from the

Re: [R] Online R documentation

2010-01-08 Thread Liviu Andronic
On Fri, Jan 8, 2010 at 10:06 PM, Jim Lemon j...@bitwrit.com.au wrote: It's not the first time I've said it, but Jonathan Baron's search engine has always provided answers when my local R help can't. The only change I would make is to default to searching R functions only. Another interface to

[R] lattice, add text to xyplot

2010-01-08 Thread Ivan Gregoretti
Hello listers, Does anybody know how to add text to an xyplot without whipping out the existing curve? That's all. For instance, Lets say you generate a graph like this A - data.frame(x = rnorm(100), y = rnorm(100)) xyplot(y ~ x, data = A) How would you add 'Hello world'? I tried 6.02E23

Re: [R] Arguments of a function

2010-01-08 Thread Jim Lemon
On 01/09/2010 05:15 AM, Lisa wrote: Dear all, I have a question about how to set arguments in my own function. For example, I have a function that looks like this: my.f- function(a = x1, b = x2) { x1 = equation 1 x2 = equation 2 x3 = equation 3 y = a + b } x1, x2, and x3 are

Re: [R] how to organize a lot of R source files

2010-01-08 Thread Henrik Bengtsson
library(R.utils); sourceDirectory(myRFiles/, modifiedOnly=TRUE); See ?sourceDirectory (regardless what the Rd help say, any '...' argument is passed to sourceTo()). /Henrik On Fri, Jan 8, 2010 at 7:38 AM, Hao Cen h...@andrew.cmu.edu wrote: Hi, I wonder what is a better way to organize a lot

Re: [R] lattice, add text to xyplot

2010-01-08 Thread Jason Morgan
On 2010.01.08 19:44:39, Ivan Gregoretti wrote: Hello listers, Does anybody know how to add text to an xyplot without whipping out the existing curve? That's all. For instance, Lets say you generate a graph like this A - data.frame(x = rnorm(100), y = rnorm(100)) xyplot(y ~ x, data

Re: [R] lattice, add text to xyplot

2010-01-08 Thread David Winsemius
On Jan 8, 2010, at 8:10 PM, Jason Morgan wrote: On 2010.01.08 19:44:39, Ivan Gregoretti wrote: Hello listers, Does anybody know how to add text to an xyplot without whipping out the existing curve? That's all. For instance, Lets say you generate a graph like this A - data.frame(x =

Re: [R] lattice, add text to xyplot

2010-01-08 Thread Ivan Gregoretti
Thank you. It works. Ivan Ivan Gregoretti, PhD National Institute of Diabetes and Digestive and Kidney Diseases National Institutes of Health 5 Memorial Dr, Building 5, Room 205. Bethesda, MD 20892. USA. On Fri, Jan 8, 2010 at 8:13 PM, David Winsemius dwinsem...@comcast.net wrote: On Jan 8,

[R] Plotting numeric values against non numeric items

2010-01-08 Thread lse1986
Hi i want do a line graph. My y axis contains numeric values. My x axis contains non numeric statements. This is what i want the graph to look like. When i try to plot this graph on R it comes up with the following error message: Error in plot.window(...) : need finite 'xlim' values In