[rkward-users] Error of object format with Ubuntu

Seb R seb44550 at gmail.com
Thu Dec 4 13:22:27 UTC 2014


1/ It seems I got the problem for any "trace" with edit=TRUE
*.*2/ I cannot use "fix" on a function but I can use it on any variable of
my workspace and it opens the adequate window...
3/ Changing the editor function did not repaired the problem, nor changed
the traceback error
I don't remember having done something special with the editor or X11 or
what...
I jsut tried to completely remove the rkward package from my Ubuntu as well
as the .rkward folder in my personnal folder. I reinstalled but this did
not change the problem.
*..*
Thank you for taking time to help

## 1/

* > trace(matrix,edit=T)*Erreur dans as.character(name) :
  cannot coerce type 'closure' to vector of type 'character'

*> matrix*function (data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames
= NULL)
{
    if (is.object(data) || !is.atomic(data))
        data <- as.vector(data)
    .Internal(matrix(data, nrow, ncol, byrow, dimnames, missing(nrow),
        missing(ncol)))
}
<bytecode: 0xad5bd0>
<environment: namespace:base>

*> fix(matrix)*Erreur dans as.character(name) :
  cannot coerce type 'closure' to vector of type 'character'

*> trace("matrix",edit=T)*Erreur dans as.character(name) :
  cannot coerce type 'closure' to vector of type 'character'


*> ff <- function(x) {x*2}> trace(ff,edit=TRUE)*
Erreur dans as.character(name) :
  cannot coerce type 'closure' to vector of type 'character'
*> fix(ff)*
Erreur dans as.character(name) :
  cannot coerce type 'closure' to vector of type 'character'


## 2/




*> aa <- matrix(1:4,ncol=2)> fix(aa)*## 3/

*> fix(raster:::.polygonsToRaster)*Erreur dans
fix(raster:::.polygonsToRaster) : 'fix' necessite un nom
*> trace(raster:::.polygonsToRaster,edit=TRUE)*
Erreur dans as.character(name) :
  cannot coerce type 'closure' to vector of type 'character'
*> traceback()*
13: editor(name = name, file = file, title = title)
12: edit.default(def, editor = editor, file = file)
11: utils::edit(def, editor = editor, file = file)
10: .makeTracedFunction(def, tracer, exit, at, print, doEdit)
9: .initTraceable(.Object, ...)
8: initialize(value, ...)
7: initialize(value, ...)
6: new(traceClass, def = if (doEdit) def else original, tracer = tracer,
       exit = exit, at = at, print = print, doEdit = edit)
5: methods::.TraceWithMethods(raster:::.polygonsToRaster, edit = TRUE,
       where = <environment>)
4: eval(expr, envir, enclos)
3: eval(expr, p)
2: eval.parent(call)
1: trace(raster:::.polygonsToRaster, edit = TRUE)
*> getOption("editor")*
function (file = file, title = file, name = NULL, prompt = TRUE)
{
    if (!is.character(file)) {
        nfile = tempfile()
        env = environment(file)
        dput(file, file = nfile, control = c("useSource", "keepNA",
            "keepInteger", "showAttributes"))
        .Call("rk.edit.files", nfile, title, name, prompt, PACKAGE =
"(embedding)")
        x <- dget(nfile)
        environment(x) <- env
        return(x)
    }
    invisible(.Call("rk.edit.files", as.character(file),
as.character(title),
        as.character(name), isTRUE(prompt), PACKAGE = "(embedding)"))
}
<environment: namespace:rkward>

















*> options("editor"=+ function (file = file, title = file, name = NULL,
prompt = TRUE)+ {+     if (!is.character(file)) {+         nfile =
tempfile()+         if (!is.character(title)) title=nfile+         env =
environment(file)+         dput(file, file = nfile, control =
c("useSource", "keepNA",+             "keepInteger",
"showAttributes"))+         .Call("rk.edit.files", nfile, title, name,
prompt, PACKAGE =+ "(embedding)")+         x <- dget(nfile)+
environment(x) <- env+         return(x)+     }+
invisible(.Call("rk.edit.files", as.character(file),
as.character(title),+         as.character(name), isTRUE(prompt), PACKAGE =
"(embedding)"))+ })*


*> trace(raster:::.polygonsToRaster,edit=TRUE)*Erreur dans
as.character(name) :
  cannot coerce type 'closure' to vector of type 'character'

*> traceback()*13: editor(name = name, file = file, title = title)
12: edit.default(def, editor = editor, file = file)
11: utils::edit(def, editor = editor, file = file)
10: .makeTracedFunction(def, tracer, exit, at, print, doEdit)
9: .initTraceable(.Object, ...)
8: initialize(value, ...)
7: initialize(value, ...)
6: new(traceClass, def = if (doEdit) def else original, tracer = tracer,
       exit = exit, at = at, print = print, doEdit = edit)
5: methods::.TraceWithMethods(raster:::.polygonsToRaster, edit = TRUE,
       where = <environment>)
4: eval(expr, envir, enclos)
3: eval(expr, p)
2: eval.parent(call)
1: trace(raster:::.polygonsToRaster, edit = TRUE)

2014-12-04 12:59 GMT+01:00 Thomas Friedrichsmeier <
thomas.friedrichsmeier at ruhr-uni-bochum.de>:

> Hi,
>
> On Thursday 04 December 2014 11:05:36 Seb R wrote:
> > Below is the result of the rk.sessionInfo()
>
> ok, thanks.
>
> > > trace(raster:::.polygonsToRaster,edit=TRUE)
> >
> > Erreur dans as.character(name) :
> >   cannot coerce type 'closure' to vector of type 'character'
>
> I still can't reproduce this. Do you get the same when doing
>   fix(raster:::.polygonsToRaster)
> ? Is this the only function that seems to be affected, or anything you try
> to
> trace with edit=TRUE? After the error, what does
>   traceback()
> report?
>
> What is the value of
>   getOption("editor")
> ?
>
> Please try, if the following fixes the problem:
>
> options("editor"=
> function (file = file, title = file, name = NULL, prompt = TRUE)
> {
>     if (!is.character(file)) {
>         nfile = tempfile()
>         if (!is.character(title)) title=nfile
>         env = environment(file)
>         dput(file, file = nfile, control = c("useSource", "keepNA",
>             "keepInteger", "showAttributes"))
>         .Call("rk.edit.files", nfile, title, name, prompt, PACKAGE =
> "(embedding)")
>         x <- dget(nfile)
>         environment(x) <- env
>         return(x)
>     }
>     invisible(.Call("rk.edit.files", as.character(file),
> as.character(title),
>         as.character(name), isTRUE(prompt), PACKAGE = "(embedding)"))
> })
>
> Thanks!
> Thomas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/rkward-users/attachments/20141204/f7c6d897/attachment.html>


More information about the Rkward-users mailing list