Re: [R] RODBC Excel sqlQuery insert into

2007-03-18 Thread Jens Scheidtmann
[EMAIL PROTECTED] writes:

 I have searched the archives for using insert into to update spreadsheets 
 using RODBC and have come up short. So, first off, is it possible?

 I have put together a dummy xls table (c:\foo.xls)for exploring 
 possibilities of RODBC.  Ultimately, I am interested in replacing much of 
 our previous use of vba macros with R ( I'd prefer elimination, but will 
 take what I can get ).  In order to achieve this, I will still have a need 
 to update spreadsheets directly through R scripts. 

 Simple queries seem to work fantastic!  But, I am missing something when 
 it comes to writing.

 sqlQuery( myChan,insert into [my customers$] ( CUST_ID, NAME, SOCIAL ) 
 VALUES( 5,'robin',5678 )  )
 [1] [RODBC] ERROR: Could not SQLExecDirect  S1000 -3035 
 [Microsoft][ODBC Excel Driver] Operation must use an updateable query.

[...]
   Driver={Microsoft Excel Driver (*.xls)}

[...]

 Additional reference: 
 http://www.microsoft.com/technet/scriptcenter/resources/officetips/jun05/tips0607.mspx

Your link describes the Microsoft Jet OLE DB Provider driver,
while your plain ODBC connections to Excel uses the Microsoft OLE DB
Provider for ODBC Drivers driver.

The documentation located here 
http://support.microsoft.com/?scid=kb%3Ben-us%3B257819x=9y=17
states:

 IMPORTANT: An ODBC connection to Excel is read-only by default. Your
 ADO Recordset LockType property setting does not override this
 connection-level setting. You must set ReadOnly to False in your
 connection string or your DSN configuration if you want to edit your
 data. Otherwise, you receive the following error message: Operation
 must use an updateable query.

Jens

__
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.


Re: [R] R and threading

2007-02-15 Thread Jens Scheidtmann
Simon Pears [EMAIL PROTECTED] writes:

 Hi,

 I am considering using R to integrate with a Java application. However, 
 before deciding upon R I need to understand if R is capable of dealing with 
 multiple requests simulataneously.

 Is a single instance of R capable of dealing with multiple simulataneous 
 requests or does a new instance of R have to be started for each request?

 I have read Luke Tierney's 2001 notes on threading at 
 http://www.stat.uiowa.edu/~luke/R/thrgui/thrgui.pdf.
 Have these concepts been introduced into the R engine?

Check out rserve at http://rosuda.org/Rserve/

HTH,

Jens 
---
Jens Scheidtmann

__
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.


Re: [R] Software for kriging

2007-02-15 Thread Jens Scheidtmann
[EMAIL PROTECTED] writes:

 Dear R-list members,

 I wish everyone a happy and successful 2007!

 Does anyone know of R-based software for
 optimal spatial prediction (kriging)?

 We are working on a seismic event characterisation
 technique and need to do some kriging.

 Any help would be greatly appreciated.

 Augusto

MASS also has a chapter on Kriging, see 
http://www.stats.ox.ac.uk/pub/MASS4/

Cressie also does R:
http://www.stat.ohio-state.edu/~sses/research_cmck.html

Jens
---
Jens Scheidtmann

__
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.


Re: [R] data storage/cubes and pointers in R

2006-11-16 Thread Jens Scheidtmann
Piet van Remortel [EMAIL PROTECTED] writes:

 Hi all,

[...]
 Intuitively, I would like to be able to slice the data in a 'data- 
 cube' kind of way to query, analyze, cluster, fit etc., which  
 resembles the database data-cube way of thinking common in de db  
 world these days. ( http://en.wikipedia.org/wiki/Data_cube )

 I have no knowledge of a package that supports such things in an  
 elegant way within R.  If this exists, please point me to it.
[...]

If non-R systtems are an option for you, please have a look at PALO
http://www.palo.net/ or Mondrian http://sourceforge.net/projects/mondrian

Maybe writing an interface to these systems may be easier than
implementing it...
 
HTH,

Jens

__
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.


Re: [R] chi.test in R

2006-11-14 Thread Jens Scheidtmann
downunder [EMAIL PROTECTED] writes:

 Hi all. 

 I need some help computing multidimensional pvalues of a multivariate data
 set.

 chisq.test(x[,1],x[,2])$p.value

 i need a command or loop that creates me a vector or a matrix (each variabe
 with each variable) would be even better for the p.values of the variables
 of a data set.

 something like 

 chisq.test(x[,1:5],x[,2])$p.value or i=c(1,2,3)
 chisq.test(x[,i],x[,j])$p.value doesn't work

look at mapply, or generally apply

HTH,

Jens

__
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.


Re: [R] query in R

2006-11-14 Thread Jens Scheidtmann
Xiaodong Jin [EMAIL PROTECTED] writes:

 how to realize the following SQL command in R?

   select distinct A, B, count(C)
   from TABLE
   group by A, B
   ;
   quit;

The functional equivalent of is statement in R on a dataframe is:

TABLE$ones - 1;
aggregate(TABLE$ones, list(TABLE$a, TABLE$b), sum);

HTH,

Jens

__
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.


Re: [R] R-help in Newsreader?

2006-11-06 Thread Jens Scheidtmann
Matthias Voigt [EMAIL PROTECTED] writes:

 Dear list,

 I am new to this all and therefore have following Newbie question:

 How can I receive and read R-help mailings in a newsreader like thunderbird?

Use gmane.comp.lang.r.general on gmane.org

HTH,

Jens

__
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.


Re: [R] Latex editor recommendations

2006-10-21 Thread Jens Scheidtmann
Richard M. Heiberger [EMAIL PROTECTED] writes:

 I recommend emacs
 http://ftp.gnu.org/pub/gnu/emacs

 It has modes for TeX and LaTeX and automatically chooses the
 right one.

 As a side benefit once you have emacs you can then
 run R through ESS, the package that provides the modes for handling
 statistical languages
 http://ess.r-project.org/

In addition you get support for Sweave (mixing R and LaTeX).

Recommended packages for Editing LaTeX / R are:

AucTeX + reftex 
ESS

Jens

__
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.


Re: [R] Using the ROracle package with Oracle 10 ?

2006-10-21 Thread Jens Scheidtmann
Ram Dessau [EMAIL PROTECTED] writes:

[...]
 Window binary for ROracle 10 ?

 Is there anyone who could help with a version of ROracle for windows
 which is compatible with Oracle 10 or more general just uses the
 default-home The available (not officially released) version only
 supports Oracle 9

Any used oracle 9 driver should be able to connect to a 10g instance
and work reasonably well with it.

Did you try connecting to a 10g instance?

Do you have a specific problem or thing not working?

Do you have errors ora-600 or ora-03113?

Jens

__
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.


Re: [R] ROracle error in Windows. Memory could not be read.

2006-10-21 Thread Jens Scheidtmann
Adrian Dragulescu [EMAIL PROTECTED] writes:

 I've seen from earlier posts that other people had problems installing
 ROracle under Windows.  I run R-2.3.1.

 I got the Windows binaries for ROracle from
 http://stat.bell-labs.com/RS-DBI/download/index.html

 Here is my session:
 require(ROracle)
 Loading required package: ROracle
 Loading required package: DBI
 [1] TRUE
 drv - dbDriver(Oracle)
 drv
 OraDriver:(1648)
 con - dbConnect(drv, user=USER, password=PASS, dbname=TEST)

 A window pops up, with the message:  The instruction at 0x6260c621
 referenced memory at 0x4a280ae2.  The memory could not be read.  And R
 freezes.

Switch on debugging in the oracle client (sqlnet.ora).
Maybe you can get a glimpse on what's wrong.

Please provide version information (Oracle Client libs, Oracle DB).

Is there any network traffic going to or coming from the DB?



 Something is working, because I get to establish an Oracle driver.

What do you mean by that?

__
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.


Re: [R] combinatorics

2006-10-15 Thread Jens Scheidtmann
Robin Hankin [EMAIL PROTECTED] writes:

 Hi

 How do I generate all ways of ordering  sets of indistinguishable items?

 suppose I have two A's, two B's and a C.

 Then I want

 AABBC
 AABCB
 AACBC
 ABABC
 . . .snip...
 BBAAC
 . . .snip...
 CBBAA

 [there are 5!/(2!*2!) = 30 arrangements.  Note AABBC != BBAAC]

 How do I do this?

See Knuth, The Art of Computer Programming Vol 4, Fascicle 3 and 4.

Jens

__
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.


Re: [R] R Graphics: Saving PDF and other formats from Windows Graphic Device for LaTeX

2006-10-05 Thread Jens Scheidtmann
Anupam Tyagi [EMAIL PROTECTED] writes:

[...]
 What is the best format to save R graphics for inclusion into a
 LaTeX documents?

When using pdflatex use pdf for graphics as reference format.  Using
ps2pdf or some such may have some problems when it comes to alpha
channels and transparency.

[...]
 I will be grateful if someone can share their experience.

Indispensable is having a good editing cycle.  I.e. compile the latex,
jump to the position where you are editing the file in the preview,
double click somewhere in the preview, move to that position in your
editor (or at least near that position).  As I am not aware of any
tools doing this with pdf, you may want to render dvi instead.  When
rendering DVI, you probably want to generate ps.

My 2c,

Jens

__
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] FIX: pscales=list(...) and splom

2003-03-08 Thread Jens Scheidtmann
Dear R Users,

When plotting with splom I tried to use the pscales=list(...) feature
Unfortunately it didn't work at all. Instead the scales always were
suppressed.

So I looked at the source of panel.pairs and found:

draw - is.numeric(pscales)  pscales != 0

which rather has to be:

draw - is.list(pscales) || (is.numeric(pscales)  pscales != 0)

With this change, the axis labels could be generated from the
supplied ...$at and ...$lab components of the pscales entries.
(BTW: the documentation says the components should be $at and $labels. This
is wrong!)

But

* The limits of the axes are still generated from the data.

To make panel.pairs honor the ranges supplied in the pscales list, one has
to change

--snip--
  if (n.var  0) {
lim - list(1:n.var)
for (i in 1:n.var) {
  lim[[i]] - extend.limits(range(as.numeric(z[, i]),
  na.rm = TRUE))
}
  }
--snap--

to

--snippi--
  if (n.var  0) {
lim - list(1:n.var)
for (i in 1:n.var) {
  lim[[i]] - extend.limits(range(as.numeric(z[, i]),
  na.rm = TRUE))
  if (is.list(pscales)) {
lim[[i]] - extend.limits(range(pscales[[i]]$at))
  }
}
  }
--snappi--

* The labels are still not as expected.

To fix these, occurences of as.character(axls ... have to be replaced by
labels ...
(see enclosed diff).

Now a call like the following works and displays
the correct ranges and labels:

--snippa--
# Let axes start by 0 and use other decimal separator
pscal - list(1:4)
pscal[[1]] - list(at=seq(0,10,2), lab=paste(seq(0,10,2)))
pscal[[2]] - list(at=seq(0,5,1), lab=paste(seq(0,5,1)))
pscal[[3]] - list(at=seq(0,8,2), lab=paste(seq(0,8,2)))
pscal[[4]] - list(at=seq(0,3,0.5),
lab=format(seq(0,3,0.5),decimal.mark=,))
str(pscal)
splom(~iris[1:4], groups = Species, data = iris,
  panel = panel.superpose,
  key = list(title = Three Varieties of Iris,
columns = 3,
points = list(pch = super.sym$pch[1:3],
  col = super.sym$col[1:3]),
text = list(c(Setosa, Versicolor, Virginica))),
  pscale=pscal)
--snappa--

Please CC me on your replies, because I am not subscribed to this list.
Thanks.

HTH,

Jens

--
Jens Scheidtmann
Germany


panel.pairs.diff
Description: Binary data
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help