I had sent the following to r-devel a while ago, but perhaps r-help is more
appropriate. I guess my question is what to do with this, would people
generally file an issue, or is there a way to hear if this is something
that makes sense to add – whether more info would be helpful and so on?
=
I
Thanks, that was the pointer I needed. I'd tried the split parameter but
didn't realize that it doesn't work well within wireframe() itself,
rather, I had to call print.trellis() directly using the trellis object
that wireframe() returns if one assigns it to something.
After that, it was prett
Hi all,
I'm trying to print a number of wireframe plots (generated using the
lattice package), and I want them to appear in a two-by two matrix along
with some other (standard) plots. In other words I am trying to create a
subplot or tiled plot that works for wireframes.
I've tried the metho
> I need to remove all but one of each [row in a matrix], which
> must be chosen at random.
This request (included in full at the bottom), has been unanswered for a
while, but I had the same problem and ended up writing a function to
solve it. I call it "duplicated.random()" and it does exactly
Hi all,
I'm getting the following warnings inside a loop:
Warning messages:
1: In calc.measures(g, 1, i) :
Reached total allocation of 1535Mb: see help(memory.size)
2: In calc.measures(g, 1, i) :
Reached total allocation of 1535Mb: see help(memory.size)
Usually, when I see these warnings, t
RSQLite is actually much more than a "driver for data import". It
basically allows any manipulation of SQLite databases, including
reading, writing, or updating and munging data within the database.
Regarding the original question of data import:
I use csv and sqlite files interchangeably to
On 1/12/2010 8:29 PM, Yi Du wrote:
Hi,
Is that okay to let R to read data set more than 1 rows and
use it to do some kernel density estimation? Thanks.
Yi
Why don't you just try it and see? Nothing bad will happen - the
absolute worst case scenario is that R will hang.
But I can tell y
Yupp, FAQ 7.31 is definitely your friend here.
You might also want to take a look at these two very recent threads on
this help list:
"Strange behaviour of as.integer()"
http://tolstoy.newcastle.edu.au/R/e9/help/10/01/index.html#547
"Newbie question on precision"
http://tolstoy.newcastle.edu.
On 1/12/2010 12:12 AM, Johannes Hüsing wrote:
Tal Galili schrieb:
My specific problem is called:
Minimum vertex cover for a hypergraph
I know nothing about the problem at hand, but on the Wikipedia
page it says that the problem can be formulated as an integer
linear program. There is an R pack
Would the following work, or is there a reason why it would not?
risk.set <- 1:100
first.10 <- sample(risk.set, 10)
remainder <- setdiff(risk.set, first.10)
for ( i in 1:1000 )
{
next.5 <- sample(remainder, 5)
do.something.with(next.5)
}
Best,
Magnus
On 1/12/2010 9:00 AM, ehcpiet
On 1/11/2010 10:37 AM, Martin Maechler wrote:
Magnus Torfason
Of course there is still the problem that:
> 1+1 == sqrt(2)*sqrt(2)
[1] FALSE
and gmp will not solve this . I don't know if there is an R-package for
arbitrary-precision reals floating around, but probably not.
Yes,
On 1/8/2010 1:29 PM, Magnus Torfason wrote:
Paul Evans wrote:
How can I get R to change the default precision value? For example:
x=0.9
1-x
[1] 0
Is there a way that I can get a non-zero value using some parameter,
or some package?
many thanks.
The 'gmp' pack
Paul Evans wrote:
How can I get R to change the default precision value? For example:
x=0.9
1-x
[1] 0
Is there a way that I can get a non-zero value using some parameter, or some
package?
many thanks.
The 'gmp' package allows calculation with arbitrary precision rationals
(
There have been some really great responses to this question. I would
like to make a minor contribution by throwing the 'gmp' package into the
mix.
On 1/7/2010 8:12 AM, Duncan Murdoch wrote:
On 07/01/2010 7:31 AM, Ulrich Keller wrote:
as.integer(.57 * 100)
[1] 56
Yes, as the man page state
(parse(text=paste(
desired.func.name," = d$func; ",desired.func.name,"()",
sep="")))
Rprof(NULL)
##
And thanks to Jim Holtman who contacted me off-line and gave me some
helpful advice on profiling in general.
Best,
Magnus
On 1/5/2010 2:58 PM, Magnus Tor
Hi all,
I have some long-running code that I'm trying to profile. I am seeing a
lot of time spent inside the function. Of course, this can
in fact be any of several functions, but I am unable to see how I could
use the information from Rprof.out to discern which function is taking
the most t
Hi,
I've been trying out the plm package, which seems like a great boon to
those who want to analyze panel data in R. I haven't started to use the
estimation functions themselves - for now I am just interested in having
a robust way to deal with lags in unbalanced panel data, since it is
such
Hi all,
I just noticed (the hard way of course) that when a query returns 0
rows, the columns in the resulting data.frame get dropped as well. See
the following example code (where conn is an active connection to an
SQLite db):
> dbGetQuery(conn, "select 1 as hey, 2 as ho where 1")
hey ho
> Hola!
>
> I am working on a problem where data points are (square) matrices. Is
> there a way to make a "vector" of matrices, such that it can be stored
> in a data.frame?
I agree with previous posters that in most cases, you would want to
store matrices in a list. However, if you already have
On 10/13/2009 10:06 AM, Henrique Dallazuanna wrote:
Try this:
replicate(3, list())
Thanks!
I now have three ways to achieve my goal:
1: rep(list(list()), 3)
2: replicate(3, list())
3: Due to the way R recycles arguments, I found that it is enough to
have construct a list(list()), and then
Live and learn ...
Thank you!
On 10/13/2009 9:57 AM, Romain Francois wrote:
On 10/13/2009 03:48 PM, Magnus Torfason wrote:
l = list(list())
for ( i in sequence(length-1) )
{
l = list(unlist(l,recursive=FALSE), list())
}
About this :
> rep( list(list()), 3 )
Well here is one more brain-teaser related to assigning stuff into a
list of list. What if I need to create a new list of empty lists? I have
actually got a solution to this problem:
l = list(list())
for ( i in sequence(length-1) )
{
l = list(unlist(l,recursive=FALSE), list(
Thank you so much, relist and SIMPLIFY both work.
See more comments below ...
On 10/12/2009 5:35 PM, Charles C. Berry wrote:
On Mon, 12 Oct 2009, Magnus Torfason wrote:
I want to achieve the following:
l <- list( list(a=1,b=2), list(a=3,b=4))
l[[]]["a"] <- 5:6
&g
I have a list of isometric structures, and I want to change the same
part of each structure in the list, assigning one element of a vector to
each of these parts.
In other words, I want to achieve the following:
> l <- list( list(a=1,b=2), list(a=3,b=4))
> unlist(lapply(l, "[[", "a"))
[1] 1 3
On 8/19/2009 11:06 PM, Damion Dooley wrote:
Slight addendum. Working from your code, I found 1 line of code does the
conversion:
myColumn = unlist(strsplit(as.character(myData[[myQuestion]]),","));
But the dataframe you set up may prove more useful.
I'm glad my suggestion was useful.
Are you looking for something like this?
> d = data.frame(a=1:5,b=c("1","2,3","2","3,4","1"))
> d
a b
1 1 1
2 2 2,3
3 3 2
4 4 3,4
5 5 1
> multis = strsplit(d$b,",")
> counts = sapply(strsplit(d$b,","),length )
> d2 = data.frame( a=rep(d$a,counts), b=unlist(multis) )
> d2
a b
1 1
Hi all, I would like the following code to work, but it doesn't:
library(DBI)
library(RODBC)
m <- dbDriver("RODBC") # Example for dbConnect(DBI), causes error
m <- dbDriver("ODBC") # Example for DBIDriver-class(DBI), causes error
The errors are:
Error in do.call(as.character(drvName), list(...))
27 matches
Mail list logo