[R] DBI + ROracle problem with parser ??

2006-12-20 Thread Christian Hoffmann
Hi, Database queries using the combination DBI + ROracle are handicapped by quirks in the pipeline between the textual representation of the query and the database engine Oracle. dbGetQuery(conn, query): work: dbGetQuery(conn, select * from dual) dbGetQuery(conn, select * from dual /* comment

[R] Question on sub(stitute) X_1 - X\_1

2006-12-01 Thread Christian Hoffmann
Hi, Searching the archives has brought no clue: For a tex chunk in an Sweave text Oracle query results: differences \Sexpr{varname},... I need to change the string varname from X_1 to X\_1, sub(_,??,X_+) - X\_1 so that subsequent Latex will generate X_1 (i.e. show the underscore) instead

[R] XEmacs: substitute \n by real linefeeds

2006-11-22 Thread Christian Hoffmann
Hi, This may be a useful tip for R users on emacs: Problem: substitute \n by a real linefeed, so that aa \n bb \n ccc becomes aa bb ccc ? Solution: M-% RT \n RT C-q 12 RT It works, because ASCII 12 = RT Enjoy! Christian -- Dr. Christian W. Hoffmann, Swiss Federal Research Institute

[R] change \baselinestretch in Soutput ?

2006-11-13 Thread Christian Hoffmann
Hi there, Is it possible to change \baselinestretch in Soutput ? What should \DefineVerbatimEnvironment{Soutput}{Verbatim}{fontsize=\footnotesize} look like, if it is possible to effect the change here? Google did not help here. best Christian -- Dr. Christian W. Hoffmann, Swiss Federal

[R] flatten a list to a true list

2006-05-23 Thread Christian Hoffmann
Hi, I want to flatten a list: flatten(list(a=1,b=2),list(c=3,d=4)) - L - list(a=1,b=2,c=3,d=4) which is L $a [1] 1 $b [1] 2 $c [1] 3 $d [1] 4 L[1] $a [1] 1 L[[1]] [1] 1 What I used so far is M - unlist(c(list(a=1,b=2),list(c=3,d=4))), but this gives M a b c d 1 2 3 4 M[1] a 1

[R] 2.3.0 problems

2006-05-09 Thread Christian Hoffmann
Hi, Since the installation of R-2.3.0 I have the following problems: 1. Startup .First() produces -- Started in /home/woodstock/hoffmann/Projects/RtoZ/Windwurf/R with '~/R/.Rprofile' edited on 2006-04-28, 11:08 During startup - Warning messages: 1: use of NULL environment

[R] seq(2,5,-2) not an error but NULL

2006-03-27 Thread Christian Hoffmann
Hi, This may belong more to r-develop, but general discussion may be useful (for the how many-th time ?) seq(2,5,-2) seq(5,2,2) both result in Error in seq.default(2, 5, -2) : wrong sign in 'by' argument But often, if not always, mathematicians and programmers want a behaviour e.g. in for

[R] linear lists, creation, insertion, deletion, traversal *someone?*

2006-03-01 Thread Christian Hoffmann
Hi, In a second try I will ask this list to give me some useful pointers. Linear lists, as described e.g. by N.Wirth in Algorithms and Data Structures, seem not to be implemented in S/R, although in lisp we have cons, car, cdr. Nevertheless I want to implement an algorithm using such linear

[R] regular expressions, sub

2006-01-27 Thread Christian Hoffmann
Hi, I am trying to use sub, regexpr on expressions like log(D) ~ log(N)+I(log(N)^2)+log(t) being a model specification. The aim is to produce: ln D ~ ln N + ln^2 N + ln t The variable names N, t may change, the number of terms too. I succeded only partially, help on regular

[R] construct a bundle, subdirs do not exist?

2006-01-25 Thread Christian Hoffmann
Hi, Sorry to bother, but I checked around and did not succed creating a bundle from six existing packages (which are checkable, installable, etc. individually). I carefully followed the procedure given in ch. 1.1.5 Package bundles. However, I am getting [EMAIL PROTECTED]:~/R/Sources R CMD

[R] Thunderbird misrepresents manuals

2006-01-11 Thread Christian Hoffmann
Hi there, I hope that I am in the right forum. I am using Exceed on a WinNT2000 machine, connected to Solaris SunOS fluke 5.9 Generic_118558-11 sun4u sparc SUNW,Sun-Fire-480R with Mozilla Firefox 1.0.7. Problem: Manuals like R-exts.html, R-lang.html, R-intro.html, R-admin.html, but *not* --

[R] masked at loading

2005-12-18 Thread Christian Hoffmann
Hi, I am getting masked objects and I think the maintainers of the respective packages (lattice, boot, survival, aml) should agree on how to eliminate th conflicts. Here my start up protocol with the relevant information: -- R : Copyright 2005, The R Foundation for Statistical

[R] update from tar.gz in local directory on Unix/Solaris

2005-12-15 Thread Christian Hoffmann
Hi list, I have not been successful in finding out from the available documentation how under Unix/Solaris to update a packages which I downloaded from the net as the original *.tar.gz and stored in a local file, say (1) home/woodstock/hoffmacw/R/Sources/pack.tar.gz A lot of installed

[R] setkeys and Sweave

2005-09-16 Thread Christian Hoffmann
Hi there: Using \setkeys{Gin}{width=1.0\textwidth} \setkeys{Gin}{height=10cm} \setkeys{Gin}{height=0.8\textwidth} all seem to work under R-2.1.1 under sparc, solaris2.9, but \setkeys{Gin}{scale=0.3} \setkeys{Gin}{angle=90} do not work. I have not been able to find relevant information,

[R] Plit result of pairs in an Sweave compatible manner

2005-08-10 Thread Christian Hoffmann
. These subplots should then go to Sweave which is accepting one figure at a time presently. Thanks for help Christian Hoffmann PS: In the old S (The New S language, Becker, Chambers, Wilks) there was a parameter max to split the output. -- Dr. Christian W. Hoffmann, Swiss Federal Research Institute

[R] install own packages

2005-04-12 Thread Christian Hoffmann
Hi, Soory, if I missed relevant help pages. I have developed several packages myself and want to give them to a collegue in *.tar.gz form (Unix, Solaris). What is the proper function to install them? install.packages() with a path pointing to the local temp instead of to CRAN? Thanks for help.

[R] eval in correct frame?

2004-11-25 Thread Christian Hoffmann
I am trying, without success, to find out how to formulate correctly the parameters of eval. My code snippet looks like: proutside - function(txt) { cat(\n,txt,\n); print(eval(parse(text = txt))) } vari - function(Ob) { prininside - function(txt) { cat(\n,txt,\n);

[R] Package Documentation, cryptic

2004-11-09 Thread Christian Hoffmann
Hi, sorry for this lengthy post. I am using R-2.0.0 on Unix, compiled. Overview: A) R CMD check: Unaccounted top-level text B) In which sections of *.Rd is LaTeX notation allowed, where *not*? C) Codoc mismatches and polyvalent parameters D) Successful R CMD INSTALL and R CMD build E) cp

[R] capitalize etc string

2004-09-22 Thread Christian Hoffmann
Dear Any, Is there a fonction in R to change a string to uppercase ? Thanks for all your help Use the following: capply - function(str, ff) { sapply(lapply(strsplit(str, NULL), ff), paste, collapse=) } cap - function(char) { # change lower letters to upper, others leave unchanged if (any(ind

[R] is.constant 2

2004-09-22 Thread Christian Hoffmann
x - c(1, 2, NA) is.constant(x) [1] TRUE For data such as c(1, 1, 1, NA), I should think the safest answer should be NA, because one really doesn't know whether that last number is 1 or not. Andy My version is is.constant - function(x) { if (is.numeric(x) !any(is.na(x)))

[R] path related problem XEmacs Unix

2004-07-01 Thread Christian Hoffmann
Hi there, May I ask the following question. Our Solaris installation of Xemacs and R: SunOS fluke 5.9 Generic_117171-02 sun4u sparc SUNW,Sun-Fire-480R one cannot start R inside xemacs: M-x R symbol's function definition is void. Also, loading a *.tex file into Xemacs will result in loading tex

[R] start-up problems

2004-06-16 Thread Christian Hoffmann
Hi, After some reading and experimentation I found that I cannot solve this problem: 1. I am starting R and check: system(pwd) /home/woodstock/hoffmacw/R/test system(echo $HOME) /home/woodstock/hoffmacw system(echo $R_PROFILE) /home/woodstock/hoffmacw/R system(ls $R_PROFILE/.Rprofile)

[R] First Variable in lm

2004-03-24 Thread Christian Hoffmann
instead of the whateverthefirstofthevariablenamesis, eval(), substitute(), get(), ... to correctly compute this regression? With lm(get(names(dat)[1] ~., data=dat) there are no errors, but the first variable also shows up among the regressors. Thanks for help. Christian Hoffmann

Re: [R] First Variable in lm

2004-03-24 Thread Christian Hoffmann
I want to take the first variable (column) of a data frame and regress it against all other variables. bla - function (dat) { reg - lm(whateverthefirstofthevariablenamesis ~., data=dat) return(reg) } Thanks to all who answered my question: Prof. Brian Ripley: ---

Re: [R] 0.1 + 0.2 != 0.3 revisited

2004-02-09 Thread Christian Hoffmann
accuracy on 0.2, and 54 place accuracy on 0.3. It's not surprising weird things happen! I don *not* think so: all mantissas here have *52 binary* places! Duncan Murdoch Christian Hoffmann -- Dr.sc.math.Christian W. Hoffmann, http://www.wsl.ch/staff/christian.hoffmann Mathematics + Statistical

Re: [R] symbolic and algebraic computation

2003-12-18 Thread Christian Hoffmann
There is also the open source program Pari: Quote: I would like to announce the release of pari-2.2.7.ALPHA. The sources can be obtained using the old address ftp://megrez.math.u-bordeaux.fr/pub/pari/pari-alpha.tgz or (preferably) through the new website:

Re: [R] (no subject)

2003-06-04 Thread Christian Hoffmann
Hi everybody, I finally hope to reach the person who started the thread [R] (no subject). The innermost level of text was my original request. Kind regards Christian At 10:50 2003-06-04 +0200, you wrote: Hoi Christian, --On woensdag 4 juni 2003 10:36 +0200 Christian Hoffmann [EMAIL PROTECTED