Re: [R] scale or not to scale that is the question - prcomp

2009-08-20 Thread Petr PIKAL
OIS Thank you both for pointing me to it. I did not notice this as the unscaled position of points was quite clear and strightforward according to my knowledge of data. The scaled plot is slightly more distorted and the relationships are not so obvious. Thank you both Petr Pikal

[R] Unable to load RHtestV2

2009-08-20 Thread bpasakhala
Dear All, I am not being able to load RHtestV2 or rhtest_gui.r for homogeneity test of climatic data. I have 2 user manual RHTest (0.95) and RHtestV2. Though, I load source code for RHtestV2 no any other window pops up. However, I am unable to find source code rhtest_gui.r. Regards, Binaya

Re: [R] Embedding lists in matrices and matrices in lists

2009-08-20 Thread Petr PIKAL
Hi Michael Kogan michael.ko...@gmx.net napsal dne 19.08.2009 17:22:04: Thanks, that was the solution! But in fact I didn't want to have this list of lists layer at all. And now I'm having trouble writing matrices into the database. It's really really strange... If I write a matrix into

Re: [R] [Hmisc] latex() with ctable=T inserting unwanted empty line in .tex file when used on summary.formula(method=reverse) object

2009-08-20 Thread Dieter Menne
Vincent Chouraki wrote: When I'm using Hmisc's latex() function with ctable=TRUE on a summary.formula with method=reverse object and saving in a .tex file, the latter contains an unwanted empty line which makes compilation fail. ... Example removed Vincent, I checked it and

Re: [R] ggsave to .png bug in ggplot2 (?)

2009-08-20 Thread Dieter Menne
Chris Friedl wrote: Text is really small and legend boxes are huge in this plot when saved to .png with ggsave. Plot is correct (i.e. looks the same as the screen) when saved with dev.print. Saving to .pdf with ggsave give the correct output. You are not alone. Things like this always

[R] expanding 1:12 months to Jan:Dec

2009-08-20 Thread Liviu Andronic
Dear R users I would like to do some spreadsheet style expansion of dates. For example, I would need to obtain a vector of months. I approached in an obviously wrong way: paste(01:12) [1] 1 2 3 4 5 6 7 8 9 10 11 12 as.Date(paste(01:12), %m) [1] NA NA NA NA NA NA NA NA NA NA NA NA to

Re: [R] mild and extreme outliers in boxplot

2009-08-20 Thread Ottorino-Luca Pantani
Hi Jimmy, please be reassured that I did not intend to offend you nor any other in the list. Rnewbie ha scritto: I read the boxplot() help file and googled before making the post, and with my little knowledge on R I was not able to plot in the way I wanted. If I'm allowed, this was not

Re: [R] mild and extreme outliers in boxplot

2009-08-20 Thread Gavin Simpson
Hi Rolf, On Thu, 2009-08-20 at 12:31 +1200, Rolf Turner wrote: I despair. Why do you keep insisting that black is white? The OP wanted to be able to specify an argument to boxplot() that would cause it to plot mild and extreme outliers with different symbols. Then you and I were reading

Re: [R] mild and extreme outliers in boxplot

2009-08-20 Thread Ottorino-Luca Pantani
I'm very sorry for all this, but still serene. I'm (trying) to use R since may be 5 or 6 years now. What I learned from this list is that you have to show some code to let others to help you out, a thing that Rnewbye did not in this particular case. I had a look myself at the help pages and

Re: [R] Package read large file

2009-08-20 Thread Mohamed Lajnef
Dear Jim Michael the file contains 1000 lines and 1.200.000 columns, txt format and i wish to read all the file with R if possible, or read a few columns? I tried without success to turn bigmemory and colbycol packages, also scan and readLines function but It takes a long time without

[R] print selected variables

2009-08-20 Thread rajclinasia
Hi every one, I read one excel external file into R, in that R dataset i have 20 variables. now my querry is i want to print only selected variables (eg:10 variables) with complete data. pls send me the code it will be very helpful for us. Thanks in Advance. -- View this message in context:

[R] how to categorize continuous variable when useing regression

2009-08-20 Thread Manli Yan
assume dependent variable y( continuous),independent variable x ( continuous),I try to categorize x with some interval,such that,those intervals would has most significant different effect on y. any one knows which method I should apply,I really need some hints,thanks so much~

Re: [R] expanding 1:12 months to Jan:Dec

2009-08-20 Thread Gavin Simpson
On Thu, 2009-08-20 at 08:14 +0100, Liviu Andronic wrote: Dear R users I would like to do some spreadsheet style expansion of dates. For example, I would need to obtain a vector of months. I approached in an obviously wrong way: paste(01:12) [1] 1 2 3 4 5 6 7 8 9 10 11 12

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Paul Hiemstra
Rakknar wrote: Hello everybody. I've been learning R for about a month to do a econometric study and now i'm stuck with some problems to make R do the things I want. Here I give the list of things I wanna do from the most simple to the more complex (for me of course): 1. Make a log. I've

Re: [R] print selected variables

2009-08-20 Thread Paul Hiemstra
rajclinasia wrote: Hi every one, I read one excel external file into R, in that R dataset i have 20 variables. now my querry is i want to print only selected variables (eg:10 variables) with complete data. pls send me the code it will be very helpful for us. Thanks in Advance. Hi, Please

Re: [R] expanding 1:12 months to Jan:Dec

2009-08-20 Thread Moshe Olshansky
One possible (but not very elegant) solution is: aa - paste(1:12,:10:2009,sep=) dd-as.Date(aa,format=%m:%d:%Y) mon - format(dd,%b) mon [1] Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec --- On Thu, 20/8/09, Liviu Andronic landronim...@gmail.com wrote: From: Liviu Andronic

Re: [R] Contrasts within ANOVA frame (Repost)

2009-08-20 Thread Mark Difford
Hi Jun, I have three levels for a factor names StdLot and want to make three comparisons, 1 vs 2, 1 vs 3 and 2 vs 3. With only three levels to your factor, the contrast matrix you are specifying is over-parametrized (i.e. over-specified): it has 3 rows and 3 columns. ## Look at the default

[R] change default measurement unit to millimetre

2009-08-20 Thread e-letter
Readers, How do I configure R so that all units of measurement are in millimetres? For example if I want to set the width of a graph, I want to write: width=100 and R interprets this value as millimetres. Yours, rh...@conference.jabber.org r 251 mandriva 2008

[R] eval and evironments: call local function in a global function

2009-08-20 Thread Renaud Gaujoux
Hi, in my project I want the user to be able to write hook functions that are in turn called in my main code. I'd like the user's hooks to be able to call some function that set a variable outside their running environment. The trick is that this variable is not global, but defined on

Re: [R] Fitting a logistic regression

2009-08-20 Thread Dani Valverde
Thank you very much, Jun. This is what I was looking for. Best! Dani On Wed, 2009-08-19 at 09:52 -0500, Jun Shen wrote: I would suggest a model with a baseline level, something like nls(AMP~E0+(Emax-E0)*Time**gamma/(EC50**gamma+Time**gamma),data=your data,

Re: [R] Hello

2009-08-20 Thread Paul Hiemstra
dimple thyagarajan wrote: Hello! I am trying to merge two xy-plot with different ylimits. It seems that you are using lattice graphics (which you do not mention), if so, look at the documentation of xyplot, specifically to the panel argument. cheers, Paul Can someone please give me

Re: [R] postscript, options

2009-08-20 Thread e-letter
On 18/08/2009, Stefan Grosse singularit...@gmx.net wrote: On Tue, 18 Aug 2009 16:08:36 +0100 e-letter inp...@gmail.com wrote: EL postscript(/pathto/filename.eps,horizontal=FALSE,onefile=FALSE,paper=special) EL EL This command created a small blank eps file. Its hard to say why without

Re: [R] ggsave to .png bug in ggplot2 (?)

2009-08-20 Thread ONKELINX, Thierry
Dear Chris, That problem is due to the fact that ggsave() and png() use different default for the resolution. ggsave() uses 300 dpi and png() 72 dpi. If you set the resolution in ggsave() to 72 then you get exactly the same output as on the screen. But the resolution is way to low for

Re: [R] PowerCut Killed R - is my code retrievable?

2009-08-20 Thread Patrick Connolly
On Thu, 20-Aug-2009 at 12:21AM +0100, Ted Harding wrote: [] | Again, what I routinely do (in Linux) when developing R code is to | have two terminal windows open. In one I am running R. In the | other, beside it, I am editing a file of R code. To run code in R | that has been entered in the

Re: [R] Problem with predict.coxph

2009-08-20 Thread Ramon Diaz-Uriarte
Dear Terry, The following is an additional set of two simple examples. In these, no issue with factor levels, etc, arises. It looks like the problem consistently shows up when the number of rows of newdata differs from the number of rows in the original data set AND time and status are not part

[R] [Fwd: Re: Several simple but hard tasks to do with R]

2009-08-20 Thread Ottorino-Luca Pantani
Rakknar ha scritto: Hello everybody. I've been learning R for about a month to do a econometric study and now i'm stuck with some problems to make R do the things I want. Here I give the list of things I wanna do from the most simple to the more complex (for me of course): 1. Make a log.

[R] Heckman probit ?

2009-08-20 Thread justin bem
Is there a function to fit heckman probit model in R ? Sincerly.. Justin BEM BP 1917 Yaoundé Tél (237) 76043774 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] nested, repeated measure lme

2009-08-20 Thread Christoph Scherber
Dear all, Suppose I have a nested, repeated measure lme model. Which of the following formulae is correct? (assuming data are sampled from several plots in an agricultural experiment) (1) y~explanatory.variables,random=~time|block/plot/subplot/individual (2)

Re: [R] nested, repeated measure lme

2009-08-20 Thread ONKELINX, Thierry
Dear Christoph, Why should (1) not work? As long as you have enough levels, it should not be a problem. You need at least 6 levels for each random effect. When you have less than six levels, then you better move those variables to the fixed effects. An example: 2 blocks with each 2 plots. Each

[R] globally set digits=3 in Sweave

2009-08-20 Thread Liviu Andronic
Dear all I would like to globally set options(digits = 4) in an Sweave document. I've read this thread [1] where it was suggested to set the above option and pass every printed number through format(). Aanother way to do so would be to round(expr, 4). However I would like to set the digits option

Re: [R] getting R 2.9.1 from the tar.gz file

2009-08-20 Thread Uwe Ligges
Lazarus Mramba wrote: Dear Sir, I am almost giving up on getting the R-2.9.1 on the ubuntu 9.04 using the instructions found on the R site. I decided to use the R-2.9.1.tar.gz and untarred it. I then typed ./configure and the results are shown below. However, on typing make, I got an

[R] Sobol Sensitivity Analysis: Loop Problem

2009-08-20 Thread Haeru Naemolaes
Dear list, I would like to calculate Sobol indices (first-order and total indices) with the sobol2002 function in the 'sensitivity' package for a hydrologic model. The input of my model consists of a parameter vector, the output of a single value (agreement between observed and simulated

Re: [R] lattice xyplot strip colors and location

2009-08-20 Thread Duncan Mackay
Hi Shankar On a slightly different note - below produces a strip to the left without the stacked strips require(latticeExtra) # NB install if not found useOuterStrips(strip=strip.custom(bg=skyblue), strip.left=strip.custom(bg=yellow), xyplot(V4~V3|frac.f*stdev.f,

Re: [R] getting R 2.9.1 from the tar.gz file

2009-08-20 Thread Lazarus Mramba
Dear Sir, I am almost giving up on getting the R-2.9.1 on the ubuntu 9.04 using the instructions found on the R site. I decided to use the R-2.9.1.tar.gz and untarred it. I then typed ./configure and the results are shown below. However, on typing make, I got an error, No targets specified and

Re: [R] ggsave to .png bug in ggplot2 (?)

2009-08-20 Thread Dieter Menne
ONKELINX, Thierry wrote: My workaround is to always save my plots to pdf. .. In that case I convert the pdf to png outside R. The best tools I found for that are Ghostfriend (http://www.noliturbare.com/index.php) and www.zamzar.com. Which is also my approach, but not using ggsave or

Re: [R] mild and extreme outliers in boxplot

2009-08-20 Thread Rnewbie
Hi Ottorino, Nevermind. I'm not in a position to require answers. As I said, I appreciate any help and that people would spend time reading my post. I didn't intend to elicit debates over my post, but again I thank all for offering help. I need some time to digest the information before making

Re: [R] Embedding lists in matrices and matrices in lists

2009-08-20 Thread Michael Kogan
Thanks, I was already told this solution by somebody (he just forgot to add the mailing list as CC). Well, the purpose of the whole thing is to get something like this: http://home.att.net/~numericana/data/polycount.htm where the numbers in the table cells give the number of matrices saved in

Re: [R] mild and extreme outliers in boxplot

2009-08-20 Thread Gabor Grothendieck
On Thu, Aug 20, 2009 at 3:23 AM, Gavin Simpsongavin.simp...@ucl.ac.uk wrote: Hi Rolf, On Thu, 2009-08-20 at 12:31 +1200, Rolf Turner wrote: I despair.  Why do you keep insisting that black is white? The OP wanted to be able to specify an argument to boxplot() that would cause it to plot

[R] Insert rows in between dataframes

2009-08-20 Thread Moumita Das
Hi all, Can anyone suggest me how to insert rows in between data frames and also keep the ordering of row numbers correct? Estimate Std. Errort value Pr(|t|) recmeanC2 9.275880e-176.322780e-17 1.467057e+00

Re: [R] function of probability for normal distribution

2009-08-20 Thread Rene
Dear all, Because my last email was in html format, so it was a disaster to read. I have second thought of my question asked in my last email, and came up some solution to myself, but I found the result was a bit weird, can someone please help look at my coding and advise where I have done wrong?

[R] Fw: Hist kernel density estimates

2009-08-20 Thread maram salem
Dear All, Here are the codes of a histogram a kernel density estimates that I used. For the hist estimate par(mex=1.3) dens-density(q) options(scipen=4) ylim-range(dens$y) h-hist(q,breaks=scott,freq=FALSE,probability=TRUE, +  right=FALSE,xlim=c(9000,16000),ylim=ylim,main=Histogram of q(scott))

Re: [R] expanding 1:12 months to Jan:Dec

2009-08-20 Thread jim holtman
month.abb [1] Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec # or random month.abb[sample(1:12)] [1] Jan Apr Sep Mar Nov May Aug Oct Dec Jul Jun Feb On Thu, Aug 20, 2009 at 3:14 AM, Liviu Androniclandronim...@gmail.com wrote: Dear R users I would like to do some spreadsheet style

Re: [R] eval and evironments: call local function in a global function

2009-08-20 Thread Gabor Grothendieck
I am not sure what the purpose of workspace is so I have eliminated it in the following. We just use the environment within main and when main exits all its variables go too so that seems sufficient. fun.global - function() { message('fun.global'); setVar(5) } main - function() { l.var

Re: [R] expanding 1:12 months to Jan:Dec

2009-08-20 Thread Gabor Grothendieck
month.abb month.name On Thu, Aug 20, 2009 at 3:14 AM, Liviu Androniclandronim...@gmail.com wrote: Dear R users I would like to do some spreadsheet style expansion of dates. For example, I would need to obtain a vector of months. I approached in an obviously wrong way: paste(01:12)  [1] 1  2

[R] Creating a list of combinations

2009-08-20 Thread Steve Murray
Dear R Users, I have 120 objects stored in R's memory and I want to pass the names of these many objects to be held as just one single object. The naming convention is month, year in sequence for all months between January 1986 to December 1995 (e.g. Jan86, Feb86, Mar86... through to Dec95).

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Jim Lemon
Rakknar wrote: Hello everybody. I've been learning R for about a month to do a econometric study and now i'm stuck with some problems to make R do the things I want. Here I give the list of things I wanna do from the most simple to the more complex (for me of course): 1. Make a log. I've

Re: [R] Creating a list of combinations

2009-08-20 Thread baptiste auguie
the short answer is to add [[i]] in your loop, file_list[[i]] - paste(index$month[i], index$year[i], sep='') yet a shorter answer would be, file_list = apply(index, 1, paste, collapse=) HTH, baptiste 2009/8/20 Steve Murray smurray...@hotmail.com: Dear R Users, I have 120 objects stored

Re: [R] change default measurement unit to millimetre

2009-08-20 Thread Jim Lemon
e-letter wrote: Readers, How do I configure R so that all units of measurement are in millimetres? For example if I want to set the width of a graph, I want to write: width=100 and R interprets this value as millimetres. Hi e-letter, If you just want a quick hack: mm2in-function(mm)

Re: [R] PowerCut Killed R - is my code retrievable?

2009-08-20 Thread Hans-Peter Suter
Also - is there a better way for the future?  I know some people use IDE's but is that for serious programming or for building a small function and tweaking it? What about a version control system to (locally) save the different stages of your script files? (I use git but Subversion (SVN) may

Re: [R] ANCOVA with defined error terms

2009-08-20 Thread hpdutra
Thanks Richard, I tried running the analysis the way you suggested but here is the error that I get track.aov - aov(mice ~ coon+block*veget*fruit*time - block:veget:fruit:time + + Error(block/plot), data = track) Warning message: In aov(kotz.mice ~ kotz.coon + block * veget *

Re: [R] print selected variables

2009-08-20 Thread milton ruser
Hi there, what you means by complete data. Read the posting guide, where it is suggested a minimum reproducible code, as well as good clarification about what you have/get and what you realy want to get. bests milton On Thu, Aug 20, 2009 at 3:38 AM, rajclinasia r...@clinasia.com wrote: Hi

Re: [R] eval and evironments: call local function in a global function

2009-08-20 Thread Renaud Gaujoux
Hi Gabor, thanks. Indeed I reckon implementing it using an object would be better, but I wanted to keep it as simple as possible for the end user, by hiding the object mechanism. The user would not have to define its function with an extra parameter, maybe obscure to him. My problem now is

Re: [R] how to categorize continuous variable when useing regression

2009-08-20 Thread Frank E Harrell Jr
Manli Yan wrote: assume dependent variable y( continuous),independent variable x ( continuous),I try to categorize x with some interval,such that,those intervals would has most significant different effect on y. any one knows which method I should apply,I really need some hints,thanks so

[R] what is the meaning of this error

2009-08-20 Thread Inchallah Yarab
Error in Math.factor(c(2L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L,  :   log not meaningful for factors In addition:Warning messages: 1: In Ops.factor(LRUpBound, LRLowBound) : * not meaningful for factors 2: In Ops.factor(TransitCoefStdDev, TransitCoefMean) :   / not meaningful for factors

Re: [R] how to specify two variance effects in gls

2009-08-20 Thread stephenb
I got the answer: weights=varComb(varFixed(~1/n),varPower(~Age)) Bond, Stephen-2 wrote: Hello everybody, I have a dataset where each row has number of subjects and that gives me natural weights for the variance function. Additionally I see that variance increases with Age, which is a

[R] Error message when performing cointegration and causality tests

2009-08-20 Thread Axel Leroix
    Hello,   I write this message because I have a problem with cointegration and causality tests on R.   I'm working with time series data. I use ucra and vars packages.To perform cointegration and Granger causality tests, I respectively write :   sjv - vardata[, c(upd, nc, r, up,

Re: [R] eval and evironments: call local function in a global function

2009-08-20 Thread Gabor Grothendieck
A function finds its free variables in its environment. Changing the environment of one function does not change the environment of other functions; however, if instead of messing with environments you use the proto solution already posted then that would handle this situation by passing the

Re: [R] what is the meaning of this error

2009-08-20 Thread Gavin Simpson
On Thu, 2009-08-20 at 12:54 +, Inchallah Yarab wrote: Error in Math.factor(c(2L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, : log not meaningful for factors In addition:Warning messages: 1: In Ops.factor(LRUpBound, LRLowBound) : * not meaningful for factors 2: In

[R] definition of AIC and BIC in gls

2009-08-20 Thread Bond, Stephen
Hello everybody, Please help with connecting the AIC and BIC numbers printed by summary.gls to the logLik number. 1. is the logLik number the true ML or density scaling constants have been omitted? 2. what is the formula for calculating the AIC and BIC from logLik (and how can I see it)?

Re: [R] what is the meaning of this error

2009-08-20 Thread Stefan Grosse
On Thu, 20 Aug 2009 12:54:33 + (GMT) Inchallah Yarab inchallahya...@yahoo.fr wrote: IY Error in Math.factor(c(2L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, IY 1L,  : log not meaningful for factors IY In addition:Warning messages: IY IY 1: In Ops.factor(LRUpBound, LRLowBound) : * not meaningful

[R] boxplot with log=y and values starting at 0

2009-08-20 Thread Anne Skoeries
Hi, I'm working with a data.frame containing values between 0 and 22000. Most of the values are actually between 0 and 50 and the high ones are outliers. I want to generate a boxplot and since the outliers are extremely high, I need to scale the y scale logarithmically. Otherwise one

Re: [R] eval and evironments: call local function in a global function

2009-08-20 Thread Renaud Gaujoux
Indeed. So is there no way to do that without passing an object as parameter, which acts as a 'global local' workspace? Isn't there a way to do say: run this function and subsequent calls within this environment? Gabor Grothendieck wrote: A function finds its free variables in its

Re: [R] boxplot with log=y and values starting at 0

2009-08-20 Thread John Kane
What about starting the data by adding some small amount to the 0's? Perhaps something like mysample - data.frame(aa = sample(c(A,B,C), 20, replace=TRUE), bb = sample(0:9, 20, replace=TRUE)) ifelse(mysample$bb==0,.1, mysample$bb) though you may wish to make .1

Re: [R] boxplot with log=y and values starting at 0

2009-08-20 Thread Allan Engelhardt
On 20/08/09 14:15, Anne Skoeries wrote: Hi, I'm working with a data.frame containing values between 0 and 22000. Most of the values are actually between 0 and 50 and the high ones are outliers. I want to generate a boxplot and since the outliers are extremely high, I need to scale the y scale

Re: [R] print selected variables

2009-08-20 Thread Don MacQueen
If your data is in a data frame named mydata and you want to print the 3rd, 5th and 10th variables: mydata[ , c(3,5,10) ] -Don At 12:38 AM -0700 8/20/09, rajclinasia wrote: Hi every one, I read one excel external file into R, in that R dataset i have 20 variables. now my querry is i want

Re: [R] Package read large file

2009-08-20 Thread Allan Engelhardt
It is a big file which is going to take some time to read. How long probably depends as much on your disks as on R. On my system: system.time( y - scan(file = /tmp/dat.txt, what = integer(0)) ) Read 12 items user system elapsed 197.085 15.164 216.149 This is with a test file

[R] Histogram problem

2009-08-20 Thread Conrad Addo
I'm trying to create a histogram from the following code, but my data keeps adding the Num vector and plotting that. My data in the CSV file is just one vector. Does anyone know why? Thanks Conrad SPXdf = data.frame(read.csv(file = SPX.csv, header = TRUE, sep = ,, dec = ., fill = TRUE)) Max

[R] How to extract row values?

2009-08-20 Thread Henrik Kallberg
Dear All! I'm trying to extract one specific row from a data frame without columnnames being included. I only want a 1-dimensional vector that consists of the specific data on this row. Here's an example: existing data: column names: v1v2v3 Row 1 ab cd ef Row 2 gh ij kl

[R] Problems with loading 'wordnet' in a standalone pc

2009-08-20 Thread Kelvin Lam
Hi group, I have the following error code after submitting library(wordnet) in a standalone pc. rJava is already in place. Error in .jpackage(pkgname,lib.loc=libname) unused argument(s) (lib.loc=libname) Error: .onLoad failed in 'loadNamespace' for 'wordnet' Error: package/namespace load

Re: [R] a bug in the offset parameter syntax in the geepack package?

2009-08-20 Thread ahnven
I found that the syntax ahnven wrote: model=geeglm(y~covariates,offset(log(xxx)),data=data,family=poisson,id=idx) indeed fits offset(log(xxx)) as weights. -- View this message in context:

[R] re ading in array

2009-08-20 Thread kobiwan
I saved an array of dim=c(28,28,28,28) using write.table. When I try to read it in with read.table I get a data frame of dim=c(28,28^3). Of course it is very important to preserve the structure of the saved array when I read it in. Does anyone know how to read it in so that it is an array of the

Re: [R] Contrasts within ANOVA frame (Repost)

2009-08-20 Thread JLucke
Dr Shen Even though you pose 3 contrasts, there are only 2 degrees of freedom as the 3rd contrast is the sum of the first two. Your aov output states this as StdLot has only 2 df. Having used up your df, the aov has nothing to report. Joe Joseph F. Lucke Senior Statistician Research

Re: [R] How to extract row values?

2009-08-20 Thread Daniel Malter
Assuming your data.frame has the name data, you would extract arbitrary row n by data[n, ] Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im

Re: [R] How to extract row values?

2009-08-20 Thread John Kane
What you have is a one-dimensional vector. I think that you are up against an R default. You are going to get some names no matter what you do. You can always change them using the names() command, e.g. names(xx) - c(a,b, c) to replace the v1 v2 v3 --- On Thu, 8/20/09, Henrik Kallberg

Re: [R] Embedding lists in matrices and matrices in lists

2009-08-20 Thread Petr PIKAL
Hm I still suppose that you do not need matrix as a top level object. If you are sure there is only one level of nesting, e.g. in each node of the list there is only one level of saved matrices, you can get summary information from str, length and/or summary. lll-list(a=1, b=2,

[R] should months be an ordered factor?

2009-08-20 Thread Bond, Stephen
This is not a purely stats question as it depends on the implementation of mixed models in R. The help says that ordered factors are treated differently than unordered, which is not very informative. More explicitly: does ordering simply imply that February follows January or that February has

Re: [R] joining two points in rgl

2009-08-20 Thread Nair, Murlidharan T
It gave me a the following error Error in cylinder3d(pts, radius = 0.1, e2 = rbind(c(1, 0, 0), c(1, 0, : subscript out of bounds The code I used is below for completeness. library(rgl) pts-structure(list(x = c(-0.975688, -0.975688), y = c(9.258795, -9.258795), z = c(-1.8, 1.8)), .Names =

Re: [R] Insert rows in between dataframes

2009-08-20 Thread John Kane
There may be a much cleaner and better way but just split the data.frame into two parts, create the NA rows as another data.frame and use rbind to put them back together again. Example #=== (mydata - data.frame(aa=letters[1:5],

[R] Odp: Histogram problem

2009-08-20 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.08.2009 15:33:38: I'm trying to create a histogram from the following code, but my data keeps adding the Num vector and plotting that. My data in the CSV file is just one vector. Does anyone know why? Well, I think that only you know why CSV

Re: [R] getting R 2.9.1 from the tar.gz file

2009-08-20 Thread Dirk Eddelbuettel
On Thu, Aug 20, 2009 at 10:57:52AM +0300, Lazarus Mramba wrote: Dear Sir, I am almost giving up on getting the R-2.9.1 on the ubuntu 9.04 using the instructions found on the R site. I decided to use the R-2.9.1.tar.gz and untarred it. I then typed ./configure and the results are shown

Re: [R] Insert rows in between dataframes

2009-08-20 Thread Henrique Dallazuanna
Try this also: as.data.frame(t(sapply(append(split(mydata, row.names(mydata)), list(c('f', 6)), after = 2), as.matrix))) The after argument of append can be the line number where you want the new line. On Thu, Aug 20, 2009 at 8:18 AM, Moumita Das das.moumita.onl...@gmail.comwrote: Hi all,

[R] possible problem with plot.lm

2009-08-20 Thread Benilton Carvalho
Hi, Here's one toy example that shows what I believe to be a problem with plot.lm. This was brought up by another user (Marcos Tadeu Andrade Cordeiro). I took a look at the source and the problem appears to be related to the fact that you need to reorder the data by the group means and

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Ottorino-Luca Pantani
Rakknar ha scritto: 1. Make a log. I've been using Stata and there i have a great tool to register what the program do: the log file, wich it's a simple .txt file where Stata writes every output it makes (not graphics of course). When I wanted to make the same thing with R I started to use the

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Steve Jaffe
For history of both commands and output, consider running R inside emacs using the ESS package and simply saving the buffer to a file. If you save the session as an S transcript file (extension .St) it is also easy to reload and re-execute any part of it. Emacs or xemacs is available on most

[R] simple randomization question: How to perform sample in chunks

2009-08-20 Thread Tal Galili
Hello dear R-help group. My task looks simple, but I can't seem to find a smart (e.g: non loop) solution to it. Task: I wish to randomize a data.frame by one column, while keeping the inner-order in the second column as is. So for example, let's say I have the following data.frame: xx

Re: [R] globally set digits=3 in Sweave

2009-08-20 Thread Duncan Murdoch
On 8/20/2009 6:19 AM, Liviu Andronic wrote: Dear all I would like to globally set options(digits = 4) in an Sweave document. I've read this thread [1] where it was suggested to set the above option and pass every printed number through format(). Aanother way to do so would be to round(expr, 4).

Re: [R] eval and evironments: call local function in a global function

2009-08-20 Thread Duncan Murdoch
On 8/20/2009 4:27 AM, Renaud Gaujoux wrote: Hi, in my project I want the user to be able to write hook functions that are in turn called in my main code. I'd like the user's hooks to be able to call some function that set a variable outside their running environment. The trick is that this

[R] help with regular expressions in R

2009-08-20 Thread Mark Kimpel
I'm having trouble achieving the results I want using a regular expression. I want to eliminate all characters that fall within square brackets as well as the brackets themselves, returning an . I'm not sure if it's R's use of double slash escapes or something else that is tripping me up. If I

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Rakknar
Bert: Thanks for your help. I'll try to clarify some of your doubts 1. logs. help.search(history) and ?savehistory shows you that R does exactly what you want very easily (depending on the platform, which contrary to the posting guide's request, you did not tell us). I've already find out

[R] predict.HoltWinters source misunderstanding.

2009-08-20 Thread rkevinburton
If I look in the stats package for the 'R' source code for predict.HoltWinters I see the following lines: vars - function(h) { psi - function(j) object$alpha * (1 + j * object$beta) + (j%%f == 0) * object$gamma * (1 - object$alpha) var(residuals(object)) * if

Re: [R] ANCOVA with defined error terms

2009-08-20 Thread Richard M. Heiberger
Yes, I meant summary(). anova() isn't defined for aovlist objects and summary() is. Warning message: In aov(kotz.mice ~ kotz.coon + block * veget * fruit * time - block:veget:fruit:time + : Error() model is singular You will need to investigate the singular Error() model. You might

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Rakknar
To echo what others have said, it is often easier to write a script (in STATA terms, a do file) of commands and then source the script. When it runs to your satisfaction, usually not the first time for me, there are several ways to store the output. Both the R2HTML and prettyR packages

Re: [R] help with regular expressions in R

2009-08-20 Thread jim holtman
How about this: myCharVec - c([the rain in spain], (the rain in spain)) gsub('\\[.*\\]', '', myCharVec) [1] (the rain in spain) you had *. when you should have .* On Thu, Aug 20, 2009 at 11:30 AM, Mark Kimpelmwkim...@gmail.com wrote: I'm having trouble achieving the

Re: [R] [SPAM] - help with regular expressions in R - Bayesian Filter detected spam

2009-08-20 Thread davidr
Possibly just a typo: gsub('\\[.*\\]', '', myCharVec) ^^ [1] (the rain in spain) HTH, -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mark Kimpel Sent: Thursday, August 20, 2009 10:31 AM

Re: [R] help with regular expressions in R

2009-08-20 Thread Chuck Taylor
Mark, Try this: myCharVec [1] [the rain in spain] (the rain in spain) gsub(\\[.*\\], , myCharVec) [1] (the rain in spain) You need two backslashes to escape the square brackets. The regular expression \\[.\\] translates to a [ followed by 0 or more instances of any

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread jim holtman
Put the objects that you want to save in a 'list' and then 'save' the list. You can build up the contents of the list dynamically in your program and then save it at the appropriate point. On Thu, Aug 20, 2009 at 10:59 AM, Rakknaraliengene...@yahoo.com wrote: To echo what others have said, it

Re: [R] Is there a construct for conditional comment?

2009-08-20 Thread Steve Jaffe
Why not if ( 0 ) { commented with zero } else { commented with one } Greg Snow-2 wrote: I believe that #if lines for C++ programs is handled by the preprocessor, not the compiler. So if you want the same functionality for R programs, it would make sense to just preprocess the R file.

Re: [R] RMySQL - overwrite record, not table

2009-08-20 Thread whizvast
Hi, Adrian- If you use overwrite=T parameter, you will overwrite the entire table, not each record. this is the essence of my problem and i still haven't found out right solution. i am thinking of writing my own MySQLwriteTable function... Thank you for your answer anyway! Adrian Dusa

[R] [R-pkgs] New package for multivariate Kalman filtering, smoothing, simulation and forecasting

2009-08-20 Thread Jouni Lehtonen
Dear all, I am pleased to announce the CRAN release of a new package called 'KFAS' - Kalman filter and smoother. The package KFAS contains functions of multivariate Kalman filter, smoother, simulation smoother and forecasting. It uses univariate approach algorithm (aka sequential processing),

Re: [R] globally set digits=3 in Sweave

2009-08-20 Thread Liviu Andronic
On 8/20/09, Duncan Murdoch murd...@stats.uwo.ca wrote: Why not put echo=FALSE= options(digits=4) @ somewhere near the top of your document? I did so, but it has no practical effect on \Sexpr{} (which I'm interested in, and failed to mention in the original e-mail). With echo=FALSE=

  1   2   >