Is there an R package for fetching email from an IMAP mail server?
I found the CRAN package sendmailR (for sending mail via SMTP) and the CRAN
package Imap (but that is actually Interactive Mapping, nothing to do with
email). I also found a blog posting (
http://www.r-bloggers.com/sna-visualising
Matthew,
Yes, the case I am thinking of is a 1-column key; sorry for the
overgeneralization. I haven't thought much about the multi-column key case.
-s
On Mon, Nov 7, 2011 at 12:48, Matthew Dowle wrote:
> Stavros Macrakis alum.mit.edu> writes:
> >
> > data.t
Milan, Jeff, Patrick,
Thank you for your comments and suggestions.
Milan,
This is far from a "completely theoretical problem". I am performing text
analytics on a corpus of about 2m documents. There are tens of thousands
of distinct words (lemmata). It seems to me that the natural
representat
R factors are the natural way to represent factors -- and should be
efficient since they use small integers. But in fact, for many (but
not all) operations, R factors are considerably slower than integers,
or even character strings. This appears to be because whenever a
factor vector is subsetted
I was surprised to find that df$a[1] is an order of magnitude faster than
df[1,"a"]:
> df <- data.frame(a=1:10)
> system.time(replicate(10, df$a[3]))
user system elapsed
0.360.000.36
> system.time(replicate(10, df[3,"a"]))
user system elapsed
4.090.004.09
Sys.sleep returns immediately for arguments larger than 2.2e6 or so,
including for Inf. This does conforms to the letter of the documention:
"There is no guarantee that the process will sleep for the whole of the
specified interval." but an error would be more helpful.
Since Sys.sleep ignores cla
I'd suggest that the original sin here is calling some particular
numerical integration routine 'integrate', which gives the user an
illusory sense of power Functions have to be well-behaved in
various ways for quadrature to work well, and you've got to expect
things like
> integrate(function(
Are there any R packages to import and use Web Ontology Language (OWL)
ontologies (represented in OWL/RDF or other form)?
Thanks,
-s
[[alternative HTML version deleted]]
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/m
Currently, sample of a data.frame is a sample of the columns:
e.g. sample(data.frame(a=1,b=2:3,c=4),2) => data.frame(b=2:3,c=c(4,4))
I'd have thought it would be much more common to want a sample of the rows.
It's easy enough to define an appropriate function for this:
sample.data.frame <- func
aults are fixed or
taken from global settings -- when there is no obvious reason for the
default to vary by class.
-s
On Fri, Jan 22, 2010 at 3:17 AM, Martin Maechler wrote:
> >>>>> "SM" == Stavros Macrakis
> >>>>> on Thu, 21 Jan 2010
I noticed that in as.data.frame.table, the stringsAsFactors argument
defaults to TRUE, whereas in the other as.data.frame methods, it defaults to
default.stringsAsFactors().
The documentation and implementation agree on this, so this is not a bug.
However, I was wondering if this disparity was in
rbind will work for data frames, but the type of your myData is not clear.
Is it a list of data frames, in which case you probably want
rbind(myData[[1]], myData[[2]])? I don't understand why you write
NewData[1] for your desired result and not NewData. Do you perhaps want
list(rbind(myData[[1]],
you complain
> I simply present the results (at conferences) as my own without mentioning
> your name.
>
> Is this just a dispute between implementers?
>
> Stavros Macrakis wrote:
>
> On Wed, Dec 23, 2009 at 12:27 AM, Dominick Samperi <
>> djsamp...@earthlink.net &
On Wed, Dec 23, 2009 at 12:27 AM, Dominick Samperi
wrote:
> Stavros Macrakis wrote:
>
>> That said, as a matter of courtesy and clarity, I'd think that a fork
>> should use a different name.
>>
> Yes, the point is that this is not a legal or technical matter,
I am not sure what clause of the GPL you have in mind when you say that "it
explicitly states that these changes should not leave misleading impressions
about the original developer."
Are you perhaps thinking of the passage in Section 7 which says:
Notwithstanding any other provision of th
On Fri, Dec 18, 2009 at 2:39 PM, William Dunlap wrote:
> > colchoose( data.frame(a=1:4,b=11:14), c('a','b','b','a'))
> >=> c(1,11,11,1)
>
> I thought you would want c(1,12,13,4), not c(1,11,11,1),
> out of this call. Perhaps I misunderstand your requirements.
>
Sorry, you're r
What is the 'idiomatic' way of writing a vectorized switch statement?
That is, I would like to write, e.g.,
vswitch( c('a','x','b','a'),
a= 1:4,
b=11:14,
100 )
=> c(1, 100, 13, 4 )
equivalent to
ifelse(
(I had sent this to r-help and got no responses -- perhaps r-devel is
a better list for this question?)
How can I determine what S3 method will be called for a particular
first-argument class?
I was imagining something like functionDispatch('str','numeric') =>
utils:::str.default , but I can't fi
On Wed, Sep 2, 2009 at 5:30 PM, Duncan Murdoch wrote:
> On 02/09/2009 4:10 PM, Stavros Macrakis wrote:
...
>> I would nonetheless claim that the documentation as currently written
>> is at best ambiguous and confusing, and would benefit from improved
>> wording.
>
>
gn decisions (wise or unwise) be revisited; only that they be
documented more clearly.
-s
On Wed, Sep 2, 2009 at 3:37 PM, Duncan Murdoch wrote:
> On 9/2/2009 2:39 PM, Stavros Macrakis wrote:
>>
>> The documentation for is.atomic and is.recursive is inconsi
On Wed, Sep 2, 2009 at 2:39 PM, Stavros Macrakis wrote:
> Most types of language objects are regarded as recursive: those
> which are not are the atomic vector types, 'NULL' and symbols (as
> given by 'as.name').
>
> But is.recursive(as.nam
The documentation for is.atomic and is.recursive is inconsistent with
their behavior in R 2.9.1 Windows.
? is.atomic
'is.atomic' returns 'TRUE' if 'x' is an atomic vector (or 'NULL')
and 'FALSE' otherwise.
...
'is.atomic' is true for the atomic vector types ('"logical"',
On Mon, Aug 24, 2009 at 5:36 PM, Peter Dalgaard wrote:
>
> The documentation has:
>
> >>
> The internal equivalent of the default method of as.character is performed
> on x (so there is no method dispatch). If you want to operate on non-vector
> objects passing them through deparse first will be r
In R 2.9.1 Windows:
> nchar(factor(paste('sdf',1:10)))
[1] 1 1 1 1 1 1 1 1 2 1
so it appears that nchar is counting the number of characters in the numeric
representation, just like:
> nchar(as.numeric(factor(paste('sdf',1:10
[1] 1 1 1 1 1 1 1 1 2 1
but ?nchar says explicitly:
x: ch
In R 2.9.1/Windows, ? rank says:
Usage:
rank(x, na.last = TRUE,
ties.method = c("average", "first", "random", "max", "min"))
Arguments:
...
ties.method: a character string specifying how ties are treated,
see 'Details'; can be abbreviated.
This appears contradictory --
> View(as.data.frame(c("","yyy",1,1)))
Error in dataviewer(x, title) : invalid argument
The problem is that View linearizes its argument to generate a title using
deparse(substitute(x)), which sometimes returns a vector of length > 1.
A simple fix is to change this
On Mon, Jun 29, 2009 at 9:19 AM, Martin Morgan wrote:
> ...I'm not sure that including a connection in a slot is going to be a good
> idea, though -- a connection has reference-like semantics, so you can
> end up with multiple objects pointing to the same connection, Also when
> an object is garb
R version 2.8.1 (2008-12-22) / Windows XP
There are several bugs in unique for data frames and matrices. Please
find minimal reproducible examples below.
-s
-A-
Unique of a vector uses numerical comparison:
> nn <- ((1+2^-52)^(5:22))
> unique(nn)
[1] 1 1 1 1 1 1 1 1 1 1 1 1
On Wed, Jun 24, 2009 at 5:28 AM, Martin Maechler
wrote:
>
> SM> But of course 2.5 is not an integer or equal to one.
>
> Interestingly, because of an earlier posting on the topic,
> two days ago (*), I have fixed the help page (and very slightly also
> the code) of ":"
Sorry for the redundant
In 2.8.1/Windows:
According to ? :
Details:
For numeric arguments 'from:to' is equivalent to 'seq(from, to)' ...
Value:
For numeric arguments, a numeric vector. This will be of type
'integer' if 'from' and 'to' are both integers and representable
in the integer typ
a) this is not a bug, so this is the wrong list
b) 'underflow' does not mean what you think it means.
c) guard digits and sticky bits do improve rounding behavior, but
floating point will always remain approximate.
d) if it is important to your application to perform exact arithmetic
on rational
I am not sure if this is a documentation problem or an implementation
problem:
The 'partial' feature of sort works fine with all values of na.last for some
values of 'partial':
> sort(c(3,NA,1,2),na.last=FALSE,partial=1:2) # find minimum values
[1] NA 1 2 3
> sort(c(3,NA,1,2),na.last=TRUE,
Quick action, thanks! Does this also fix the spacing problem (at the end of
my bug report)?
-s
On Wed, Jun 3, 2009 at 2:49 PM, William Dunlap wrote:
> Changing the uninitialized 'w' to 'R_print.na_width' for the complex NA
> code fixes up the valgrind complaints on Linux and the ba
In R 2.8.0 on Windows (tested both under ESS and under R Console in case
there was an I/O issue)
There is a bug in printing val <- matrix(list(NA_complex_,NA_complex_),1).
> dput(val)
structure(list(NA_complex_, NA_complex_), .Dim = 1:2)
> print(val)
[,1]
[1,]
[,2]
[1,]
Note that a large
Vectorize is defined to return a function that acts as if 'mapply' was
called.
So we have:
> mapply(dput,1:2)# mapply form
1L # calls dput on each element of 1:2
2L
[1] 1 2
> Vectorize(dput)(1:2)# Vectorize form
1L
On Tue, Jun 2, 2009 at 1:18 PM, William Dunlap wrote:
> %in% is a thin wrapper on a call to match().
Yes, as I mentioned in my email, all this is clearly documented in ? match.
> match() is not a generic function (and is not documented to be one),
> so it treats data.frames as lists, as their
On Mon, Jun 1, 2009 at 9:21 AM, Martin Maechler
wrote:
> > "AB" == Alex Bokov on Mon, 01 Jun 2009 00:24:58
> -0500 writes:
>
>AB> I'm trying to wrap my R package in a GUI such that when
>AB> the user launches the app, they see my GUI window and
>AB> never interact with the R cons
On Sat, May 30, 2009 at 11:59 AM, Stavros Macrakis wrote:
> Since R is object-oriented, data frame set operations should be the natural
> operations for their class. There are, I suppose, two natural ways: the
> column-wise (variable-wise) and the row-wise (observation-wise) one. The
&
In R 2.8.0/Windows:
> lag(1)
[1] 1
attr(,"tsp")
[1] 0 0 1
Though this has the 'tsp' attribute, it is of class "integer", and hence not
a "time-series object" as defined by ? ts: "time-series objects... are
vector [sic] or matrices with class of '"ts"' (and additional attributes)".
? lag further
ference of two sets of observations would seem to all be highly useful.
-s
On Sat, May 30, 2009 at 10:21 AM, G. Jay Kerns wrote:
> On Sat, May 30, 2009 at 8:50 AM, Stavros Macrakis
> wrote:
> > It seems to me that, abstractly, a dataframe is just as
> > straightf
It seems to me that, abstractly, a dataframe is just as
straightforwardly a sequence of tuples/observations as a vector is a
sequence of scalars. R's convention is that a 1-vector represents a
scalar, and similarly, a 1-dataframe can represent a tuple (though it
can also be represented as a list).
This is another example of the general preference of the designers of R for
convenience over consistency.
In my opinion, this is a design flaw even for non-programmers, because I
find that inconsistencies make the system harder to learn. Yes, the naive
user may stumble over the difference between
Thanks for the quick fix!
-s
On Fri, May 29, 2009 at 1:02 PM, Duncan Murdoch wrote:
> On 5/29/2009 9:28 AM, Duncan Murdoch wrote:
>
>> I've moved this to R-devel...
>>
>> On 5/28/2009 8:17 PM, Stavros Macrakis wrote:
>>
>>>
>
> ...I discovered that when R attempts to sample from an object with only one
> number it does not
> reproduce/report the number but instead chooses a random number between 1
> and that number.
>
This is the documented behavior.
In my opinion, it is a design error, but changing it would no doub
There are two distinct and orthogonal questions here:
1) Is it possible to package an R program/system in such a way that it
can be distributed as a single executable file (including the R
system, any necessary loaded packages, plus the application program)
and run without an installation of R (wh
On Wed, May 6, 2009 at 7:45 PM, Chessxm wrote:
> First, I am wondering whether we are able to use R to generate an exe file,
> or sth that can be executable outside R?
>
Emacs creates self-contained exe files using a library called 'unexec'; this
allows all initialization, library loading, etc.
These look like important improvements. As a relative newcomer to the R
community, I'm not sure I understand what the procedures are for such
changes.
In particular, does the fact that the changes were committed to R-devel mean
that the changes have already been reviewed and approved by R Core?
On Sun, Apr 26, 2009 at 7:24 AM, Ted Harding
wrote:
> On 24-Apr-09 16:53:04, Stavros Macrakis wrote:
>> On Thu, Apr 23, 2009 at 8:54 PM, Ted Harding
>> wrote:
>> [...]
>>> ...inspires someone to incorporate the same language extension
>>> into a GPL
On Thu, Apr 23, 2009 at 8:54 PM, Ted Harding
wrote:
> ...However, if that commercial interpreter also had a 'compile' option,
> and I compiled my progrtam using that, then equally I feel sure
> that the compiled version would be subject to whatever restrictions
> had been placed on distirbution fo
I said:
>> ...The GPL FAQs are the FSF's interpretation. The R Foundation is not
>> obliged to have the same interpretation, and of course the FSF cannot
>> enforce licenses given by the R Foundation
On Thu, Apr 23, 2009 at 5:34 PM, Marc Schwartz wrote:
> Underlying all of your comments seem
On Thu, Apr 23, 2009 at 1:25 PM, Marc Schwartz wrote:
> On Apr 23, 2009, at 11:47 AM, Stavros Macrakis wrote:
>>
>> All that being said, the entity that must enforce these conditions is
>> not the FSF, but the copyright owner, in this case the R Foundation...
>> bundle
The FSF clearly promulgated the GPL with the intent of prohibiting the
bundling of GPL code with proprietary code. The way the GPL does this
is by putting conditions on distribution: if you "distribute" a
program "based on" a GPL program, the whole program must be licensed
under the GPL.
Clearly,
Dear R experts,
You are being a bit harsh on this user. He simply doesn't understand
the distinction between "object of type integer" and "integer-valued
object", which is actually fairly subtle.
On Wed, Apr 22, 2009 at 1:45 PM, wrote:
> This is a very simple function that seems not to be worki
I posted the query below on r-help, but perhaps r-devel is more
suitable... (I guess "r-devel" should be read as "those who develop
(i.e. write) programs in R" rather than "those who develop R"?)
-s
I would like to trace functions, displaying their arguments and return
value, but I h
On Wed, Apr 1, 2009 at 5:11 PM, Wacek Kusnierczyk <
waclaw.marcin.kusnierc...@idi.ntnu.no> wrote:
> Stavros Macrakis wrote:
> ...
> i think this concords with the documentation in the sense that in an
> assignment a string can work as a name. note that
>
>`foo ba
On Wed, Apr 1, 2009 at 4:21 PM, Simon Urbanek
wrote:
>
> On Apr 1, 2009, at 15:49 , Stavros Macrakis wrote:
>
> The documentation for assignment says:
>>
>>In all the assignment operator expressions, 'x' can be a name or
>>an expression defining
The documentation for assignment says:
In all the assignment operator expressions, 'x' can be a name or
an expression defining a part of an object to be replaced (e.g.,
'z[[1]]'). A syntactic name does not need to be quoted, though it
can be (preferably by backticks).
But the
On Tue, Mar 31, 2009 at 12:41 PM, Martin Morgan wrote:
> I don't konw about preferred, but one method is
>
> pkgVars <- local({
>x <- NULL
>list(getX=function() x, setX=function(value) x <<- value)
> })
>
> with use
>
> > pkgVars$getX()
> ...
> This introduces a different programming para
The documentation of as.data.frame is not explicit about how it generates
column names for the simple vector case, but it seems to use the character
form of the quoted argument, e.g.
names(as.data.frame(1:3))
[1] "1:3"
But there is a strange case:
names(as.data.frame(c("a")))
[1] "if (stringsAsF
> matrix(1)[[1,]]
Error in matrix(1)[[1, ]] : invalid subscript type 'symbol'
This is of course an incorrect use of [[, but I think the error
message could be more helpful.
I will guess that it is interpreting the missing value indicator as a
symbol, since I get the same error message for
> matri
Peter, Duncan,
I understand that the missing value indicator is special and will not
behave like an ordinary value in evaluation. I was only discussing its
handling in the text representation functions dput and dump.
Duncan,
You are absolutely right that "list(x=)" is parseable (though not
evalu
Tested in R 2.8.1 Windows
> ff <- formals(function(x)1)
> ff1 <- as.list(function(x)1)[1]
# ff1 acts the same as ff in the examples below, but is a list rather
than a pairlist
> dput( ff , control=c("warnIncomplete"))
list(x = )
This string is not parsable, but dput does not give a warning as sp
There are many other useful extensions one might imagine along these lines.
For instance, we could have an argument for stopping the 'which'
calculation at the first result (or the first N results), which is
often useful (cf. any).
But I think it would be much cleaner for things like this to be d
Petr,
Thank you for the detailed diagnosis of the bizarre behavior I
reported, which seems to indicate several distinct problems in the
underlying code:
1) Factor allows repeated levels, e.g. factor(c(1),c(1,1,1)), with no
warning or error.
2) Even from distinct inputs, factor of a numeric vecto
> cvseqf <- as.factor(cvseq)
>> match(.3,cvseq)
> [1] 2
> which worked.
> In general, would it be better to go the enumeration route via as.factor or
> the approximation route?
> Thanks for the help.
> -Dan
>
> On Mon, Mar 16, 2009 at 8:24 AM, Stavros Macrakis
> wro
Well, first of all, seq(from=.2,to=.3) gives c(0.2), so I assume you
really mean something like seq(from=.2,to=.3,by=.1), which gives
c(0.2, 0.3).
%in% tests for exact equality, which is almost never a good idea with
floating-point numbers.
You need to define what exactly you mean by "in" for flo
Duncan,
Thanks for the reply.
On Sun, Mar 15, 2009 at 4:43 PM, Duncan Murdoch wrote:
> On 15/03/2009 2:31 PM, Stavros Macrakis wrote:
>> dput(ll[3])
>> list(NULL)
>> ? i is positive and exceeds length(x); why isn't this list(NA)?
>
> Because the sentence yo
The semantics of [ and [[ don't seem to be fully specified in the
Reference manual. In particular, I can't find where the following
cases are covered:
> cc <- c(1); ll <- list(1)
> cc[3]
[1] NA
OK, RefMan says: If i is positive and exceeds length(x) then the
corresponding selection is NA.
> dpu
On Sun, Mar 15, 2009 at 1:04 PM, Dirk Eddelbuettel wrote:
Dirk,
Thanks for your reply.
> a) you need to enable sub-second print formats
Yes, if I want to display sub-second printing. But I was just looking
at the rounding behavior.
> b) AFAIK pre-epoch times are second-class citizens
In wha
POSIXct/lt supports fractional seconds (see Sub-second Accuracy
section of man page), but there seem to be some inconsistencies in
their handling.
Converting to POSIXlt and back does not give back the same time for
times before the origin:
> t0 <- as.POSIXct('1934-01-05 23:59:59.1')
> t0
[1]
I am a bit confused about the semantics of classes, [, and [[.
For at least some important built-in classes (factors and dates), both
the getter and the setter methods of [ operate on the class, but
though the getter method of [[ operates on the class, the setter
method operates on the underlying
>> (B) you cannot (easily) predict whether or not x will be modified
>> destructively
>
> that's fine, thanks, but i must be terribly stupid as i do not see how
> this explains the examples above. where is the x used by something else
> in the first example, so that 'names<-'(x, 'foo') does *not*
On Mon, Mar 9, 2009 at 8:55 AM, guangchuang yu
asked why switch(..., a <- 3, ...) doesn't
have the same effect as switch(..., a=3, ...).
In most contexts, `<-` and `=` are synonymous in R, and mean
assignment. In function-argument position, however, an infix `=` names
the argument. Switch depend
On Mon, Mar 9, 2009 at 5:40 PM, Wacek Kusnierczyk
wrote:
> Stavros Macrakis wrote:
>> Tested in: R version 2.8.1 (2008-12-22) / Windows
> when i run these examples, the execution seems to get into an endless
> loop with no error messages whatsoever. how much time does it take
&
Tested in: R version 2.8.1 (2008-12-22) / Windows
Recursive default argument references normally give nice clear errors.
In the first set of examples, you get the error:
Error in ... :
promise already under evaluation: recursive default argument
reference or earlier problems?
(function(a
On Sun, Feb 22, 2009 at 10:34 PM, Berwin A Turlach
wrote:
> G'day Stavros,
Hello, Berwin,
> On Sun, 22 Feb 2009 16:50:13 -0500
> Stavros Macrakis wrote:
>> ...sort(list(...))), I'd hope that wouldn't break existing code. [...]
> ...sort is a generic function
> I hope he realizes that we do appreciate the report. That's why it got such
> quick attention. (I don't expect him to thank me for fixing it, either.)
Thanks for the amazingly quick fix.
-s
__
R-devel@r-project.org mailing list
https://s
Forwarded from the r-help group -- r-devel seems more appropriate per
Duncan's recent email.
-s
-- Forwarded message --
From: Stavros Macrakis
Date: Fri, Feb 6, 2009 at 6:17 PM
Subject: Operations on difftime (abs, /, c)
To: "r-h...@r-project.org"
On Sun, Feb 22, 2009 at 4:12 PM, Duncan Murdoch wrote:
> I think this was posted to the wrong list, so my followup is going to
> R-devel.
OK.
> On 22/02/2009 3:42 PM, Stavros Macrakis wrote:
>>
>> Inspired by the exchange between Rolf Turner and Wacek Kusnierczyk, I
>&g
The man page for gc reads:
The final two columns show the maximum space used since the last
call to 'gc(reset=TRUE)' (or since R started).
The word 'last' here is ambiguous: does it include the *current* call
to gc? When I first read this, I assumed that it did not; indeed, I
only real
On Tue, Feb 10, 2009 at 10:11 AM, Duncan Murdoch wrote:
> Stavros Macrakis wrote:
>> On Tue, Feb 10, 2009 at 8:31 AM, Duncan Murdoch wrote:
>>> The evaluator recognizes the context of usage and will get the
>>> function for a function call
>> Can you poi
On Tue, Feb 10, 2009 at 8:31 AM, Duncan Murdoch wrote:
> Stavros Macrakis wrote:
>
>> It is a bad idea to set data.frame <- xxx since R has a single
>> namespace for functions and variables.
>>
>>
> That's not quite accurate. R mixes functions and vari
Don't know if this is the problem, but
It is a bad idea to set data.frame <- xxx since R has a single
namespace for functions and variables.
-s
On 2/10/09, xinlee...@stat.math.ethz.ch wrote:
> Full_Name: Xin Lee
> Version: 2.8.0
> OS: Windows XP
> Submission from: (NULL) (193.200.15
Thank you for your helpful reply, which clarified several issues for me.
-s
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Inspired by Rudolf Biczok's query of Fri, Jan 23, 2009 at 1:25 AM, I
tried to implement iteration in a generic way using S4. (Though I am
admittedly still struggling with learning S4.)
> setClass("foo",representation(bar="list"))
[1] "foo"
> x<-new("foo",bar=list(1,2,3))
Given this, I would not e
85 matches
Mail list logo