[R] skeleton for C code?

2007-06-27 Thread ivo welch
Dear R experts---I would like to write a replacement for the read.csv function that is less general, but also more efficient. could someone please provide me with a skeleton function that shows me how to read the arguments and return a data frame for a call to a C function that handles

[R] Memory Experimentation: Rule of Thumb = 10-15 Times the Memory

2007-06-26 Thread ivo welch
dear R experts: I am of course no R experts, but use it regularly. I thought I would share some experimentation with memory use. I run a linux machine with about 4GB of memory, and R 2.5.0. upon startup, gc() reports used (Mb) gc trigger (Mb) max used (Mb) Ncells 268755 14.4

[R] bug or feature?

2007-05-17 Thread ivo welch
R version 2.5.0, under gentoo linux. This may be just my ignorance about naming conventions inside loops and subsets, but the following appears like a bug to me. y = c( 1963, 1963, 1964, 1964, 1965, 1965 ); r1= rnorm(6); d= data.frame ( y=y, r1=r1 ); ## note: I am not attach()ing anything

Re: [R] bug or feature?

2007-05-17 Thread ivo welch
ahh...it is the silent substitution of the data frame in the subset statement. I should have known this. (PS: this may not be desirable behavior; maybe it would be useful to issue a warning if the same name is defined in an upper data frame. just an opinion...) mea misunderstanding. /iaw

Re: [R] bug or feature?

2007-05-17 Thread ivo welch
] On Behalf Of ivo welch Sent: Thursday, May 17, 2007 11:53 AM To: jim holtman Cc: r-help Subject: Re: [R] bug or feature? ahh...it is the silent substitution of the data frame in the subset statement. I should have known this. (PS: this may not be desirable behavior; maybe it would

Re: [R] nlme fixed effects specification

2007-05-04 Thread ivo welch
hi doug: yikes. could I have done better? Oh dear. I tried to make my example clearer half-way through, but made it worse. I meant set.seed(1); fe = as.factor( as.integer( runif(100)*10 ) ); y=rnorm(100); x=rnorm(100); print(summary(lm( y ~ x + fe))) deleted Coefficients:

[R] nlme fixed effects specification

2007-05-03 Thread ivo welch
dear R experts: sorry, I have to ask this again. I know that the answer is in section 7.2 of S Programming, but I don't have the book (and I plan to buy the next edition---which I hope will be titled S/R programming ;-) ). I believe the following yields a standard fixed-effects estimation:

[R] stringification magic in subset?

2007-05-02 Thread ivo welch
dear R wizards: I am trying to replace subset() with my own version that first checks that each name in the select statement has a corresponding name in the data set. preferably, it would have the same syntax and semantics as subset() otherwise. alas, subset works in interesting ways:

Re: [R] stringification magic in subset?

2007-05-02 Thread ivo welch
Beautiful. thank you. /ivo Try: methods(subset) which will point you to subset.data.frame. The latter code will answer your questions. HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] names( d$columnname )

2007-04-22 Thread ivo welch
dear R wizards --- would it make sense for names(d$columnname) to be columnname? I can preserve the columnname through x=subset(dataset, select=columnname), of course, but it would seem that x=d$columnname could also do this. No? Sincerely, /iaw __

Re: [R] names( d$columnname )

2007-04-22 Thread ivo welch
yes, this was what I was asking for. I had the notion that one could tag almost anything with a name, and did not appreciate the scope for confusion. thank you for the explanation. regards, /ivo On 4/22/07, Duncan Murdoch [EMAIL PROTECTED] wrote: On 4/22/2007 5:46 PM, ivo welch wrote: dear

Re: [R] cat() to STDERR

2007-04-21 Thread ivo welch
as to not break scripts that rely on nothing escaping. I find it very convenient in long scripts written in perl or C to have the ability to write blips to the terminal, too... sincerely, /ivo welch On 4/20/07, ivo welch [EMAIL PROTECTED] wrote: thank you, peter and brian. I had not found the stderr

Re: [R] cat() to STDERR

2007-04-21 Thread ivo welch
thank you, again. (PS: the script that I needed that does BATCH exec in my case was /usr/lib64/R/bin/BATCH; I eliminated the 21, and now I indeed am getting the stderr to my terminal. I also now know that Loading required package message also go to stderr.) best, /ivo

[R] cat() to STDERR

2007-04-20 Thread ivo welch
Dear R wizards---I read Brian Ripley's post from 2004 which said that it was not possible to print to STDERR. Alas, I have more modest needs. I was wondering if it was possible to just send a string to STDERR with cat() while in CMD BATCH mode. Is it not possible to open STDERR in R? (Or does

Re: [R] cat() to STDERR

2007-04-20 Thread ivo welch
thank you, peter and brian. I had not found the stderr() function. (I had looked at the R Input/Output guide.) This is great. regards, /ivo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] commandArgs usage and --args invokation

2007-04-01 Thread ivo welch
hanks, dirk. this looks a bit nicer than what I put together in the last hour, which is a simple perl script that gives me the syntax I most like: $ R batch.R arg1 arg2 personally, because this has no meaning in the current invoke syntax, I think that R should understand this as the obvious

[R] commandArgs usage and --args invokation

2007-03-31 Thread ivo welch
guess is no, but since I have a second processor lying around, I am trying to get it into the fray.] A working example would be appreciated. regards, /ivo welch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] personalize regression printing?

2007-03-22 Thread ivo welch
dear R experts: I am often struggling with a desire of wanting to change the basic output that R prints. For example, a year ago, I wanted to add the mean to the summary() statement, and eventually got help from friendly souls who showed me how to copy the summary() routine and then modify it.

[R] write.csv feature/bug with pipe

2007-03-11 Thread ivo welch
gentoo linux, version 2.4.1: d= as.data.frame(matrix(1:20, 4, 5)) d V1 V2 V3 V4 V5 1 1 5 9 13 17 2 2 6 10 14 18 3 3 7 11 15 19 4 4 8 12 16 20 write.csv(d, file=d1.csv); write.csv(d, file=pipe(cat d2.csv)) write.csv(d, file=pipe(gzip -c d3.csv.gz), col.names=T) Warning message:

[R] pdf device bounding box?

2007-03-08 Thread ivo welch
dear R wizards: I have a very simple suggestion/question. Would it be easy to change the pdf device so that it adds a BoundingBox around its output? (Under R 2.4.1, this seems not to be the case, because epstopdf under linux complains. Fortunately, it still works correctly.) This is not a big

[R] linear coefficient combination stderr?

2007-02-13 Thread ivo welch
dear r-experts---I have scrounged around in google (searching r-help) for the really obvious, but failed. could someone please point me to whatever function computes the standard error of a linear combination of the coefficients? m=lm( y ~ x1 + x2 + x3 ); t.stat= (coef(m)[2]+coef(m)[3])) /

[R] practical memory limits

2007-02-10 Thread ivo welch
Dear R experts: I want to learn what the practically useful memory limits are for good work with R. (My specific problem is that I want work with daily stock returns. In ASCII, the data set is about 72 million returns, that would have to go into a sparse matrix (not all stocks exist for the

[R] advice on semi-serious attempt to extend summary

2007-01-01 Thread ivo welch
Dear R wizards: I am trying (finally) to build a function that might be useful to others. In particular, I want to create a summary.lme (extended lm) method that [a] adds normalized coefficients and [b] white heteroskedasticity adjusted se's and T's. I believe I already know how to do the

[R] slightly extended lm class

2007-01-01 Thread ivo welch
Dear R readers: I have written a short lme.R function, which adds normalized coefficients and White heteroskedasticity-adjusted statistics to the standard output. Otherwise, it behaves like lm. This is of course trivial for experts, but for me and other amateur users perhaps helpful. y=

Re: [R] slightly extended lm class

2007-01-01 Thread ivo welch
, at 9:00 PM, ivo welch wrote: I have written a short lme.R function, which adds normalized coefficients and White heteroskedasticity-adjusted statistics to the standard output. Otherwise, it behaves like lm. Is it a good idea to call it lme, since there's a widely used lme() in the nlme

[R] min, median, mean on data frame (matrix)

2006-12-28 Thread ivo welch
dear r experts: I know its almost surely documented. if d is a data frame median(d) -- fails (message is need numeric data) min(d) -- succeeds, but gives a scalar. mean(d) -- gives a vector I am wondering whether this could be changed into something more consistent. most naturally, the

[R] slightly inconsistent behavior

2006-12-26 Thread ivo welch
dear R experts: This is just a minor, minor nuisance, but I thought I would point it out: dataset - read.table(file=pipe(cmdline), header =T, + na.strings=c(NaN, C,I,M, E), sep=,, as.is=T, nrows=); Error: cannot allocate vector of size 781249 Kb If I extend nrows by a

Re: [R] extend summary.lm for hccm?

2006-12-24 Thread ivo welch
thank you, everybody. It's hard to find much fault with R, but one feature that would be nice to have would be hooks to output functions that make it easy to augment to the output---e.g., to add a new statistic to summary (e.g., mean, sd, different stderrs). not a big flaw, because one can write

[R] simple NLS query

2006-12-23 Thread ivo welch
dear R experts: I am trying to orient myself using nls(). so, I am just trying to copy and adapt an example in the nls() function: d= data.frame( y= runif(10), x= runif(10) ) nls( y ~ 1/(1+x), data = d, start= list(x=0.5,y=0.5), trace=TRUE) Error in n%%respLength : non-numeric argument

Re: [R] simple NLS query

2006-12-23 Thread ivo welch
y ~ 1/(1+x) which does not seem to match the requirement of the help page. What are the unknowns for which you were hoping nls would solve?? On Sat, 23 Dec 2006, ivo welch wrote: dear R experts: I am trying to orient myself using nls(). so, I am just trying to copy and adapt

[R] extend summary.lm for hccm?

2006-12-23 Thread ivo welch
dear R experts: I wonder whether it is possible to extend the summary method for the lm function, so that it uses an option hccm (well, model hc0). In my line of work, it is pretty much required in reporting of almost all linear regressions these days, which means that it would be very nice not

Re: [R] --no-save and --save toggle from inside R? + BATCH stderr

2006-07-11 Thread ivo welch
thank you. exactly what I needed. can I add it as a suggestion for the next R version to add an option to quit that prints only one line to stderr (or stdout, but the real one, not the batch output one) that gives a 1-line job summary---no error (or nothing), 5 warnings, 5 warnings, fatal error:

Re: [R] --no-save and --save toggle from inside R? + BATCH stderr

2006-07-11 Thread ivo welch
the following diff to the shell script invoking R prints an error message if R terminates with an error code: 112c112,119 exec sh ${R_HOME}/bin/Rcmd [EMAIL PROTECTED] ;; --- sh ${R_HOME}/bin/Rcmd [EMAIL PROTECTED] rc=$? if [ $rc -ne 0 ]; then shift ;

[R] move axis label text

2006-07-10 Thread ivo welch
dear R wizards: sorry, I am stumped. what is the parameter to just move the location of the x-label and y-lable (not the labels on the ticks of the x-axis and y-axis)? probably obvious, but not to me right now... regards, /iaw __

[R] --no-save and --save toggle from inside R? + BATCH stderr

2006-07-10 Thread ivo welch
dear R wizards: is it possible to instruct R to save or no-save from inside R? or does this have to be given at invokation on the command-line?The same question applies to --no-restore-data, although this presumably would have to be decided in a .First() function or something like it. on a

Re: [R] curiosity question: new graphics vs. old graphics subsystem

2006-07-04 Thread ivo welch
hi paul: thank you. great explanation. * what you describe seems like a fairly modest advantage of the traditional system. I have never used the new system, but this part of the translation should be simple: if a plot() is called, set the current viewport. emulation done. (if the user has

[R] curiosity question: new graphics vs. old graphics subsystem

2006-07-01 Thread ivo welch
I just read paul murrell's new book, R graphics. now, I have always used the traditional graphics system. apparently, the new (trellis?) system is an entirely separate graphics system. after reading the book, I cannot figure out what the intrinsic capability advantage of the old graphics system

Re: [R] y-axis label location relative to tick label width?

2006-06-28 Thread ivo welch
Dear R-Wizards: does anyone know how to obtain the width of the widest y- or x-tick label that R has drawn, so that I can leave appropriate space between it and my overall axis text label appropriately? regards, /ivo welch __ R-help@stat.math.ethz.ch

[R] y-axis label location relative to tick label width?

2006-06-15 Thread ivo welch
Dear R experts: I have an odd question: would it be better to calculate the location of the axis label relative to the furthest protruding tick label? the background is that I have my y-tick labels oriented horizontally rather than vertically. if R chooses to set a tick mark at 2, the y label

[R] surprising dates

2006-06-03 Thread ivo welch
I wonder if this is an intentional feature or an oversight. in some column summaries or in ifelse operations, apparently I am losing the date property of my vector. a - c(198012, 198101, 198102) b - a*100+31 c - as.Date( as.character(b), %Y%m%d ) summary(c) Min. 1st Qu.

[R] text bubble (rectangle)?

2006-06-03 Thread ivo welch
Dear R wizards: sorry to bug everyone twice in one day. I would like to annotate my graph by putting text strings into rectangle boxes with a little cartoon-like bubble with a lid pointing to a specific location. I can draw some sort of bubble-with-lid using the R primitives. (has anyone done

[R] speed?

2006-06-02 Thread ivo welch
dear R wizards: while extolling the virtues of R, one of my young econometrics colleagues told me that he still wants to run ox because [a] his code is written in it (good reason); [b] because ox seems to be faster than R in most benchmarks (huh?). this got me to wonder. language speed can't

[R] pdf output incompatible with latest ghostscript

2006-05-26 Thread ivo welch
I just upgraded to the latest ghostscript, AFPL 8.54. When I run the R output through gs, I get AFPL Ghostscript 8.54: Set UseCUEColor for UseDeviceIndependentColor to work properly. followed by a segfault. the resulting ghostscript file is incomplete (no %%EOF). probably a ghostscript bug,

Re: [R] odd feature

2006-05-22 Thread ivo welch
Hi Thomas: One case where the vector-vector recycling rules are used is in vector-matrix operations: a-1:4 b-diag(4) a+b is this last expression intended to be intuitive and thus desirable? if anything else, I would end up writing something like this more as an error than by

[R] odd feature

2006-05-21 Thread ivo welch
Dear R wizards: I just got stung by the ifelse() feature. a - 10:15 b - 20:300 test - 1 ifelse(test,a,b) [1] 10 I had not realized that this was the default behavior---I had expected 10:15. mea culpa. however, I wonder whether it would make sense to replace ifelse with a different

Re: [R] argv[0] --- again

2006-04-04 Thread ivo welch
I am amazed at the stuff Gabor knows. After I jokingly suggested R manuals were his bedtime reading he pretty much agreed: he reads documentation and code. He is in any case an extraordinary resource, and his contributions to this list are second to none. He has my vote of appreciation.

Re: [R] argv[0] --- again

2006-04-03 Thread ivo welch
hi gabor: thank you very much. how do you know this stuff? I just looked at the contributors() list, and you are not on it. may I highly suggest that a wrapper for this become part of the R base? it should also have a link from the commandArgs() help page to whatever this function should be

Re: [R] argv[0] --- again

2006-04-03 Thread ivo welch
hi gabor: is there a version of this for linux, too? regards, /iaw __ 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

Re: [R] argv[0] --- again

2006-04-03 Thread ivo welch
may I ask one more item? is there an official or best way to request that R add a standardized option that tells the user the R script name? I understand that most of the R developers read this group (bless them!), and the R developers may disagree about the usefulness/effort ratio of such a

[R] finding method file?

2006-04-02 Thread ivo welch
in R-intro.html. so, how would I go about looking for where R defines functions? or has this becomes so deeply wired into fortran/C in later versions that it can no longer be changed? help/advice as always appreciated. sincerely, /ivo welch __ R-help

[R] argv[0] --- again

2006-04-02 Thread ivo welch
to put code-1.r into a character vector? help appreciated. regards, /ivo welch PS :I read the past R-help posts on the subject, but apparently the older suggested solutions no longer work. (commandArgs() is not the answer, either.) And I did also not see it under the FAQ in the R

[R] write.table() or write.csv() --- add a comment?

2006-04-02 Thread ivo welch
, the R read functions are already smart enough to ignore the comment lines. help appreciated. regards, /ivo welch __ 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

Re: [R] argv[0] --- again

2006-04-02 Thread ivo welch
thank you, duncan. yikes. how about people on sane (sorry, mean linux or unix) systems... ;-). regards, /iaw On 4/2/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 4/2/2006 9:34 PM, ivo welch wrote: dear R group: I have the probably fairly common problem that I would like to have one

Re: [R] fixed effects

2006-03-28 Thread ivo welch
thanks, but darn: I only own your modern applied statistics text. I will buy the S programming book. is there a new edition coming soon, or should I go with the existing text? regards, /iaw On 3/28/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: There is a very similar example worked

[R] fixed effects

2006-03-27 Thread ivo welch
example? help is, as always, highly appreciated. sincerely, /ivo welch __ 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

[R] data frame as X in linear model lm() ?

2006-03-25 Thread ivo welch
[please indulge my semi-colons.] how should this be done? help, as always, appreciated. sincerely, /ivo welch __ 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

[R] R CMD BATCH w/o inputs?

2006-03-13 Thread ivo welch
dear R wizards---I must be standing on the line (German translation---this must be obvious). This is probably embarrassingly obvious to anyone, except to me right now. maybe it is late. I would like to run my R code in batch, but not see the R compilations and my R source code---I just want to

Re: [R] R CMD BATCH w/o inputs?

2006-03-13 Thread ivo welch
hi marc: yes, this is it. I tried --slave alone, which had not been enough. thanks. regards, /iaw __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

Re: [R] srt --- slope text with function?

2006-02-06 Thread ivo welch
Thank you, as always. May I disagree with you and offer a suggestion? In the best of worlds, a function should have multiple attributes. In addition to the function name and its argument list, two mandatory attributes should be a filename and lineno. If the function is interactively created,

[R] R loop

2006-02-06 Thread ivo welch
I am not an R expert, but I think the R idea of this task is to work with a data frame (where you make a and b are columns), and then to iterate over the rows. data - read.table( textConnection( a b 1 name1 2 name2 3 name3), header=TRUE) ; # just learned this one for (i in 1:nrow(data)) print(

[R] appeal --- add sd to summary for univariates

2006-02-06 Thread ivo welch
just a short beg for the next R 2.3 version: I know it is easy to add the sd into summary() in the source bowels of R---but everytime R is updated, my change disappears. :-(. I do not believe that R has an easy extension mechanism for univariate summaries, short of a function rewrite here.

Re: [R] R loop

2006-02-06 Thread ivo welch
data[ data$a == name2 ] # does not work and gives a weird result, yuck data[data$a==name2,] sorry about this. I believe a few versions back, one could not subset data frames, so I did not even check what I wrote. Works now. Look at ?order. I know. This is why I suggested only that

Re: [R] srt --- slope text with function?

2006-02-05 Thread ivo welch
Dear R Wizards: To bore everyone to death, below is an improved and hopefully final version of my native.slope() function. (Thanks, Jim.) In case you are not asleep yet reading yet another post of mine, may I ask the experts some programming questions? [I just saw yesterday's threat---I

[R] drawing outside a plot region

2006-02-05 Thread ivo welch
Dear R wizards: First, thank you for all the responses to my earlier queries. Will keep me busy tomorrow morning. Can I add one graphics question to my ever changing set of bothering questions, please? plot( c(0,1), c(0,1) ); crop.to.plot.off(); # what I want; does not exist text( -0.3, 0.1,

[R] srt relative to figure

2006-02-04 Thread ivo welch
, perhaps more embellished, to save me the debugging effort?) Or, is there an alternative to srt, which slopes the text relative to the existing scale? help appreciated. sincerely, /ivo welch [[alternative HTML version deleted]] __ R-help

[R] srt --- slope text with function?

2006-02-04 Thread ivo welch
is the ability of text to 'snake' itself along the line itself. I doubt that this is easily possible, but I just wanted to ask. help appreciated. sincerely, /ivo welch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] srt --- slope text with function?

2006-02-04 Thread ivo welch
); } } On 2/4/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 2/4/2006 3:50 PM, ivo welch wrote: [resent, plus small addition; I do not understand why gmail sent a weird charset.] Dear R wizards: I would love to write a general function that matches the slope of a plotted line in an xy-plot

Re: [R] srt --- slope text with function?

2006-02-04 Thread ivo welch
],), d.m=,d.m, (, ylim[2],ylim[1],xlim[2],xlim[1], ), asp.ratio=, (par()$fin)[1], :, (par()$fin)[2], ==, net.slope, =, slope, deg\n); } return( slope = slope ); } On 2/4/06, ivo welch [EMAIL PROTECTED] wrote: Thank you, Duncan. This led me to the info I needed. Here

Re: [R] princomp() with missing values in panel data?

2006-01-18 Thread ivo welch
thank you. I am still not sure how to get the scores in princomp, though: ds= as.data.frame( cbind(rnorm(10),rnorm(10)) ) names(ds)=c(x1,x2) ds[5,]=c(NA,NA) pc= princomp( formula = ~ ds$x1 + ds$x2, na.action=na.omit) ds$pc1 = pc$scores[,1] #-- error, scores has 9 obs, ds has 10 obs is there an

[R] princomp() with missing values in panel data?

2006-01-16 Thread ivo welch
, /ivo welch [[alternative HTML version deleted]] __ 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

[R] absolute position in plot()

2005-11-11 Thread ivo welch
dear R wizards: could you please point me into the right direction? I would like to write a general function arrow(x1,y1,x2,y2), which naturally draws an arrow. the basics of writing this function are of course easy. the only complication is that I would like the arrow not to exactly hit

[R] Fonts, Plus

2005-11-10 Thread ivo welch
Dear R Wizards: sorry, I need more help. hopefully, it will help others in the future. I am using R 2.2.0 Patched (2005-11-07 r36217). [a] # copy from the postscriptFont documentation CMitalic - postscriptFont(ComputerModern, c(CM_regular_10.afm, CM_boldx_10.afm,

[R] short suggestion to the R development team

2005-11-09 Thread ivo welch
Dear R developpment team: would it be easy to introduce a global variable (in options()) that contains the name of the R file that is currently being processed? (ala \jobname in latex.) if this is difficult, would it be easy to introduce something like $0 in perl (i.e., argv[0] in C), which

[R] pdf device and TeXencoding?

2005-11-07 Thread ivo welch
. sincerely, /ivo welch __ 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

Re: [R] pdf device and TeXencoding?

2005-11-07 Thread ivo welch
wrote: On Mon, 7 Nov 2005, ivo welch wrote: [a] I believe that the pdf device does not yet fully support TeXencoding. (under R-2.2.0, the pdf file created with Textext as font encoding still dies when post-processed by ghostscript.) are there any workarounds, or are there utilities

[R] TeXtext font encoding?

2005-08-30 Thread ivo welch
not specify a font encoding. (I believe I need this encoding for the math symbols, like '=', to appear in the right places.) is this an R (enc file) bug or another mistake of mine? as always, help would be highly appreciated. sincerely, /iaw --- ivo welch

[R] Font Encodings --- some work, some don't

2005-08-30 Thread ivo welch
encoding error does not appear in the postscript device driver, and it works fine. It would be nice if R gave an error message, instead of producing corrupt .pdf files. Just a suggestion... Regards, /iaw --- ivo welch __ R-help@stat.math.ethz.ch

Re: [R] loadhistory() in .Rprofile ?

2004-08-22 Thread ivo welch
Prof Brian Ripley wrote: find(loadhistory) [1] package:utils so see the comments at the top of the NEWS for 1.9.0. You will need to use utils::loadhistory() in .Rprofile, or a loadhook. thank you all. sheesh, it broke in 1.9.0, not 1.9.1---I looked through the 1.9.1 release notes, and

Re: [R] circle / oval / semicircle ?

2004-06-25 Thread ivo welch
thanks, guys. circles might be a good candidate for a graphics primitive in the next R version, if only because---unlike the solutions here---I believe that postscript/pdf have scaleable primitives---though I am no postscript expert. of course, if I knew what I was talking about, I would

[R] Re: more obvious contribution mechanism

2004-06-09 Thread ivo welch
hi: thanks everyone for pointing me to the contribution page.. [a] it was not obvious to me how to find this page. if you like contributions, please make it a bit more obvious. I would think a button on the home page would be a good idea. [b] any kind of trinket sale (a CD?) for money would

[R] Re: fighting with ps.options and xlim/ylim

2004-06-09 Thread ivo welch
Thanks again for all the messages. Is the 4% in par('usr') hardcoded? if so, may I suggest making this a user-changeable parameter for x and y axis? I looked at psfrag, and it seems like a great package. alas, I have switched to pdflatex, and pdffrag does not exist. :-( I also discovered

[R] direct data frame entry

2004-06-09 Thread ivo welch
hi: I searched the last 2 hours for a way to enter a data frame directly in my program. (I know how to read from a file.) that is, I would like to say something like d - this.is.a.data.frame( c(obs1name, 0.2, 0.3), c(obs2name, 0.4, 1.0),

Re: [R] direct data frame entry

2004-06-09 Thread ivo welch
thank you, chaps. ok, so this is not as straightforward as I had thought. perhaps the read.table() function should have the ability to read inline (terminated, e.g., by two newlines, or a usersettable string), rather than just from a file. this would be a nice feature. regards, /iaw

[R] fighting with ps.options and xlim/ylim

2004-06-08 Thread ivo welch
sorry to impose again. At the default point size, R seems very good in selecting nice xlim/ylim parameters, and leaving a little bit of space at the edges of its xlim/ylim. alas, I now need to create ps graphics that can only occupy a quarter of a page, so I need to blow up the text for

Re: [R] fighting with ps.options and xlim/ylim

2004-06-08 Thread ivo welch
thank you, marc. I will play around with these parameters tomorrow at my real computer. yes, the idea is to just create an .eps and .pdf file, which is then \includegraphics[0.25\textwidth]{} in pdflatex. I need to tweak with the parameter ps.options(pointsize) because otherwise, I end up

[R] more obvious contribution mechanism?

2004-06-08 Thread ivo welch
can we put a how to donate money to R on the R webpage? perhaps with a paypal button? even better, because I would like to donate some funds from my research budget, could the R-project possibly sell some trinkets for a high price for support? it is difficult to explain to a non-profit org

[R] Re: How to Describe R to Finance People

2004-06-05 Thread ivo welch
. this is of course steeped in too much history, but a name change would help---calling it some random 6-letter combination. regards, /ivo welch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] type checking --- just a thought

2004-05-14 Thread ivo welch
hi: would it be useful to build into R an optional mechanism that typechecks arguments? for example, sum.across - function ( inpmatrix : matrixtype( dim[1]1, dim[2]3 ) ) : vector { } # this would define a sum.across function that can take matrices or data sets, but not vectors,

[R] lm without a formula?

2004-05-12 Thread ivo welch
hi: I have a y vector and an x data frame. is it possible to use the standard linear regression (lm, summary.lm) without having to construct a formula, i.e., all x variables should be used. x - data.frame( rnorm(10), rnorm(10) ); # -- well, this would really be read from a file y -

[R] fill between lines

2004-04-19 Thread ivo welch
hi: is it possible to color areas between two functions? for example, x- 1:100; plot(x, x^2, type=l); lines(x,0.5*x^2, type=l); # better plotwithfill(x, x^2, 0.5*x^2, color=c(yellow, red); where the first color is used if f(x)=x^2 g(x)=0.5*x^2, and the second for the reverse.

[R] thanks for fill

2004-04-19 Thread ivo welch
Hi: thanks for the polygon recommendations. these work like a charm for me. minor documentation bug: ?plot.default states lwd is not yet supported for postscript, but it does seem to work. regards, /iaw __ [EMAIL PROTECTED] mailing list

[R] assert( condition )

2004-04-06 Thread ivo welch
hi R wizards: I think it would be a good idea for me to use basic argument checking (type, length) in function calls via an assert() like function. How do people usually do this? Should I define my own assert() function (or are there some predefined assertions)? If I write my own assert,

[R] assert(condition)

2004-04-06 Thread ivo welch
thank you all for all the advice. regards, /iaw __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] normalized regression output

2004-04-05 Thread ivo welch
Hi: I would like to write a function that takes as its input a formula and outputs normalized coefficients ( coef(x)*sdv(x)/sdv(y) ). now, a formula is an object, and I cannot see how to extract the variables for obtaining sdv's. the intent is to write something like my.print.lm(

[R] residuals with missing values

2004-03-28 Thread ivo welch
hi: sorry to bother you all again. I am running a simple lm(y~x+z) regression, in which some of the observations are missing. Unfortunately, the residuals vector from the lm object omits all the missing values, which means that I cannot simply do residual diagnostics (e.g., plot(y,x)).

Re: [R] stop() vs. error() ?

2004-03-27 Thread ivo welch
hi andy: mea culpa. it is the exit function in most other languages. It would be exit(0) invocation in C (C++) and perl, for example. regards, /iaw Liaw, Andy wrote: So you still have not told us what exactly what you are looking for. What do you want some sort of stop() to do inside a

Re: [R] stop() vs. error() ?

2004-03-27 Thread ivo welch
hi brian: thanks. I will put in a suggestion that the docs refer to q() in see also for stop. regards, /ivo Prof Brian Ripley wrote: That's called q() in R. snip __ [EMAIL PROTECTED] mailing list

[R] stop() vs. error() ?

2004-03-26 Thread ivo welch
Why does stop(we are done) print Error in eval.with.vis(expr, envir, enclos) : ? It would seem to me that a plain stop() is not an error, and that it would make more sense to have an error() function that is different from a stop(). Is there a rationale here that I am missing? sincerely,

Re: [R] stop() vs. error() ?

2004-03-26 Thread ivo welch
hi andy: yes, I know what it does. My suggestion would be to have a different command, that is a pure stop without error condition (with its message). A stop and an error are really two different things. regards, /ivo Liaw, Andy wrote: Please do read the documentation of the functions you

[R] line number of errors?

2004-03-24 Thread ivo welch
Is it possible to instruct R to output a line number when an error or warning is encountered in a source() file? sincerely, /iaw __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

  1   2   >