My favorites | Sign in
Logo
             
New issue | Search
for
| Advanced search | Search tips
Issue 18: passing make.section() argument as a list throws error
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Apr 2008
Type-Defect
Priority-Medium
Milestone-0.1.71


Sign in to add a comment
 
Reported by ben.bighair, Apr 07, 2008
# What steps will reproduce the problem? #

Passing a list of ctd objects to make.section() causes a problem.  For
example...

 ctdlist <- list(ctd1, ctd2, ctd3)
 section <- make.section(ctdlist)

This produces an error stating that more than one ctd is required.

The following snippet from make.section() code checks for the "item"
argument class which can be a list of ctd references.

make.section <- function(item, ...)
{
if (class(item) == "ctd") {
	extra.args <- list(...)
	#other code here
} else if (class(item) == "list") {
	args <- list(...)  #<----- this seems to miss the "item" argument
	#other code here
}

I find that I can't pass the function a list of ctd references because the
new variable "args" is creating a new list of all of the other arguments
and not from the "item" argument.

I can get it to work if I change the line to...

make.section <- function(item, ...)
{
if (class(item) == "ctd") {
	extra.args <- list(...)
	#other code here
} else if (class(item) == "list") {
	args <- item  #<----- this works
	#other code here
}


# What version of oce are you using? On what operating system? #
oce version = 0.1.69 
R version = 2.6.2 on G4 PPC OSX 10.4.11


Thanks for the great software, Dan!


 
Comment 1 by Dan.Kel...@Dal.Ca, Apr 08, 2008
Thanks for the report, and for the suggestion (which I think is correct).  I'll look
into this soon.
Status: Accepted
Comment 2 by Dan.Kel...@Dal.Ca, Apr 08, 2008
(No comment was entered for this change.)
Labels: Milestone-0.1.71
Comment 3 by Dan.Kel...@Dal.Ca, Apr 09, 2008
Fixed in the online version (not the version on CRAN, though)
Status: Fixed
Sign in to add a comment

Hosted by Google Code