Displaying 20 results from an estimated 800 matches similar to: "Spurious warning in as.data.frame.factor()"
2024 Mar 13
1
Spurious warning in as.data.frame.factor()
? Tue, 12 Mar 2024 12:33:17 -0700
Herv? Pag?s <hpages.on.github at gmail.com> ?????:
> The acrobatics that as.data.frame.factor() is going thru in order to
> recognize a direct call don't play nice if as.data.frame() is an S4
> generic:
>
> ??? df <- as.data.frame(factor(11:12))
>
> ??? suppressPackageStartupMessages(library(BiocGenerics))
> ???
2024 Mar 14
1
Spurious warning in as.data.frame.factor()
> ? Tue, 12 Mar 2024 12:33:17 -0700
> Herv? Pag?s <hpages.on.github at gmail.com> ?????:
> > The acrobatics that as.data.frame.factor() is going thru in order to
> > recognize a direct call don't play nice if as.data.frame() is an S4
> > generic:
> > ??? df <- as.data.frame(factor(11:12))
> >
> > ???
2024 Mar 15
1
Spurious warning in as.data.frame.factor()
>>>>> Martin Maechler
>>>>> on Fri, 15 Mar 2024 11:24:22 +0100 writes:
>>>>> Ivan Krylov
>>>>> on Thu, 14 Mar 2024 14:17:38 +0300 writes:
>> On Thu, 14 Mar 2024 10:41:54 +0100
>> Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>>> Anybody trying S7 examples and see if they work
2024 Mar 15
2
Spurious warning in as.data.frame.factor()
>>>>> Ivan Krylov
>>>>> on Thu, 14 Mar 2024 14:17:38 +0300 writes:
> On Thu, 14 Mar 2024 10:41:54 +0100
> Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>> Anybody trying S7 examples and see if they work w/o producing
>> wrong warnings?
> It looks like this is not applicable to S7. If I overwrite
>
2013 Jul 02
2
cache most-recent dispatch
Hi,
S4 method dispatch can be very slow. Would it be reasonable to cache the
most
recent dispatch, anticipating the next invocation will be on the same
type? This
would be very helpful in loops.
fun0 <- function(x)
sapply(x, paste, collapse="+")
fun1 <- function(x) {
paste <- selectMethod(paste, class(x[[1]]))
sapply(x, paste,
2007 Sep 04
2
Confusion using "functions to access the function call stack" example section
I was going through the example below which is taken from the example
section in the R documentation for accessing the function call stack.
I am confused and I have 3 questions that I was hoping someone could
answer.
1) why is y equal to zero even though the call was done with gg(3)
2) what does parents are 0,1,2,0,4,5,6,7 mean ? I understand what a
parent frame is but how do the #'s relate
2010 Jul 09
2
select columns from vector of column names
Hi
I want to extract columns from a data frame using a vector with the desired
column names.
This short example uses the select argument in the subset function to
accomplish what I am trying to do. Is there a better solution?
#names of desired columns
colnames <- c("col1","col3")
#my data
data <-
2024 Mar 14
1
Spurious warning in as.data.frame.factor()
On Thu, 14 Mar 2024 10:41:54 +0100
Martin Maechler <maechler at stat.math.ethz.ch> wrote:
> Anybody trying S7 examples and see if they work w/o producing
> wrong warnings?
It looks like this is not applicable to S7. If I overwrite
as.data.frame with a newly created S7 generic, it fails to dispatch on
existing S3 classes:
new_generic('as.data.frame', 'x')(factor(1))
#
2006 Dec 30
3
wrapping mle()
Hi,
How can we set the environment for the minuslog function in mle()? The
call in this code fails because the "ll" function cannot find the object
'y'. Modifying from the example in ?mle:
library(stats4)
ll <- function(ymax=15, xhalf=6) {
-sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE))
}
fit.mle <- function(FUN, x, y) {
loglik.fun <- match.fun(FUN)
2010 Jul 09
1
select columns from dataframe
Hi,
I would like to extract columns from a dataframe using a vector of desired
column names.
The following working example uses the select argument in the subset
function to accomplish what I am trying to do. Is there a better solution?
Thanks.
#my data
data <- data.frame("col1"=c(1,2,3),"col2"=c("A","B","C"),"col3"=c(4,5,6))
1997 Jun 06
1
R-beta: nlm
I am trying to use the function "nlm" to find the mle. I want to use a
generic function for the likelihood which would require me to use both the
parameters and the data as arguments. But nlm requires the function to
have only the parameters as arguments for this function (see example below).
> testfun <- function(x,y) sum((x-y)^2) # x - parameters, y - data
>
2014 Mar 11
2
[GSOC 2013] Question about indexing INEX dataset
Hi,
I?m trying to use Omega to index INEX dataset for Letor. But omindex told me these xml files are unknown. Olly told me I could tell omindex to handle them as HTML. (Thanks Olly :) ) Is it appropriate? Parth, could you give me some suggestions?
Thank you!
Jiarong Wei
2013 May 17
2
How could I see the source code of functions in an R package?
Hi,
How could I see the source code of functions in an R package?
If we type ?function_name , we will see documentations of the
function_name.
If we type function_name, is what returns just the source code? Could we
just save it in an .R file and modify as we want? However, it seems that
sometimes the source code is hidden (or stored elsewhere?) As an example,
could we see the source
2013 Dec 06
2
Using assign with mapply
I have a data frame whose first colum contains the names of the variables
and whose second colum contains the values to assign to them:
: kkk <- data.frame(vars=c("var1", "var2", "var3"),
vals=c(10, 20, 30), stringsAsFactors=F)
If I do
: assign(kkk$vars[1], kkk$vals[1])
it works
: var1
[1] 10
However, if I try with mapply
2015 Jan 23
1
:: and ::: as .Primitives?
Hi,
On 01/23/2015 07:01 AM, luke-tierney at uiowa.edu wrote:
> On Thu, 22 Jan 2015, Michael Lawrence wrote:
>
>> On Thu, Jan 22, 2015 at 11:44 AM, <luke-tierney at uiowa.edu> wrote:
>>>
>>> For default methods there ought to be a way to create those so the
>>> default method is computed at creation or load time and stored in an
>>>
2000 Jun 27
2
Printing from Windows 2000
Hello all...I was having incredible difficulty in setting up my HP Color LaserJet 4500 to be shared on a Caldera 2.3 Linux server with access to it from Windows 2000 machines. I've been working about a week now (sadly enough) and I think I've made some progress mainly from information in newsgroups and online documentation. Here's what I have so far: I can print from the linux
2023 Jul 06
2
logic tweak needed for as.data.frame.<class> deprecation warning
Continuing the thread started on R-package-devel, here:
https://stat.ethz.ch/pipermail/r-package-devel/2023q3/009307.html
The logic of the now soft-deprecated as.data.frame.<class>,
> body(as.data.frame.integer)[[2L]]
if ((sys.nframe() <= 1L || sys.call(-1L)[[1L]] != quote(as.data.frame)) &&
nzchar(Sys.getenv("_R_CHECK_AS_DATA_FRAME_EXPLICIT_METHOD_")))
2006 Dec 09
1
one more question about speex_bits_insert_terminator and speex_bits_write
Hi everybody,
I have been examining on how I can use speex completely so I have one more
question. I looked at examples and source code and it goes on.
speex_bits_insert_terminator is called in speex_bits_write function. Shall I
call this method one more time anywhere? Because in speexenc project,
firstly speex_bits_insert_terminator is called then speex_bits_write is
called when we assume that
2005 Dec 22
1
Problems with passing ... to a function
Dear useRs!
I have written a function that should pass argument "m" to the next
function, however it does not! Please have a look at the function below that
shows a problem and tell me what I am missing. As you can see, the "blocks"
argument is passed corectly, while "m" is not.
Best,
Ales Ziberna
opt.par.new<-function(
#function for optimizig
2008 Apr 17
1
Help with using 'get' function and variable scope
Hi -
I'm having a really hard time w/understanding R's get function, and would
appreciate any help with this.
Specifically, I'm using a for loop to call a function. I'd like the
function to have access to the variable being incremented in the for-loop,
i.e.
t.fn <- function() return( get( "i" ) )
t.fn2 <- function() {
for ( i in 1:5 )
cat( t.fn(),