ivo welch | 1 Sep 01:39 2008
Picon

error instead of warning?

dear R experts---is it possible to ask R to abort with an error
instead of just giving a warning when I am mis-assigning vectors (or
other data structures) that are not compatible?  that is, I would like

1: In matrix(value, n, p) ... :
  data length [12] is not a sub-multiple or multiple of the number of
columns [11]

to force an error.  are there any other warnings() that are really
more programming errors that I could also convert into an abort?

sincerely,

/iaw

______________________________________________
R-help <at> r-project.org 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.

Redding, Matthew | 1 Sep 01:45 2008
Picon
Picon

tryCatch

Hi All R-Gurus, 

I am trying to debug a program, and I think tryCatch will help. The functions involved 
process through so many times before I encounter the error, things are a bit slow to 
use debug and browser().

I've read the help file and postings on conditions, and am still having trouble.

While running my program I am getting a NAN from a called function, and I want to know the 
input parameters that generate this, so I have included the following in the code of the main
function (calling function):

tryCatch(delM > S, exception=function(e)print(list(S=S, Si=Si, D=D, theta=S/N, incr=del.t)), finally=print("finally"))

This is actually part of an "if" statement, where delM > S is the condition.
Now if delM is an NAN an error results.  

Now the above tryCatch does not work in the way I wish it.  What sort of condition does this little expression
throw when it encounters delM=NAN? is it an exception? What is wrong with the above handler etc?

Kind regards, 

Matt Redding

********************************DISCLAIMER****************************
The information contained in the above e-mail message or messages 
(which includes any attachments) is confidential and may be legally 
privileged.  It is intended only for the use of the person or entity 
to which it is addressed.  If you are not the addressee any form of 
disclosure, copying, modification, distribution or any action taken 
(Continue reading)

Nguyen Dinh Nguyen | 1 Sep 02:09 2008
Picon

Error with Rcmdr package

Dear all,
A friend of mine, who just installed Rcmdr package. When calling the
package, the error as following comes up. And actually, I've checked in CRAN
packages, the tcltk package doesn't exist anymore, but tcltk2.
Any help is appreciated
Regards
Nguyen D Nguyen
Garvan Institute of Medical Research
Sydney, Australia

library(Rcmdr)
Loading required package: tcltk
Loading Tcl/Tk interface ...Error in structure(.External("dotTclObjv", objv,
PACKAGE = "tcltk"), class = "tclObj") :
  [tcl] invalid command name "se".

Error : .onLoad failed in 'loadNamespace' for 'tcltk'
Error: package 'tcltk' could not be loaded

______________________________________________
R-help <at> r-project.org 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.

Duncan Murdoch | 1 Sep 02:05 2008
Picon

Re: error instead of warning?

ivo welch wrote:
> dear R experts---is it possible to ask R to abort with an error
> instead of just giving a warning when I am mis-assigning vectors (or
> other data structures) that are not compatible?  that is, I would like
>
> 1: In matrix(value, n, p) ... :
>   data length [12] is not a sub-multiple or multiple of the number of
> columns [11]
>
> to force an error.  are there any other warnings() that are really
> more programming errors that I could also convert into an abort?
>
>   
You can convert all warnings to errors using option(warn=2).

Duncan Murdoch
> sincerely,
>
> /iaw
>
> ______________________________________________
> R-help <at> r-project.org 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-help <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
(Continue reading)

Cleber Nogueira Borges | 1 Sep 02:33 2008
Picon

reading data in serial port - win32

Hello all

I'd like to get some instruments data by serial port (COM1 - win32)

I make a loopback serial adapter for a testing with the code:

system('mode COM1 9600,N,8,1')
ser <- file("COM1", open='r+')
isOpen(ser)
write('12345', ser)
scan(ser, what=as.character(1), n=1)

So I get the data that I wrote in the port...
But I don't have a more fine control about the serial configuration with
this approach like timeout, handshake etc...

Is there a specific package (library?) for hardware communications?
( For serial port specifically )

Thanks

Cleber

		
_______________________________________________________ 

Experimente já e veja as novidades.

______________________________________________
R-help <at> r-project.org mailing list
(Continue reading)

dxc13 | 1 Sep 01:21 2008
Picon

how to draw a perspective pyramid


Dear list,

I am trying to construct a perspective plot of a 2D triangle, or pyramid.  I
can easily do the one dimensional plot (code below), but I can't figure out
how to do it in a perspective plot for two input variables.  Does anyone
have a simple solution? 

Thanks!
Derek

#code for a triangle
u <- seq(-1,1,.001)
tri <- (1-abs(u))
plot(tri~u,type="l",main="Second Iteration Kernel: Two Input
Variables",lwd=2,
	xlab="x",ylab="y",col="blue")

--

-- 
View this message in context: http://www.nabble.com/how-to-draw-a-perspective-pyramid-tp19247124p19247124.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help <at> r-project.org 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.

ivo welch | 1 Sep 03:29 2008
Picon

Re: SQL Primer for R

stumped again by SQL...  If I have a table named "main" in an SQLite
data base, how do I get the names of all its columns?  (I have a mysql
book that claims the SHOW command does this sort of thing, but it does
not seem to work on SQLite.)

regards,  /iaw

PS: Thanks for the earlier emails on "warn=2".

______________________________________________
R-help <at> r-project.org 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.

David Winsemius | 1 Sep 03:45 2008
Picon
Picon

Re: how to draw a perspective pyramid


On Aug 31, 2008, at 7:21 PM, dxc13 wrote:

>
> Dear list,
>
> I am trying to construct a perspective plot of a 2D triangle, or  
> pyramid.  I
> can easily do the one dimensional plot (code below), but I can't  
> figure out
> how to do it in a perspective plot for two input variables.  Does  
> anyone
> have a simple solution?
>
> Thanks!
> Derek
>
> #code for a triangle
> u <- seq(-1,1,.001)
> tri <- (1-abs(u))
> plot(tri~u,type="l",main="Second Iteration Kernel: Two Input
> Variables",lwd=2,
> 	xlab="x",ylab="y",col="blue")

You probably don't want to have quite so many points in your parameter  
variables.

This is not a correct solution, but maybe it will get you further along:

u <- seq(-1,1,.1)
(Continue reading)

陈武 | 1 Sep 04:14 2008
Picon

why isoMDS not found?

When I type "isoMDS()" in the R environment, a error shows up: no such
function "isoMDS". Why? And what should I do to use isoMDS? Additionally, I
cannot install add-on packages. Typing "Rcmd.exe INSTALL e:/VR_7.2-44.zip"
results in "'perl' is neither command nor executable file...". Why this
happens?Thanks.
The setup file I downloaded is R-2.7.2-win32.exe. After double click and
installation, I did nothing more.

	[[alternative HTML version deleted]]

______________________________________________
R-help <at> r-project.org 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.

Gabor Grothendieck | 1 Sep 05:24 2008
Picon

Re: SQL Primer for R

On Sun, Aug 31, 2008 at 9:29 PM, ivo welch <ivowel <at> gmail.com> wrote:
> stumped again by SQL...  If I have a table named "main" in an SQLite
> data base, how do I get the names of all its columns?  (I have a mysql
> book that claims the SHOW command does this sort of thing, but it does
> not seem to work on SQLite.)

look up the pragma command.

______________________________________________
R-help <at> r-project.org 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.


Gmane