[R] random uniform sample of points on an ellipsoid (e.g. WGS84)

2007-02-21 Thread Russell Senior
I am interested in making a random sample from a uniform distribution of points over the surface of the earth, using the WGS84 ellipsoid as a model for the earth. I know how to do this for a sphere, but would like to do better. I can supply random numbers, want latitude longitude pairs out.

[R] Coxph and ordered factors

2007-02-21 Thread Florent Baty
Dear useRs, I am trying to fit a Cox PH model on survival data from a lung cancer dataset. I would like to include the patient staging (I-IV) as a covariate. For this I use the following function: coxph(Surv(time,status) ~ stage) The staging information is a categorical variable, and it is

Re: [R] reading text file not table

2007-02-21 Thread nalluri pratap
Hi, You can read a CSV file using the following way MyData-read.csv(file.choose()) Regards, Pratap [EMAIL PROTECTED] wrote: On 17-Feb-07 H. Paul Benton wrote: Hello all, I'm looking for a way to be able to read a text file into R. It's a csv file but when I do txt

[R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread Michael Dondrup
Dear all, I would like to use the Levenberg-Marquardt algorithm for non-linear least-squares regression using function nls.lm. Can anybody help me to find a a way to compute confidence intervals on the fitted parameters as it is possible for nls (using confint.nls, which does not work for

Re: [R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread Prof Brian Ripley
Well, the algorithm used does not affect the confidence interval (provided it works correctly), but what is nls.ml (presumably in some package you have not mentioned) and why would I want to use an old-fashioned algorithm? You could start nls at the solution you got from nls.ml and use

[R] R unstable and crashes after executing .C

2007-02-21 Thread Sole Acha, Xavi
Dear R listers, I have developed a C function to be executed from R through the .C interface. After doing dyn.load, the function executes properly and I get the results. However, after executing my function, R seems to get unstable and crashes (giving a segmentation fault and exiting) whenever

Re: [R] Splom plot:how to plot with different symbols?

2007-02-21 Thread Deepayan Sarkar
On 2/20/07, d. sarthi maheshwari [EMAIL PROTECTED] wrote: Hi, Kindly let me know if I posted a wrong question in the forum. I want to draw a splom plot with different symbols in plot. My command is as follows: splom(~ log10(splomData[2:3]), groups = programs, data = splomData, panel =

Re: [R] random effect nested within fixed effects (binomial lmer)

2007-02-21 Thread lorenz.gygax
But I recently realized something. Most of the variables that I've tested as fixed effects are properties of the subject (e.g. Race, Gender, etc.). Is it correct to be using a random effect Subject that is nested within (partially-crossed) fixed effects like Gender and Race? Yes. I

Re: [R] GLS models - bootstrapping

2007-02-21 Thread Christian Kamenik
Dear Lillian, I tried to estimate parameters for time series regression using time series bootstrapping as described on page 434 in Davison Hinkley (1997) - bootstrap methods and their application. This approach is based on an AR process (ARIMA model) with a regression term (compare also with

Re: [R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread Michael Dondrup
Thank you, sorry, I forgot to mention that nls.lm is in package minpack.lm. It's use is motivated by the wish of a colleague to reproduce a result from some publication. But if I understand you correctly, use of the methods implemented in nls or optim is preferred? Prof Brian Ripley wrote:

Re: [R] [ANTISPAM CHU_NANCY] Re: contingency table for several variables

2007-02-21 Thread David LEVY
Thank you for your replies, But xtab(PrettyR) does something different, it computes several tables. Each table corresponds to a different combination of the levels of the right hand formula's variables. I only have 3 levels according to my “classification variable” . I want to gather in a single

[R] Problems with obtaining t-tests of regression

2007-02-21 Thread Millo Giovanni
Guillermo, I am dropping most of your mail because my answer is very generic. First, why doesn't it work as you tried it: technically speaking, coeftest() and the like expect to be feed an lm or a glm object and for this reason won't accept the result of systemfit(), which is a much different

Re: [R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread Prof Brian Ripley
On Wed, 21 Feb 2007, Michael Dondrup wrote: Thank you, sorry, I forgot to mention that nls.lm is in package minpack.lm. It's use is motivated by the wish of a colleague to reproduce a result from some publication. But if I understand you correctly, use of the methods implemented in nls or

Re: [R] R unstable and crashes after executing .C

2007-02-21 Thread Prof Brian Ripley
This really is the wrong list for C programming questions related to R. See the posting guide and consider R-devel. See also the debugging advice in 'Writing R Extensions'. Almost certainly your C code has destroyed R structures, most likely by writing outside array bounds. Running under

Re: [R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread joerg van den hoff
On Wed, Feb 21, 2007 at 11:09:52AM +, Prof Brian Ripley wrote: Well, the algorithm used does not affect the confidence interval (provided it works correctly), but what is nls.ml (presumably in some package you have not mentioned) and why would I want to use an old-fashioned algorithm?

[R] Omiting repeated values

2007-02-21 Thread stat stat
Dear all R users, Is there any function to omit repeated values in a vector? Your help will be highly appreciated. Thanks stat - Here’s a new way to find what you're looking for - Yahoo! Answers

Re: [R] Omiting repeated values

2007-02-21 Thread jim holtman
?duplicated On 2/21/07, stat stat [EMAIL PROTECTED] wrote: Dear all R users, Is there any function to omit repeated values in a vector? Your help will be highly appreciated. Thanks stat - Here's a new way to find what you're looking for - Yahoo! Answers

Re: [R] Splom plot:how to plot with different symbols?

2007-02-21 Thread Stephen Tucker
I believe you can add these lines before your splom() command: super.sym - trellis.par.get(superpose.symbol) super.sym$pch - 1:length(super.sym$pch) # change this # to specify symbols trellis.par.set(superpose.symbol,super.sym) Best regards, --- d.

Re: [R] Omiting repeated values

2007-02-21 Thread Dimitris Rizopoulos
x - sample(1:3, 20, TRUE) x # do you mean unique(x) # or rle(x)$values I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax:

Re: [R] Omiting repeated values

2007-02-21 Thread Oleg Sklyar
Hi, 'unique' or its combination with 'match' if you need to keep the vector the same length will do it: a-c(1,2,4,2,5,5,6,7,8) unique(a) [1] 1 2 4 5 6 7 8 a[ which( is.na( match(1:length(a), match(unique(a),a)) ) ) ]=NA a [1] 1 2 4 NA 5 NA 6 7 8 This is probably not the best

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Rainer Hurling
Brian, thank you for the adaptions. I tried the new version under R-2.5.0 (2007-01-23 r40560) on FreeBSD 7.0-CURRENT and got the following output. - #R CMD INSTALL rgl_0.70-1.tar.gz * Installing to library '/usr/local/lib/R/library' * Installing *source* package 'rgl' ... checking for

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Prof Brian Ripley
It seems log2 is not used so you can just comment out the line. I am working on a better configure script, and will have something to show you later today. BDR On Wed, 21 Feb 2007, Rainer Hurling wrote: Brian, thank you for the adaptions. I tried the new version under R-2.5.0 (2007-01-23

[R] Examples on how to READ/WRITE to database using R-Project

2007-02-21 Thread Venkatesh Mantha
Hi, We are working on a project on forecast modeling and would like to know if there are any examples on how to READ/WRITE to a database (e.g. PostgreSQL) using R-Project. I do have a sample R Script which takes input as files from a directory and writes back output files to a directory. I

[R] contingency table for several variables

2007-02-21 Thread David Meyer
David: I ‘m trying to draw ONE table that summarize SEVERAL categorical variables according to one classification variable, say “sex”. The result would look like several contingency tables appended one to the other. All the variables belong to a data frame. The summary.formula in

Re: [R] Examples on how to READ/WRITE to database using R-Project

2007-02-21 Thread Robert Baer
We are working on a project on forecast modeling and would like to know if there are any examples on how to READ/WRITE to a database (e.g. PostgreSQL) using R-Project. I do have a sample R Script which takes input as files from a directory and writes back output files to a directory. I

Re: [R] Examples on how to READ/WRITE to database using R-Project

2007-02-21 Thread Roland Rau
Hi, On 2/21/07, Venkatesh Mantha [EMAIL PROTECTED] wrote: We are working on a project on forecast modeling and would like to know if there are any examples on how to READ/WRITE to a database (e.g. PostgreSQL) did you have a look at the Manual R Data Import/Export? I have to admit that I

[R] Trying to get an apply to work with a list in applying names to tables

2007-02-21 Thread John Kane
I am trying to use apply and a list to supply names to a set of tables I want to generate. Below is an example that I hope mimics the larger original problem. EXAMPLE aa - c( 2,2,1,1,2) bb - c(5,6,6,7,4) aan - c(yes, no) bbn - c(a, b, c, d) mynames - c(abby, billy) mylist - list(aan, bbn);

Re: [R] Trying to get an apply to work with a list in applying names totables

2007-02-21 Thread ONKELINX, Thierry
John, Two things. You don't need to pout the cc variable in the apply. Use instead something like this. apply(cc, 2, fn1, y = mylist) But this still doesn't solve your problem. You'll need to rewrite your function like this. fn2 - function(x, y, i){ + tt - table(x[, i]) + names(tt) -

[R] 3F2 hypergeometric function

2007-02-21 Thread Lucke, Joseph F
Does anyone have code for the 3F2 hypergeometric function? I am looking for code similar to the 2F1 hypergeometric function implemented as hyperg_2F1 in the GSL package. TIA. ---Joe __ R-help@stat.math.ethz.ch mailing list

Re: [R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread Douglas Bates
On 2/21/07, joerg van den hoff [EMAIL PROTECTED] wrote: On Wed, Feb 21, 2007 at 11:09:52AM +, Prof Brian Ripley wrote: Well, the algorithm used does not affect the confidence interval (provided it works correctly), but what is nls.ml (presumably in some package you have not mentioned)

Re: [R] Trying to get an apply to work with a list in applying names totables

2007-02-21 Thread Marc Schwartz
I might suggest an alternative, since you seem to be creating the underlying data set from scratch. Create the data frame with the requisite data structures to start with and then perform the table operations: # First create your vectors as factors. See ?factor aa - factor(c(2,2,1,1,2), levels

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Rainer Hurling
Brian, I just tried your version rgl_0.70-2 with R-2.5.0 on FreeBSD 7.0-CURRENT (i386) and it works! Thank you very much for this competently and very fast help. Next I will try if it compiles on amd64, too ... Rainer Prof Brian Ripley schrieb: This looks to me like a problem in your

[R] file path

2007-02-21 Thread Rita Sousa
Hello, It is possible to return the path of the current working R-file (in execution)? Thanks, Rita Sousa. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] R Introduction Course - LONDON

2007-02-21 Thread Romain Francois
Mango Solutions are pleased to announce the above course in London as part of our schedule for Q1 2007. --- Introduction to R and R Programming - 26th-28th March 2007

Re: [R] file path

2007-02-21 Thread Henrique Dallazuanna
I think: getwd() is you want. On 21/02/07, Rita Sousa [EMAIL PROTECTED] wrote: Hello, It is possible to return the path of the current working R-file (in execution)? Thanks, Rita Sousa. [[alternative HTML version deleted]] __

Re: [R] file path

2007-02-21 Thread Gabor Grothendieck
Its not clear from your post what the framework is that you are working with but assuming that you have sourced a file and want its name place this fn - parent.frame(2)$ofile # other code in a file a.R, say, and from within R source it: source(a.R) This is not very safe and could

Re: [R] Examples on how to READ/WRITE to database using R-Project

2007-02-21 Thread Neuro LeSuperHéros
You haven't told us your OS. Here's how I do it on Win2K with MySQL. PostgreSQL should be similar. If you are on Linux, you should read this: http://help.nceas.ucsb.edu/index.php/R:_Data_input/output #download and install ODBC driverhttp://dev.mysql.com/downloads/connector/odbc/3.51.html

[R] how much performance penalty does this incur, scalar as a vector of one element?

2007-02-21 Thread Jason Liao
I have been comparing R with other languages and systems. One peculiar feature of R is there is no scalar. Instead, it is just a vector of length one. I wondered how much performance penalty this deign cause, particular in situations with many scalars in a program. Thanks. Jason Liao,

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Rainer Hurling
Just another note: rgl_0.70-2 works also for R-2.5.0 on FreeBSD 7.0-CURRENT (amd64) and for R-2.4.1 on (i386). Rainer Prof Brian Ripley wrote: This looks to me like a problem in your OpenGL, I am afraid. I've made available a (completely unofficial) revised tarball at

[R] How to get the equation of a graph after i have plotted the datas?

2007-02-21 Thread ainhoaº lezama
Hello! I have a doubt and i need a quick answer please!! I need to know if its possible to get in R the mathematical equation of a graph that you have plotted. I mean i know the y and x values, but i want the equation that relate them and that allow me to get the graph. This option is

Re: [R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread Joerg van den Hoff
On Wed, Feb 21, 2007 at 09:41:29AM -0600, Douglas Bates wrote: On 2/21/07, joerg van den hoff [EMAIL PROTECTED] wrote: On Wed, Feb 21, 2007 at 11:09:52AM +, Prof Brian Ripley wrote: Well, the algorithm used does not affect the confidence interval (provided it works correctly), but what

Re: [R] How to get the equation of a graph after i have plotted the datas?

2007-02-21 Thread Marc Schwartz
On Wed, 2007-02-21 at 18:20 +, ainhoaº lezama wrote: Hello! I have a doubt and i need a quick answer please!! I need to know if its possible to get in R the mathematical equation of a graph that you have plotted. I mean i know the y and x values, but i want the equation that relate

[R] glms with poisson and negative binomial errors

2007-02-21 Thread Jarrett Byrnes
A reviewer recently remarked to me that, due to my data being constrained to not fall below zero, a generalized linear model with a negative binomial error (or poisson) with a log link would be more appropriate for fitting my model. I ran it in R with glm.nb() and got results that matched

[R] Course*** R/S+: Fundamentals and Programming Techniques - Princeton, March 1-2

2007-02-21 Thread Sue Turner
XLSolutions Corporation is proud to announce our March 2007 R/S: Fundamentals and Programming Techniques - in Princeton March 1-2, 2007 : http://www.xlsolutions-corp.com/Rfund.htm This two-day beginner to intermediate R/S-plus course focuses on a broad spectrum of topics, from reading raw

[R] choose.files() on a mac

2007-02-21 Thread Matthew Bridgman
the function 'choose.files()' won't work on my mac version of R Does anyone know of a comparable function? Thanks, Matt __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] simple question on one-sided p-values for coef() on output of lm()

2007-02-21 Thread Ranjan Maitra
Dear list, I was wondering if it is possible to get the p-values for one-sided tests on the parameters of a linear regression. For instance, I use lm() and store the result in an object. lm() gives me a matrix, using summary() and coef() on which gives me a matrix containing the

[R] Coxph and ordered factors

2007-02-21 Thread Terry Therneau
No, coxph does not have any special code to deal with ordered factors. You can do it by hand by using the pool-adjacent-violators algorithm 1. Fit the data with stage as a categorical 2. Verify that the coefficients are ordered if so, you are done if not, assume that they

Re: [R] choose.files() on a mac

2007-02-21 Thread Marc Schwartz
On Wed, 2007-02-21 at 11:49 -0800, Matthew Bridgman wrote: the function 'choose.files()' won't work on my mac version of R Does anyone know of a comparable function? Thanks, Matt choose.files() is Windows specific. Look at ?file.choose which should be available otherwise. HTH, Marc

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Dirk Eddelbuettel
FWIW, Debian had working rgl packages since March 2004 -- version 0.64. So I respectfully disagree with the general state of despair regarding the source package. I had my build issues at times, but Daniel and Duncan worked hard and diligently to overcome these. Hence, apt-get install

Re: [R] simple question on one-sided p-values for coef() on output of lm()

2007-02-21 Thread Prof Brian Ripley
On Wed, 21 Feb 2007, Ranjan Maitra wrote: I was wondering if it is possible to get the p-values for one-sided tests on the parameters of a linear regression. For instance, I use lm() and store the result in an object. lm() gives me a matrix, using summary() and coef() on which gives me a

Re: [R] simple question on one-sided p-values for coef() on output of lm()

2007-02-21 Thread Ranjan Maitra
Yes, of course! Thank you. So, I guess the answer is that R itself can not be made to do so directly. Many thanks for confirming this. Sincerely, Ranjan On Wed, 21 Feb 2007 20:23:55 + (GMT) Prof Brian Ripley [EMAIL PROTECTED] wrote: On Wed, 21 Feb 2007, Ranjan Maitra wrote: I was

[R] Looking for info on R Advanced programming in the West Coast

2007-02-21 Thread Tim McDonald
Hi folks, If you know of any upcoming R Advanced Programming in the West Coast - USA, please let me know. Thanks - Tim - Need Mail bonding? - Never Miss an Email [[alternative HTML version deleted]]

[R] R under Pocket PC

2007-02-21 Thread Uzuner, Tolga
Hi Folks, Picking up on an old thread from 2004... has anyone managed to get a version of R runnning under Windows Mobile 5.0/Pocket PC ? best, Tolga == Please access the attached hyperlink for an important

Re: [R] simple question on one-sided p-values for coef() on output of lm()

2007-02-21 Thread Dimitris Rizopoulos
Quoting Ranjan Maitra [EMAIL PROTECTED]: Yes, of course! Thank you. So, I guess the answer is that R itself can not be made to do so directly. Many thanks for confirming this. Sincerely, Ranjan On Wed, 21 Feb 2007 20:23:55 + (GMT) Prof Brian Ripley [EMAIL PROTECTED] wrote:

Re: [R] linux gplots install unhappy

2007-02-21 Thread Randy Zelick
Thanks to the many folks who responded, and apologies for being so dense! The different behavior between windows and linux relative to install defaults tripped me up. I had not thought about the dependencies switch. All working fine now. Cheers, =Randy= R. Zelick

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Rainer Hurling
Dirk, I agree with you. My statements were only related to rgl on FreeBSD. With the changes from Brian since yesterday I am finally able to compile and work with this package on all our FreeBSD scientific desktops. At the same time I am very conscious about the great job of Daniel and Duncan.

[R] Chi-Square test

2007-02-21 Thread Mohsen Jafarikia
Hello all, I am doing a Likelihood Ratio (LR) test in my simulation and I have a vector LR values (each with 1 degree of freedom) at the end of my simulation. Can anybody tell me how I can write a 'R' code which gives me the p-value for each of those LR values. Thanks [[alternative HTML

[R] Data frame operations getting slower when accessed by index

2007-02-21 Thread Alp ATICI
I have a data frame called df which has about 100 columns but thousands of rows. I set D the index of df$D and M to be the index of df$M. When I run the following loop as it is vs. df[,D] and df[,M] replaced with df$D and df$M there is a real big time difference in completion (with the latter

Re: [R] color quantization / binning a variable into levels

2007-02-21 Thread David Forrest
My apologies for the tremendously tardy reply, but I ran into a similar problem and discovered findInterval and colorRampPallet as an alternative and though it might be worthy of a RSiteSearch() result for someone. ?findInterval ?colorRampPalette jet.colors -

[R] Estimating a bivariate VAR(X) and using F-tests

2007-02-21 Thread Leeds, Mark \(IED\)
I would like to estimate bivariate VAR(X) models where I don't know the optimal lag length X and would also like to use F-tests to determine the granger causality of each of the variables. I'm aware of Achim's econometric packages description but I was wondering if someone could recommend a

[R] Problem with rjava in linux

2007-02-21 Thread Ronaldo Reis Junior
Hi, I install rJava in linux. The installation, from source, is ok. But I have this error on load package. library(rJava) Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library '/usr/local/lib/R/site-library/rJava/libs/rJava.so': libjvm.so: cannot

Re: [R] Problem with rjava in linux Ignore

2007-02-21 Thread Ronaldo Reis Junior
Ignore my message, Now it work. Thanks and sorry. Ronaldo -- Nunca tente ensinar um porco cantar. Voce perde seu tempo e ainda chateia o porco! -- Prof. Ronaldo Reis Júnior | .''`. UNIMONTES/Depto. Biologia Geral/Lab. Ecologia Evolutiva | : :' : Campus Universitário Prof. Darcy Ribeiro,

Re: [R] Data frame operations getting slower when accessed by index

2007-02-21 Thread Prof Brian Ripley
What are D and M? 'Index' here could be a number or a name. In either case, df[[D]] would be the equivalent of df$D. However, your computation does not need a loop at all, let alone two. Try something like tmp - with(df, paste(D, m)) dates - unique(tmp) On Wed, 21 Feb 2007, Alp ATICI wrote:

[R] loops in R help me please

2007-02-21 Thread rose bentosa
I am trying to make the following Kalman filter equations work and therefore produce their graphs. v_t=y_t - a_t a_t+1=a_t+K_t*v_t F_t=P_t+sigma.squared.epsilon P_t+1=P_t*(1-K_t)+sigma.squared.eta K_t=P_t/F_t Given: a_1=0,P_1=10^7,sigma.squared.epsilon=15099, sigma.squared.eta=1469.1 I have

[R] interacting factors in lmer [was: error using user-defined link function]

2007-02-21 Thread Daniel Ezra Johnson
For what it's worth, I've been getting the exact same error message as in the previous thread (see http://tolstoy.newcastle.edu.au/R/e2/ help/07/02/10269.html etc.): Error in if (any(sd 0)) return('sd' slot has negative entries) : missing value where TRUE/FALSE needed as well as

Re: [R] glms with poisson and negative binomial errors

2007-02-21 Thread Peter Dunn
If your data are continuous but must be positive, consider a gamma or inverse gaussian glm. If your data are non-negative (is positive but could include zeros), consider glms based on Tweedie distributions. See, for example: http://cran.ms.unimelb.edu.au/src/contrib/Descriptions/tweedie.html

Re: [R] Trying to get an apply to work with a list in applying names totables

2007-02-21 Thread John Kane
Thanks Thierry, it works perfectly. And your explanation of what sapply was doing was really helpful. Actually, your solution is showing me that whoever input the data didn't stick to the coding manual by that' another story. --- ONKELINX, Thierry [EMAIL PROTECTED] wrote: John, Two

[R] Is there better alternative to this loop?

2007-02-21 Thread Alfonso Sammassimo
Dear List, Thanks to those who helped with my enquiry a few days ago. I have a another question on loops, in this case I am trying to print out the row of a data frame if the previous 3 values (daily values) in col5 are in descending order. I have this loop which works, but ask whether this

[R] Relative ranking by a factor

2007-02-21 Thread jiho.han
Hi, R experts- I am trying to create a function that returns a quintile (or decile) ranking of a variable controlled by a factor. For example, suppose there are 10 people each in class A (1st graders) and class B (2nd graders). If you want to calculate quintile rank for each class, how would you

Re: [R] loops in R help me please

2007-02-21 Thread Neuro LeSuperHéros
Rose, 1- Inside your loop, you have to use F1[i], not F[i] (2 occurences). By the way, never use F (or T) as variables in R, because it also means FALSE and TRUE. 2- Your P update must be at the end of the loop. You haven't calculated your K[i] yet where you placed it. y-(Nile)

[R] write fixed format

2007-02-21 Thread YIHSU CHEN
Dear R users; Is there a function in R that I can put text with proper alignments in a fixed format. For instance, if I have three fields: A, B and C, where both A and C are text with 3 characters and left alignment; B is a numeric one with 2 decimals and 3 integer space digits. How can I

Re: [R] write fixed format

2007-02-21 Thread Jeffrey Horner
YIHSU CHEN wrote: Dear R users; Is there a function in R that I can put text with proper alignments in a fixed format. For instance, if I have three fields: A, B and C, where both A and C are text with 3 characters and left alignment; B is a numeric one with 2 decimals and 3 integer

Re: [R] Is there better alternative to this loop?

2007-02-21 Thread jim holtman
You can use 'rle' to find the 'runs' of decreasing values by looking at the 'diff'. You can change the values to get the different lengths of runs. # generate some test data set.seed(3) x - runif(100) # use 'diff' to determine if decreasing x.dec - diff(x) 0 # use rle to find 'runs' of 3

[R] [MacOSX] Screencast for R and Sweave on TextMate

2007-02-21 Thread Charilaos Skiadas
This will likely be of interest only (if at all) to MacOSX users. I use a particular editor called TextMate which I find particularly suitable for pretty much any task I have to do, from Ruby to LaTeX to R. Its R support is probably not quite up to par with ESS yet, but it is at a decent

[R] Minor Tick Marks in Lattice

2007-02-21 Thread Rene Braeckman
I have a couple if issues with the code below. 1. as.Table=TRUE has no effect 2. the minor tick marks on top of the top panels are drawn in the strips and not on the axes. Any ideas what's wrong? There are probably better ways to add minor tick marks... Thanks for any help. Rene

Re: [R] applying lm on an array of observations with common design matrix

2007-02-21 Thread Ranjan Maitra
On Sun, 18 Feb 2007 07:46:56 + (GMT) Prof Brian Ripley [EMAIL PROTECTED] wrote: On Sat, 17 Feb 2007, Ranjan Maitra wrote: Dear list, I have a 4-dimensional array Y of dimension 330 x 67 x 35 x 51. I have a design matrix X of dimension 330 x 4. I want to fit a linear regression

Re: [R] Is there better alternative to this loop?

2007-02-21 Thread Marc Schwartz
On Thu, 2007-02-22 at 12:33 +1100, Alfonso Sammassimo wrote: Dear List, Thanks to those who helped with my enquiry a few days ago. I have a another question on loops, in this case I am trying to print out the row of a data frame if the previous 3 values (daily values) in col5 are in

Re: [R] applying lm on an array of observations with common design matrix

2007-02-21 Thread Petr Klasterecky
Ranjan Maitra napsal(a): On Sun, 18 Feb 2007 07:46:56 + (GMT) Prof Brian Ripley [EMAIL PROTECTED] wrote: On Sat, 17 Feb 2007, Ranjan Maitra wrote: Dear list, I have a 4-dimensional array Y of dimension 330 x 67 x 35 x 51. I have a design matrix X of dimension 330 x 4. I want to fit