Re: [R] Slight discrepancy between predict.lm() and all.effects()

2006-11-28 Thread Prof Brian Ripley
On Mon, 27 Nov 2006, Michael Kubovy wrote: In the course of exploring response prediction, I stumbled upon a small discrepancy between the CIs produced by predict.lm() and all.effects() require(mlmRev) require(effects) hsb.lm - lm(mAch ~ minrty * sector, Hsb82) hsb.new - data.frame(

Re: [R] [R-sig-Geo] plot() and Jpeg() increase font size and resolution

2006-11-28 Thread Edzer J. Pebesma
Herry, you need to set font size after opening a device; try after your example e.g. png(out.png) trellis.par.set(fontsize,fontsize) plt1 dev.off() Hth, -- Edzer [EMAIL PROTECTED] wrote: Hi Edzer, png also does not increase the file size. Following the commands. The data are located at

[R] lmer predict

2006-11-28 Thread Aimin Yan
I use lmer to fit a model m what is predict function for this one? I try predict(m,new_data) but it doesn't work? Aimin __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] problem with source(), parse() and french colnames

2006-11-28 Thread Pascal Boisson
Hello every one Working under Windows Xp in French, and R version 2.4.0 (and : localeToCharset() : ISO8859-1 ) I am trying to source a file with basic commands. source(R files/InputFile Analysis (Calculs et mises à l'échelle - gestion des pb d'unités).r) and it works fine as long as I do not

Re: [R] calling R from cmd line, loading in data sets on the call

2006-11-28 Thread Barry Rowlingson
Matt Anthony wrote: Rcmd myprogram.R is clearly documented as unable to take parameters passed to it ... It can take parameters from the environment though... H:\ set METHOD=loglik H:\ c:\Program Files\R\R-2.2.1\bin\R blah blah Sys.getenv(METHOD) METHOD loglik Barry

Re: [R] calling R from cmd line, loading in data sets on the call

2006-11-28 Thread Prof Brian Ripley
On Tue, 28 Nov 2006, Barry Rowlingson wrote: Matt Anthony wrote: Rcmd myprogram.R is clearly documented as unable to take parameters passed to it ... It can take parameters from the environment though... H:\ set METHOD=loglik H:\ c:\Program Files\R\R-2.2.1\bin\R blah blah

[R] Aligning aerial photographs and maps

2006-11-28 Thread F.Tusell
I have read in Paul Murrell's book R Graphics about how to use a bitmap as background for a plot (page 107). Also, I routinely use function read.shape() in package maptools to read maps in shapefile format. Now, I would like to overlay an aerial photograph in .jpg format and a map. I think I could

Re: [R] odfTable: how to escape

2006-11-28 Thread Francesco Cernuto
Max, thanks for your suggestions. I 'm now better oriented in reading again last October article on Rnews and the odfWeave package documentation. I realized that odfWeave writes xml output in UTF-8 encoding as content.xml first row shows: |?xml version=1.0 encoding=UTF-8 ? | As I want also use

[R] Sorting a data frame when you don't know the columns

2006-11-28 Thread michael watson \(IAH-C\)
Hi Sorry to ask such a well oiled question, but even with multiple google hits I don't think this has been answered very well. It's all well and good doing a sort of a data frame on multiple columns when you know in advance which columns you want to sort on, but what about when the names of

[R] No mails with executable attachements to BMBWK

2006-11-28 Thread do_not_reply
Aus sicherheitstechnischen Gründen ist der Versand von ausfuehrbaren Dateien an das BMBWK gesperrt. Sender: r-help@stat.math.ethz.ch Recipient(s): [EMAIL PROTECTED] Subject: Re: excel document__ R-help@stat.math.ethz.ch mailing list

Re: [R] Sorting a data frame when you don't know the columns

2006-11-28 Thread Gabor Grothendieck
DF - data.frame(a = c(3, 4, 2, 3, 2, 4, 2), b = 7:1)) DF[do.call(order, DF),] will sort on all the columns. On 11/28/06, michael watson (IAH-C) [EMAIL PROTECTED] wrote: Hi Sorry to ask such a well oiled question, but even with multiple google hits I don't think this has been answered very

Re: [R] Sorting a data frame when you don't know the columns

2006-11-28 Thread Dimitris Rizopoulos
try this: dat - data.frame(x = rnorm(100), y = sample(rep(1:2, each = 50)), z = sample(rep(1:4, 25))) # nams - c(y, z) dat[do.call(order, dat[nams]), ] I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic

Re: [R] Sorting a data frame when you don't know the columns

2006-11-28 Thread michael watson \(IAH-C\)
Thanks guys, sorted now :) From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Tue 28/11/2006 11:05 AM To: Gabor Grothendieck Cc: michael watson (IAH-C); r-help@stat.math.ethz.ch Subject: Re: [R] Sorting a data frame when you don't know the columns Gabor

Re: [R] Aligning aerial photographs and maps

2006-11-28 Thread Charles Plessy
Le Tue, Nov 28, 2006 at 11:39:16AM +0100, F.Tusell a écrit : I would like to overlay an aerial photograph in .jpg format and a map. I think I could do the alignment manually for each case, but wonder if there is a better, automated way. I notice that the .jpg file has a companion .jgw file

Re: [R] Sorting a data frame when you don't know the columns

2006-11-28 Thread Peter Dalgaard
Gabor Grothendieck wrote: DF - data.frame(a = c(3, 4, 2, 3, 2, 4, 2), b = 7:1)) DF[do.call(order, DF),] will sort on all the columns. ... and you can use DF[do.call(order, DF[names]),] if you have the column names in a character vector. On 11/28/06, michael watson (IAH-C) [EMAIL

Re: [R] problem with source(), parse() and french colnames

2006-11-28 Thread Prof Brian Ripley
I am unable to reproduce this. Note that source() makes use of options(encoding), and that should be options(encoding) $encoding [1] native.enc I do get a problem with e.g. source(foo.R, encoding=ASCII) If that is not the problem, please produce a small reproducible example that fails

[R] Predicted values in lmer modeling

2006-11-28 Thread Fucikova, Eva
Dear All, I am working with linear mixed-effects models using the lme4 package in R. I created a model with the lmer function including some main effects, a two-way interaction and a random effect. Now I am searching for a way to save the predicted values for this model. As far as I can see,

[R] ML fit of gamma distribution to grouped data

2006-11-28 Thread Thomas Petzoldt
Hello, we have a set of biological cell-size data, which are only available as frequencies of discrete size classes, because of the high effort of manual microscopic measurements. The lengths are approximately gamma distributed, however the shape of the distribution is relatively variable

[R] Consulting request R training and programming

2006-11-28 Thread Holger Nowak
Hello everybody, first I would like to apologize my consulting request on this help list but I couldn't find any ressources about consulties on the net. In our company we are searching on alternatives to SPSS and after a very short test, R could satisfy our needs completly. Unfortunately we

Re: [R] Aligning aerial photographs and maps

2006-11-28 Thread Roger Bivand
On Tue, 28 Nov 2006, F.Tusell wrote: I have read in Paul Murrell's book R Graphics about how to use a bitmap as background for a plot (page 107). Also, I routinely use function read.shape() in package maptools to read maps in shapefile format. Now, I would like to overlay an aerial photograph

[R] There exist a FCS package on R-languaje?

2006-11-28 Thread Horacio Castellini
Hi all, excuse me by this elementary question. I wish to know if a package in language R exists to analyze FCS (Fluorescence Correlation Spectroscopy) datas. And, if it possible, in addition can read the archives in raw format generated by the ConfoCor2 program. Thanks Horacio.

Re: [R] automatic cleaning of workspace

2006-11-28 Thread rolf
I believe the following function is something like what Mark was looking for. The previously posted answers to his inquiry were more of the form ``Do this instead of what you want to do.'' rather than ``Here's how to do what you want to do.'' clean - function() { # Function clean. lll -

Re: [R] ML fit of gamma distribution to grouped data

2006-11-28 Thread Prof Brian Ripley
library(stats4) ll - function(shape, rate) { z - pgamma(breaks, shape=shape, rate=rate) -sum(counts * log(diff(z))) } mle(ll, start=list(shape=1, rate=1/mean(breaks))) looks a plausible fit. On Tue, 28 Nov 2006, Thomas Petzoldt wrote: Hello, we have a set of biological cell-size

Re: [R] Predicted values in lmer modeling

2006-11-28 Thread Douglas Bates
On 11/28/06, Fucikova, Eva [EMAIL PROTECTED] wrote: Dear All, I am working with linear mixed-effects models using the lme4 package in R. I created a model with the lmer function including some main effects, a two-way interaction and a random effect. Now I am searching for a way to save the

[R] Allarme generato mediante Panda GateDefender Perfor ma.

2006-11-28 Thread ced
28/11/2006 15:13:30 [GMT+0100] Per ragioni di sicurezza, sono stati rifiutati alcuni elementi contenuti in un messaggio di posta elettronica che aveva come mittente il proprio indirizzo di posta. Incoerenze tra formato, estensione e tipo MIME rilevato. Nome file: file.scr Filtrato mediante:

[R] delete content of directory - unlink doesn't work as expected

2006-11-28 Thread Hans-Peter
Hi, I try to delete the files in a directory. While the command invisible(lapply( list.files( DeleteThis ), function(x) file.remove(paste(DeleteThis, x, sep=/ )) )) works, I keep thinking that there should be a more direct command. unlink looks like a good candidate but whith this I only

Re: [R] delete content of directory - unlink doesn't work as expected

2006-11-28 Thread Gabor Grothendieck
Maybe: file.remove(file.path(myDir, list.files(myDir))) or here - setwd(myDir) file.remove(list.files()) setwd(here) On 11/28/06, Hans-Peter [EMAIL PROTECTED] wrote: Hi, I try to delete the files in a directory. While the command invisible(lapply( list.files( DeleteThis ), function(x)

Re: [R] Allarme generato mediante Panda GateDefender Performa.

2006-11-28 Thread Tom Backer Johnsen
I have been looking at the documentation and the output from the functions princomp() and factanal(), and found them somewhat difficult to understand. This is probably due to differences in respect to what I am used to with respect to terminology (my field is psychology). Are there some

Re: [R] delete content of directory - unlink doesn't work as expected

2006-11-28 Thread Eric Thompson
This has worked for me: system(rm path/*) On 11/28/06, Hans-Peter [EMAIL PROTECTED] wrote: Hi, I try to delete the files in a directory. While the command invisible(lapply( list.files( DeleteThis ), function(x) file.remove(paste(DeleteThis, x, sep=/ )) )) works, I keep thinking that

Re: [R] delete content of directory - unlink doesn't work as expected

2006-11-28 Thread Hans-Peter
2006/11/28, Gabor Grothendieck [EMAIL PROTECTED]: file.remove(file.path(myDir, list.files(myDir))) Great, thanks a lot. -- Regards, Hans-Peter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] [R-pkgs] New versions for the distr-family of packages, of startupmsg, and a new package distrDoc

2006-11-28 Thread Peter Ruckdeschel
We would like to announce the availability on CRAN of new versions of our packages distr (1.8), distrEx (0.4-4), distrSim (1.8), distrTEst (1.8), startupmsg (0.4) as well as a new package distrDoc (1.8) [all of them require R = 2.2.0]

[R] princomp and factanal()

2006-11-28 Thread Tom Backer Johnsen
I have been looking at the documentation and the output from the functions princomp() and factanal(), and found them somewhat difficult to understand. This is probably due to differences in respect to what I am used to with respect to terminology (my field is psychology). Are there some

Re: [R] delete content of directory - unlink doesn't work as expected

2006-11-28 Thread Prof Brian Ripley
Similar examples to yours work for me. Please tell us your OS and version of R, and, as the footer asks PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. On Tue, 28 Nov 2006, Hans-Peter wrote: Hi,

[R] errbar won't provide log axes

2006-11-28 Thread Kenneth Benoit
Dear R users, I am constructing a horizontal error bar plot with Hmisc's errbar() command and I cannot get it to keep the par(ylog=TRUE) setting, nor to pass the argument as the documentation supposedly says should work. In other words errbar(df$x,df$y, df$yminus, df$yplus, log=y) or

Re: [R] delete content of directory - unlink doesn't work as expected

2006-11-28 Thread Hans-Peter
invisible(lapply( list.files( DeleteThis ), function(x) file.remove(paste(DeleteThis, x, sep=/ )) )) Oh, dear! file.path() exists for a reason, and file.remove is vectorized. Try file.remove(dir(DeleteThis, full.names=TRUE)) argh, very embarassing to have asked this... ;-(

Re: [R] There exist a FCS package on R-languaje?

2006-11-28 Thread Earl F. Glynn
I do not have R code for ConfoCor2 raw data, but I'm working on some R code to read ConfoCor3 raw data. That R example is not quite ready for public release. The ConfoCor3 raw data format, which is a binary file, is quite a bit simpler to process than ConfoCor2 raw data. IMHO, the ConfoCor2

Re: [R] princomp and factanal()

2006-11-28 Thread Ramon Diaz-Uriarte
On Tuesday 28 November 2006 16:03, Tom Backer Johnsen wrote: I have been looking at the documentation and the output from the functions princomp() and factanal(), and found them somewhat difficult to understand. This is probably due to differences in respect to what I am used to with respect

[R] Can anyone read a S-PLUS .dmp file for me?

2006-11-28 Thread John McHenry
Hi WizaRds, I tried reading the S-PLUS file ftp://ftp.research.att.com/dist/bayes-meta/hblm.dmp into R using data.restore(hblm.dmp) but I got an error: Error in attributes(value) - thelist[-match(c(.Data, .Dim, .Dimnames, : row names must be 'character' or

[R] factor analysis using Principal Component Method

2006-11-28 Thread Mario Alfonso Morales Rivera
Is there any R function to perform factor analysis using Principal Component Method? why factanal() method is always mle ? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] factor analysis using Principal Component Method

2006-11-28 Thread Patrick Burns
The 'factor.model.stat' function that is available in the public domain area of the Burns Statistics website may or may not satisfy your needs. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) Mario Alfonso

Re: [R] calling R from cmd line, loading in data sets on the call

2006-11-28 Thread John McNeil
I know an answer for Unix that can perhaps you can translate to DOS. If you pass a file of R statements to 'R' on the command line it will run them. In Unix, the '|' (pipe) symbol sends text to a program as though it came from a file, thus: echo x-2; 2*x | R --vanilla --slave yields

Re: [R] factor analysis using Principal Component Method

2006-11-28 Thread Peter Dalgaard
Mario Alfonso Morales Rivera wrote: Is there any R function to perform factor analysis using Principal Component Method? why factanal() method is always mle ? Because PCM is not factor analysis (the two methods fit different models) and R didn't want to take part in the mislabeling

[R] Problem with pairs() in nlme

2006-11-28 Thread Michael Kubovy
Dear r-helpers, After successfully running require(nlme) vfr.lmL - lmList( estimate ~ (slant + respType + visField + hand)^2 | subject, vfr ) pairs(vfr.lmL, id = 0.01, adj = -0.5) # Pinheiro Bates (p. 141) produces the following error: Error in sprintf(gettext(fmt, domain = domain),

Re: [R] Predicted values in lmer modeling

2006-11-28 Thread Aimin Yan
m3 is a logistic regression model without random effect fitted by glm m5 is a logistic regression model with random effect fitted by lmer why the range for the fitted value for m5 is not between 0 and 1. thanks, Aimin range(fitted(m3)) [1] 0.1630141 0.9903415 range(fitted(m5)) [1] -1.515915

Re: [R] RSQLite +textConnection()

2006-11-28 Thread Alexander Nervedi
Hi Seth, Thank you for taking the trouble to look. I have created some code that simulates the problem. SOme additional observations are: a) After giving the error Error in textConnection(readLines(f, n = 2)) : all connections are in use I cannot ask for sessionInfo(). I get the error message

Re: [R] odfTable: how to escape

2006-11-28 Thread Francesco Cernuto
Max, It doesn't seem much elegant, but it works fine. I will follow with great interest this package developent. Francesco Kuhn, Max ha scritto: Francesco, Does everything work for you now? Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

[R] Counting zeros in a matrix

2006-11-28 Thread Guenther, Cameron
Hi All, If you could help me with this problem I would greatly appreciate it. Suppose I have a matrix A: 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0 I would like, for each row, to sum the number of times a 0 appears in front of a 1. So what I would like is to have

Re: [R] Predicted values in lmer modeling

2006-11-28 Thread David Barron
The fitted values for m5 must be logits. On 28/11/06, Aimin Yan [EMAIL PROTECTED] wrote: m3 is a logistic regression model without random effect fitted by glm m5 is a logistic regression model with random effect fitted by lmer why the range for the fitted value for m5 is not between 0 and 1.

Re: [R] Counting zeros in a matrix

2006-11-28 Thread Leeds, Mark \(IED\)
temp-apply(A,1,sum(diff(x)) == -1 ) but check it because I haven't tested it and when things are not tested there can often be unforeseen problems. Also, may have to declare sum(diff(x)) == -1 as a separate function and then call it. I'm not sure aobut that. -Original Message-

Re: [R] Counting zeros in a matrix

2006-11-28 Thread Marc Schwartz
On Tue, 2006-11-28 at 16:20 -0500, Guenther, Cameron wrote: Hi All, If you could help me with this problem I would greatly appreciate it. Suppose I have a matrix A: 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0 I would like, for each row, to sum the number

Re: [R] Counting zeros in a matrix

2006-11-28 Thread Richard M. Heiberger
A - matrix(c( 1,1,1,1,0,1,1,1,1, 1,1,1,0,1,0,1,0,0, 1,0,1,0,0,1,0,0,0, 1,1,0,0,0,0,1,0,0), 4, 9, byrow=TRUE) apply(A, 1, function(x) sum(diff(x)==1)) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Counting zeros in a matrix

2006-11-28 Thread Benilton Carvalho
countZerosBeforeOnes - function(v) sum(v[1:max(which(v == 1))] == 0) apply(A, 1, countZerosBeforeOnes) cheers, b On Nov 28, 2006, at 4:20 PM, Guenther, Cameron wrote: Hi All, If you could help me with this problem I would greatly appreciate it. Suppose I have a matrix A: 1 1 1 1 0 1

Re: [R] RSQLite +textConnection()

2006-11-28 Thread Seth Falcon
Alexander Nervedi [EMAIL PROTECTED] writes: Hi Seth, Thank you for taking the trouble to look. I have created some code that simulates the problem. SOme additional observations are: a) After giving the error Error in textConnection(readLines(f, n = 2)) : all connections are in use I cannot

Re: [R] Counting zeros in a matrix

2006-11-28 Thread Ben Fairbank
rowSums((A[,1:8]==0)*A[,2:9]==1) and adjust the 8 and the 9 for the number of columns in your matrix Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Guenther, Cameron Sent: Tuesday, November 28, 2006 3:20 PM To: r-help@stat.math.ethz.ch Subject:

[R] GAMS and Knots

2006-11-28 Thread Kathryn Baldwin
Hi I was wondering if anyone knew how to work out the number of knots that should be applied to each variable when using gams in the mgcv library? Any help or references would be much appreciated. Thanks Kathryn Baldwin __ R-help@stat.math.ethz.ch

Re: [R] GAMS and Knots

2006-11-28 Thread Andrew Robinson
Hi Kathryn, I very warmly recommend Simon Wood's book on the subject. Here is a link to the book information on Amazon (about which no recommendation should be inferred!)

Re: [R] GAMS and Knots

2006-11-28 Thread Gavin Simpson
On Wed, 2006-11-29 at 11:40 +1300, Kathryn Baldwin wrote: Hi I was wondering if anyone knew how to work out the number of knots that should be applied to each variable when using gams in the mgcv library? Any help or references would be much appreciated. Thanks Kathryn Baldwin mgcv works

[R] questions

2006-11-28 Thread giuseppe scasserra
hi, my name is giuseppe and i am an engineer, i am using R for regressions analysis using mixed random effects model, funztion nlme. quastions are: 1) when i ask for the summary after a regression using nlme function the program gives me the values of the coefficients and also the standard

Re: [R] questions

2006-11-28 Thread Andrew Robinson
Hi Guiseppe, On Wed, Nov 29, 2006 at 01:26:37AM +, giuseppe scasserra wrote: hi, my name is giuseppe and i am an engineer, i am using R for regressions analysis using mixed random effects model, funztion nlme. quastions are: 1) when i ask for the summary after a regression using nlme

Re: [R] automatic cleaning of workspace

2006-11-28 Thread Liaw, Andy
You can avoid loading .Rdata at start-up without deleting the .Rdata file by adding the --no-restore option to the R command. I have that, and additionally, --no-save, in my shortcut for the Rgui.exe command. I use explicit save() and load() in my scripts to save objects that are expensive to

[R] Aggregating data

2006-11-28 Thread David Kaplan
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Extract some character from a character vector of length 1

2006-11-28 Thread ronggui
the content of th character vector (of length 1) is as follows: a - something2 pat1 name1 pat2 something2pat1 name2 pat2pat1 name3 pat2 I would like to extract the character bewteen pat1 and pat2. That's to say, I would like to get a vecter of c(name1, name2,name3). What I did is

[R] R2.4 xyplot + panel.number problem

2006-11-28 Thread Pedro Mardones
Hi all; I'm trying to display a 2 panel plot for the Puromycin data from R with 2 different non-linear models fitted to each group. The problem is that as far as I know panel.number doesn't work in the latest version of R. Can anyone give a hint how to solve this? Here is the code that I used

Re: [R] R2.4 xyplot + panel.number problem

2006-11-28 Thread Deepayan Sarkar
On 11/28/06, Pedro Mardones [EMAIL PROTECTED] wrote: Hi all; I'm trying to display a 2 panel plot for the Puromycin data from R with 2 different non-linear models fitted to each group. The problem is that as far as I know panel.number doesn't work in the latest version of R. Yes, sorry about

[R] comma delimiter comma in text

2006-11-28 Thread Alexander Nervedi
Hi I have data like 1, A, 24, The Red House 2, A, 25, King's Home, by the Sea ... I'd like to read this in as three variables. I first tried temp -read.csv(addresses, sep = , ) it worked but line 2 was broken after King's Home, and by the Sea as placed in another line. and so i eneded up

Re: [R] Extract some character from a character vector of length 1

2006-11-28 Thread Gabor Grothendieck
The following matches pat1 followed by an ungreedy match of what is in between followed by pat2. What is in between is defined to be backreference 1 which is returned. See: http://code.google.com/p/gsubfn/ for more on strapply and the gsubfn package. # test data a - something2 pat1

Re: [R] R2.4 xyplot + panel.number problem

2006-11-28 Thread Duncan Mackay
Hi Try ?panel.number As you have not specified R version I cannot be more specific but for 2.4 there have been changes to lattice including panel.number to panel.number() At 14:10 29/11/06, you wrote: Hi all; I'm trying to display a 2 panel plot for the Puromycin data from R with 2 different