Re: [R] [R-pkgs] Release of ess 0.0.1

2017-11-09 Thread Sam Steingold
ess" seems unfortunate. -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504 http://steingoldpsychology.com http://www.childpsy.net http://iris.org.il http://mideasttruth.com http://thereligionofpeace.com https://jihadwatch.org MS Windows: error: the opera

Re: [R] help with binom.power

2015-08-17 Thread Sam Steingold
> * Bert Gunter [2015-08-17 10:27:58 -0700]: > >> qbinom(.025,1000,.001,lower=FALSE) I don't think this is what I need. I am looking for an inverse of binom.confint. Sorry that my question was not clear. -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1348 http:/

[R] strsplit with a vector split argument

2013-09-18 Thread Sam Steingold
-cut here---end--->8--- I thought that it should be identical to this: --8<---cut here---start->8--- > strsplit(c("a,b;c","d;e,f"),"[,;]") [[1]] [1] "a" "b" "c" [[2

Re: [R] promise already under evaluation

2013-07-03 Thread Sam Steingold
> * Sam Steingold [2013-07-03 11:33:47 -0400]: > > Hi, I asked this question on SO but got no answers: > http://stackoverflow.com/questions/17310825/r-promise-already-under-evaluation Backlin explained on SO that the errors are to be expected: "..." is a formal argument

[R] promise already under evaluation

2013-07-03 Thread Sam Steingold
[promise already under evaluation]] error? What is the right way to pass threshold and exclude from show.large.objects.stack to show.large.objects? Thanks! PS. I would prefer an answer on SO, but please feel free to reply using any venue you like and I will copy your explanation to the other venue

[R] cedta decided 'igraph' wasn't data.table aware

2013-04-21 Thread Sam Steingold
le' objects, and thus `data.frame' objects too. the igraph function graph.data.frame accepts data.frame as the first argument. the igraph maintainers say that "it is not coming from igraph". thanks. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.10 (quantal) X 11.0.11

[R] str on large data.frame is slow on factors with many levels

2013-04-09 Thread Sam Steingold
-8<---cut here---end--->8--- pausing for tens of seconds to print each factor variable which have a lot of levels. Why? (R version 2.15.3 (2013-03-01) -- "Security Blanket" Platform: x86_64-pc-linux-gnu (64-bit)) -- Sam Steingold (http://sds.podval.org/)

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Sam Steingold
> * Bert Gunter [2013-03-17 20:30:56 -0700]: > > I also think it fair to say that all (??) languages have these sorts > of malapropisms due to operator precedence. Except for those languages which do _not_ have "operator precedence". Like, e.g., Lisp. -- Sam Steingold

Re: [R] select rows with identical columns from a data frame

2013-01-20 Thread Sam Steingold
for their answers (to this question, my many previous questions, and, I hope, my future questions in advance)! > On Sat, Jan 19, 2013 at 9:41 PM, Sam Steingold wrote: >>> * Rui Barradas [2013-01-18 21:02:20 +]: >>> >>> Try the following. >>> >

Re: [R] select rows with identical columns from a data frame

2013-01-19 Thread Sam Steingold
> * Rui Barradas [2013-01-18 21:02:20 +]: > > Try the following. > > complete.cases(f) & apply(f, 1, function(x) all(x == x[1])) thanks, this works, but is horribly slow (dim(f) is 766,950x2) -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X

Re: [R] select rows with identical columns from a data frame

2013-01-18 Thread Sam Steingold
I can do Reduce("==",f[complete.cases(f),]) but that creates an intermediate data frame which I would love to avoid (to save memory). > * Sam Steingold [2013-01-18 15:53:21 -0500]: > > I have a data frame with several columns. > I want to select the rows with no NAs (

[R] select rows with identical columns from a data frame

2013-01-18 Thread Sam Steingold
b c 1 1 1 1 2 NA NA NA 3 NA 3 5 4 4 40 40 --8<---cut here---end--->8--- I want the vector TRUE,FALSE,FALSE,FALSE selecting just the first row because there all 3 columns are the same and none is NA. thanks! -- Sam Steingold (http://sds.podval.

[R] non-consing count

2013-01-04 Thread Sam Steingold
8--- however, this approach allocates and discards 2 vectors: a logical vector of length=length(x) and an integer vector in which. is there a cheaper alternative? Thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http:

[R] vectorization & modifying globals in functions

2012-12-27 Thread Sam Steingold
>8--- however, the global d is not modified, apparently update modifies the local copy. so, 1. is there a way for a function to modify a global variable? 2. how would you vectorize this loop? thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 ht

[R] sitools: bug: f2si(0)=>""

2012-12-20 Thread Sam Steingold
Jonas, I think f2si(0) should be "0", not "" as it is now. Thanks. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://ffii.org http://mideasttruth.com http://thereligionofpeace.com http://iris.org.il http://truep

Re: [R] axes labeling

2012-12-20 Thread Sam Steingold
> axis(1, pos, lbl) > axis(2, pos, lbl) That's what I meant when I said "too much control". I am happy with the way R selects positions. All I want is a say in the way R formats those positions. Think in terms of 100 being a variable. To use axis, I will need to write a map

[R] axes labeling

2012-12-20 Thread Sam Steingold
control for this simple task. thanks. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://www.memritv.org http://jihadwatch.org http://pmw.org.il http://americancensorship.org http://think-israel.org Why do we want intelligent terminals w

[R] lattice::xyplot & file output

2012-12-20 Thread Sam Steingold
t but that appears to be ignored too. so, how do I tell lattice::xyplot to write charts in png files? thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://honestreporting.com http://jihadwatch.org http://think-israel.org http:

Re: [R] the value of the last expression

2012-12-10 Thread Sam Steingold
ot attached): > [1] R.methodsS3_1.4.2 tools_2.15.0 > A.K. > > > > > - Original Message - > From: Sam Steingold > To: r-help@r-project.org; Richard M. Heiberger > Cc: > Sent: Monday, December 10, 2012 2:13 PM > Subject: Re: [R] the value of the last express

[R] sum portions of a vector

2012-12-10 Thread Sam Steingold
ength 3 with content --8<---cut here---start->8--- 6 = 1+2+3 30 = 4+5+6+7+8 19 = 9+10 --8<---cut here---end--->8--- Obviously, I could write a loop, but I would rather have a vectorized version. Thanks! -- Sam Steingold (htt

Re: [R] the value of the last expression

2012-12-10 Thread Sam Steingold
piler::compilePKGS(1) --8<---cut here---end------->8--- > On Thu, Feb 9, 2012 at 9:44 PM, Sam Steingold wrote: > >> Is there an analogue of common lisp "*" variable which contains the >> value of the last expression? >> E.g., in lisp: &g

[R] list to matrix?

2012-12-04 Thread Sam Steingold
[1,] Numeric,2 [2,] Numeric,2 [3,] Numeric,2 [4,] Numeric,2 [5,] Numeric,2 [6,] Numeric,2 [7,] Numeric,2 [8,] Numeric,2 [9,] Numeric,2 --8<---cut here---end--->8--- thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 1

Re: [R] aggregate() runs out of memory

2012-11-27 Thread Sam Steingold
> * Steve Lianoglou [2012-11-27 12:53:23 > -0500]: > On Tue, Nov 27, 2012 at 11:29 AM, Sam Steingold wrote: >>> * Steve Lianoglou [2012-11-26 19:47:25 >>> -0500]: > [snip] >>> It just occurred to me that this is even better: >>> >>>

Re: [R] aggregate() runs out of memory

2012-11-27 Thread Sam Steingold
> * Steve Lianoglou [2012-11-26 19:47:25 > -0500]: > > On Monday, November 26, 2012, Sam Steingold wrote: > [snip] > >> >> there is precisely one country for each id. >> i.e., unique(country) is the same as country[1]. >> thanks a lot for the suggest

Re: [R] printing difftime summary

2012-11-26 Thread Sam Steingold
e, TIBCO Software > wdunlap tibco.com > > >> -Original Message----- >> From: Sam Steingold [mailto:sam.steing...@gmail.com] On Behalf Of Sam >> Steingold >> Sent: Monday, November 26, 2012 4:09 PM >> To: William Dunlap >> Cc: r-help@r-project.

Re: [R] printing difftime summary

2012-11-26 Thread Sam Steingold
gt; Mean :3 Mean :2012-11-28 > 3rd Qu.:4 3rd Qu.:2012-11-29 > Max. :5 Max. :2012-11-30 >> summary(d$Delta) > Min.Med.Max > 1 days... 4 days...16 days > > My summary.difftime inherits from difftime so the format method is not really >

Re: [R] aggregate() runs out of memory

2012-11-26 Thread Sam Steingold
ant the same min and max values to be replicated as > many times as there are unique "country"s? there is precisely one country for each id. i.e., unique(country) is the same as country[1]. thanks a lot for the suggestion! > R> result <- f[, list(min=min(delay), max=max(delay), &g

Re: [R] printing difftime summary

2012-11-26 Thread Sam Steingold
> * David Winsemius [2012-11-26 08:46:35 -0800]: > > On Nov 26, 2012, at 7:14 AM, Sam Steingold wrote: > >> summary(infl), where infl$delay is a difftime vector, prints >> >> ... >> >>delay >> string:c("492.00 ms", "18.08 min&qu

Re: [R] aggregate() runs out of memory

2012-11-26 Thread Sam Steingold
hi Steve, > * Steve Lianoglou [2012-11-26 16:08:59 > -0500]: > On Mon, Nov 26, 2012 at 3:13 PM, Sam Steingold wrote: >>> * Steve Lianoglou [2012-11-19 13:30:03 >>> -0800]: >>> >>> For instance, if you want the min and max of `delay` within ea

Re: [R] aggregate() runs out of memory

2012-11-26 Thread Sam Steingold
ield in the original table infl which only depends on share.id, how do I add this unique value to the summary? it appears that "count=unique(country)" in list() does what I need, but it slows down the process. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise)

Re: [R] printing difftime summary

2012-11-26 Thread Sam Steingold
instead of something like delay Min.:492 ms 1st Qu.: 18.08 min &c so, how do I arrange for a proper printing of difftime summary as a part of the data frame summary? > * David Winsemius [2012-11-25 00:50:51 -0800]: > > On Nov 24, 2012, at 7:48 PM

Re: [R] printing difftime summary

2012-11-24 Thread Sam Steingold
-start->8--- > a <- summary(infl) Error in summary.difftime(X[[22L]], ...) : unused argument(s) (maxsum = 7, digits = 12) --8<---cut here---end------->8--- I guess I should somehow accept a list of options in summary.difftim

Re: [R] printing difftime summary

2012-11-23 Thread Sam Steingold
R-FAQ.html#How-should-I-write-summary-methods_003f what are the requirements on the class summary.foo? does it have to inherit from some other class? how do I define a class? -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.chi

Re: [R] printing difftime summary

2012-11-22 Thread Sam Steingold
efault', 'table'" as I assume summary must return. if these are not valid issues, then I wonder why my function should not be the system default method. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://memri.org ht

Re: [R] printing difftime summary

2012-11-21 Thread Sam Steingold
string secs Min.500.00 ms 0.5 1st Qu. 17.12 min 1027.0 Median 99.48 min 5969.0 Mean 8.30 hrs 29870.0 3rd Qu. 8.05 hrs 28970.0 Max.6.98 days 603100.0 --8<---cut here---end--->8--- -- Sam Steingold (http://sds.podval.o

[R] printing difftime summary

2012-11-21 Thread Sam Steingold
x < 6000) return(sprintf("%.2f min",x/60)) if (x < 108000) return(sprintf("%.2f hrs",x/3600)) if (x < 400*24*3600) return(sprintf("%.2f days",x/(24*3600))) sprintf("%.2f years",x/(365.25*24*3600)) } --8<---cut here

Re: [R] aggregate() runs out of memory

2012-11-19 Thread Sam Steingold
t; On Fri, Sep 14, 2012 at 3:26 PM, Sam Steingold wrote: >> I have a large data.frame Z (2,424,185,944 bytes, 10,256,441 rows, 17 >> columns). >> I want to get the result of >> table(aggregate(Z$V1, FUN = length, by = list(id=Z$V2))$x) >> alas, aggregate has been

Re: [R] generated list element names

2012-11-19 Thread Sam Steingold
> $ foo: num 10 >> I am sorry, how is this different from my second snippet (except that you use "x" and I use "z" and you use single quotes in paste and I use double quotes)? > > On Mon, Nov 19, 2012 at 1:07 PM, Sam Steingold wrote: >> How can I cr

[R] generated list element names

2012-11-19 Thread Sam Steingold
ere---start->8--- > z <- list(10) > names(z) <- paste("f","oo",sep="") > z $foo [1] 10 --8<---cut here---end--->8--- thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.

Re: [R] as.data.frame(do.call(rbind, lapply)) produces something weird

2012-11-09 Thread Sam Steingold
2. I find the num->char->num conversion repugnant and unacceptable. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://www.PetitionOnline.com/tap12009/ http://truepeace.org http://honestreporting.com http://ffii.org What was

[R] as.data.frame(do.call(rbind,lapply)) produces something weird

2012-11-09 Thread Sam Steingold
ariables: $ a : Factor w/ 3 levels "a1","a2","a3": 1 2 3 $ b.x: num 1 2 3 $ b.y: num 1 4 9 $ c.x: num 1 8 27 $ c.y: num 1 64 729 --8<---cut here---end--->8--- thanks! -- Sam Steingold (http://sds.podval.org/) on Ubu

Re: [R] LiblineaR: accept sparse matrices

2012-11-09 Thread Sam Steingold
Hi, > * Thibault Helleputte [2012-11-09 > 09:22:11 +0100]: > > The next release of LiblineaR should offer the possibility of using > sparse matrices. However, the next release date is not fixed yet... thanks. > On Thu, Nov 8, 2012 at 10:07 PM, Sam Steingold wrote: >>

Re: [R] LiblineaR: accept sparse matrices

2012-11-08 Thread Sam Steingold
> * Ben Bolker [2012-11-07 21:51:07 +]: > > Sam Steingold gnu.org> writes: > >> It would be nice if LiblineaR() accepted data in the form of a sparse >> matrix (it does not accept whatever e1071::read.matrix.csr returns). >> >> It would also be nic

[R] LiblineaR: accept sparse matrices

2012-11-07 Thread Sam Steingold
provides at least the input code. Thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://iris.org.il http://pmw.org.il http://ffii.org http://dhimmi.com http://www.PetitionOnline.com/tap12009/ Sex is like air. It's only a big

[R] c weirdness

2012-11-07 Thread Sam Steingold
uot;=tab[1]) nons seed.0 ## don't want ".0"! 1 2344600 > c("nons"=1, "seed"=tab[2]) nons seed.1 ## don't want ".1"! 1 6843 > tab 0 1 23446006843 --8<---cut he

Re: [R] matrix.csr %*% matrix --> matrix

2012-11-07 Thread Sam Steingold
> * Martin Maechler [2012-11-07 10:10:51 +0100]: > >>>>>> "Sam" == Sam Steingold >>>>>> on Tue, 6 Nov 2012 13:08:30 -0500 writes: > > Sam> The question is even more pressing for me now given that I no longer > can >

Re: [R] write.matrix.csr data conversion

2012-11-06 Thread Sam Steingold
ints to what libsvm can read. > There is certainly a way to speed this up, but I am not likely to do > this in the near future. too bad. > On 2012-11-06 19:15, Sam Steingold wrote: >> David, >> thanks for adding the feature. >> >> read.matrix.csr and, es

Re: [R] write.matrix.csr data conversion

2012-11-06 Thread Sam Steingold
t; > On 2012-08-27 21:15, Sam Steingold wrote: >>> * jim holtman [2012-08-27 14:55:08 -0400]: >>> >>> Most likely when 'y' is converted to a dataframe (not sure what the >>> function 'write.matrix.csr' does since you did not say where you go

Re: [R] matrix.csr %*% matrix --> matrix

2012-11-06 Thread Sam Steingold
is small enough). > * Sam Steingold [2012-08-27 14:58:47 -0400]: > > When a sparse matrix is multiplied by a regular one, the result is > usually not sparse. However, when matrix.csr is multiplied by a regular > matrix in R, a matrix.csr is produced. > Is there a way to av

Re: [R] no method for coercing this S4 class to a vector

2012-11-06 Thread Sam Steingold
earch/sparse/sparse.html Packaged: 2012-03-18 19:39:05 UTC; root Repository: CRAN Date/Publication: 2012-03-18 20:55:08 Built: R 2.15.2; x86_64-pc-linux-gnu; 2012-11-05 17:46:36 UTC; unix > * Sam Steingold [2012-11-05 12:40:25 -0500]: > > all

[R] no method for coercing this S4 class to a vector

2012-11-05 Thread Sam Steingold
vector what has happened? how do I scale the matrix.csr object (to be written to a file)? PS. write.matrix.csr is very slow: it takes user system elapsed 1137.058 510.615 1649.925 to write the matrix "z" above. thanks! -- Sam Steingold (http://sds.podval.org/) o

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
> * Marc Schwartz [2012-11-04 12:33:20 -0600]: > > On Nov 4, 2012, at 12:22 PM, Sam Steingold wrote: > >>> * Bert Gunter [2012-11-04 09:48:58 -0800]: >>> >>> ?update.packages >> >> It is not obvious to me that this is the answer to my q

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
es() will _not_ try to update it, but, apparently, at least for some packages, I do need to rebuild them against the new R version 2.15.2. Thanks. > On Sun, Nov 4, 2012 at 7:01 AM, Sam Steingold wrote: >> I have some packages installed using install.packages(). >> Do I need to reinsta

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
ching your R installation. In other words: One way to fix your problem is to re install the Matrix package in the version of R you are using. So, will the bug reappear now? -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://openvotingco

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
do what I need. I see that identical(levels(concatenate.factors(a,b)),levels(a)) ==> TRUE DIUC that concatenate.factors does NOT create an intermediate vector and then re-factor it? Thank you very much for your insight! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.1110300

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
> * Jeff Newmiller [2012-10-18 07:53:24 -0700]: > > If you HAVE defined your factors using explicit levels definitions, you > should have no trouble combining them. http://article.gmane.org/gmane.comp.lang.r.general:277719 -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
> * R. Michael Weylandt [2012-10-18 16:01:37 > +0100]: > > On Thursday, October 18, 2012, Sam Steingold wrote: > >> > * Bert Gunter [2012-10-17 23:21:44 -0700]: >> > >> > However, Is level "5" in 'a' the same as level "5&

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
pped to a character vector via letters, which is converted back to integers (==factors). IIUC, a factor is an integer vector which knows that the integers refer to levels. c(a,b) creates such an integer vector. How do I tell it that it is a factor? -- Sam Steingold (http://

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
> * Bert Gunter [2012-10-17 23:21:44 -0700]: > > However, Is level "5" in 'a' the same as level "5" in 'b' ? yes, of course. would anyone want to _different_ factors with identical string representations?! -- Sam Steingold (http://sds.podval.org

[R] how to concatenate factor vectors?

2012-10-17 Thread Sam Steingold
9 levels "1","2","3","4",..: 5 4 3 2 1 9 8 7 6 5 ... --8<---cut here---end--->8--- so, unlist(list()) works. is there a better way or is this how this is supposed to be done? Thanks! -- Sam Steingold (

Re: [R] uniq -c

2012-10-17 Thread Sam Steingold
> * Sam Steingold [2012-10-16 11:03:27 -0400]: > > I need an analogue of "uniq -c" for a data frame. Summary of options: 1. William: isFirstInRun <- function(x) UseMethod("isFirstInRun") isFirstInRun.default <- function(x) c(TRUE, x[-1] != x[-length(x)]) is

Re: [R] uniq -c

2012-10-16 Thread Sam Steingold
> * Duncan Murdoch [2012-10-16 14:22:51 -0400]: > > On 16/10/2012 1:46 PM, Sam Steingold wrote: >> > * Duncan Murdoch [2012-10-16 12:47:36 -0400]: >> > >> > On 16/10/2012 12:29 PM, Sam Steingold wrote: >> >> x is sorted. >> > spars

Re: [R] uniq -c

2012-10-16 Thread Sam Steingold
> * Duncan Murdoch [2012-10-16 12:47:36 -0400]: > sparseby(data=x, INDICES=x, FUN=nrow) Error in `[<-.data.frame`(`*tmp*`, index, , value = list(user = c(2L, : missing values are not allowed in subscripted assignments of data frames -- Sam Steingold (http://sds.podval.org/)

[R] cannot coerce class '"rle"' into a data.frame

2012-10-16 Thread Sam Steingold
e"' into a data.frame it seems that rle.df <- data.frame(values=rle$values,length=rle$length) works and DTRT. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://iris.org.il http://memri.org http://www.PetitionOnline.co

Re: [R] uniq -c

2012-10-16 Thread Sam Steingold
> * Duncan Murdoch [2012-10-16 12:47:36 -0400]: > > On 16/10/2012 12:29 PM, Sam Steingold wrote: >> x is sorted. > sparseby(data=x, INDICES=x, FUN=nrow) this takes forever; apparently, it does not use the fact that x is sorted (even then - it should not take more than a few mi

Re: [R] uniq -c

2012-10-16 Thread Sam Steingold
t;8--- >>> x <- data.frame(a=1:32,b=1:32,c=1:32,d=1:32,e=1:32) >>> system.time(subset(as.data.frame(xtabs( ~. , x )), Freq != 0 )) >>user system elapsed >> 12.788 4.288 17.224 >> --8<---cut here---end------->8

[R] uniq -c

2012-10-16 Thread Sam Steingold
"CO", "CO", "CO", "US", "MM", "MM", "US", "US", "IN", "IN", "IN", "IN", "CA", "CA", "CA", "CA", "US", "DE", "DE",

[R] Rgraphviz: how to read a "dot" file?

2012-10-15 Thread Sam Steingold
The Rgraphviz package index says nothing about reading "dot" files. (it has "toFile" to write them but no fromFile). How do I create an Ragraph object? (either by reading a dot file or from a list of edges with weights and vertices with names and other attributes). --

[R] what to use for sna/graphs?

2012-10-15 Thread Sam Steingold
t be installed in a quite unorthodox way (source("http://bioconductor.org/biocLite.R";); biocLite("Rgraphviz")); and then it is not clear how to turn an IGRAPH graph object into an Ragraph object which Rgraphviz can handle. So, what/how do people use/recommend? Thanks!

Re: [R] a merge() problem

2012-10-10 Thread Sam Steingold
> * Prof Brian Ripley [2012-10-08 06:37:07 +0100]: > > On 08/10/2012 02:57, Peter Ehlers wrote: >> On 2012-10-07 14:44, Sam Steingold wrote: >>>> * Peter Ehlers [2012-10-07 10:03:42 -0700]: >>>> >>>> On 2012-10-07 08:34, Sam Steingold wrote:

Re: [R] a merge() problem

2012-10-07 Thread Sam Steingold
> * Peter Ehlers [2012-10-07 10:03:42 -0700]: > > On 2012-10-07 08:34, Sam Steingold wrote: >> I know it does not look very good - using the same column names to mean >> different things in different data frames, but here you go: >> --8<---cut here-

[R] a merge() problem

2012-10-07 Thread Sam Steingold
duplicated in the result --8<---cut here---end--->8--- why is the suffixes argument ignored? I mean, I expected that the second "a" to be "a.y". (when I omit suffixes, the result is the same). Thanks. -- Sam Steingold (http://sds.

[R] max & summary contradict each other

2012-09-28 Thread Sam Steingold
why does summary report max 27600 and not 27603? > x <- c(27603, 1) > max(x) [1] 27603 > summary(x) Min. 1st Qu. MedianMean 3rd Qu.Max. 16902 13800 13800 20700 27600 -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.1

Re: [R] aggregate help

2012-09-23 Thread Sam Steingold
   NA    2   y  2    > #2 30    1   c  1      NA    1   z  1    > #  a2.num2 > #0   1 > #1  NA > #2  NA > #It is not an elegant way! > > > A.K. > > > > - Original Message - > From: Sam Steingold >

[R] aggregate help

2012-09-20 Thread Sam Steingold
]) }) id id a1 a2 1 10 3 3 3 2 20 2 2 2 3 30 1 1 1 Warning message: In format.data.frame(x, digits = digits, na.encode = FALSE) : corrupt data frame: columns will be truncated or padded with NAs --8<---cut here---end--->8--- Thanks! -- Sam Steingold

Re: [R] where are these NAs coming from?

2012-09-19 Thread Sam Steingold
ocals <- z[z$country == mycountry,] >>> length(which(is.na(locals$language))) >> [1] 229 >> --8<---cut here---end--->8--- >> where are those locals without the language coming from?! >> >> -- >> Sam Steingold (http://sds.podva

Re: [R] drop zero slots from table?

2012-09-19 Thread Sam Steingold
turn. However, it does not do what I want: it does not result in the right name for the returned table. Thanks a lot for your insight! > >> -Original Message- >> From: Sam Steingold [mailto:sam.steing...@gmail.com] On Behalf Of Sam >> Steingold >> Sent: Wednes

Re: [R] where are these NAs coming from?

2012-09-19 Thread Sam Steingold
t; locals <- subset(z, country == mycountry) > > Sarah > > On Wed, Sep 19, 2012 at 1:50 PM, Sam Steingold wrote: >> I see this: >> --8<---cut here---start->8--- >>> length(which(is.na(z$language))) >> [1] 0 >&g

[R] where are these NAs coming from?

2012-09-19 Thread Sam Steingold
- where are those locals without the language coming from?! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://ffii.org http://honestreporting.com http://camera.org http://www.memritv.org http://dhimmi.com I don't like cats! -- Com

Re: [R] drop zero slots from table?

2012-09-19 Thread Sam Steingold
> 9 4 3 2 1 1 > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On >> Behalf >> Of Sam Steingold >> Sent: Wednesday, September 19

Re: [R] drop zero slots from table?

2012-09-19 Thread Sam Steingold
nts "vec" instead of the name of its argument: --8<---cut here---start->8--- > sorted.table(foo$bar) vec A B 10 3 --8<---cut here---end--->8--- how do I pass all arguments of sorted.table() on to ta

[R] drop zero slots from table?

2012-09-19 Thread Sam Steingold
uot; (and maybe even sort?) can be effected by some magic argument to table() which I fail to discover in the docs? Obviously, I could use droplevels() to avoid 0 counts in the first place, but I do not want to drop the levels in the data. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12

[R] sum(table(v)) == length(v)

2012-09-16 Thread Sam Steingold
were 0 tab2 <- table(z$s) stopifnot(length(tab2) == nrow(z)) # yes stopifnot(sum(tab1) == nrow(z)) ### no! sum(tab1) 728587 length(tab1) 503374 length(tab2) 2112951 -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://think-

[R] multi-column factor

2012-09-16 Thread Sam Steingold
nd--->8--- factor(z$a,levels=union(z$a,z$b)) is factor(z$a,levels=union(z$a,z$b)) the right way to handle this? maybe there is a better way to extract levels than union()? (bear in mind that I have ~10M rows and ~1M levels, so performance is an issue). Thanks! -- Sam Steingold (http:

[R] aggregate() runs out of memory

2012-09-14 Thread Sam Steingold
factors). Is there anything I could do to speed this up? Thanks. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://www.PetitionOnline.com/tap12009/ http://dhimmi.com http://think-israel.org http://iris.org.il WinWord 6.0 UNinstall

Re: [R] please comment on my function

2012-09-14 Thread Sam Steingold
canonicalize.language <- function (s) { > # s <- tolower(s) > long <- nchar(s) == 5 > s[long] <- sub("^([[:alpha:]]{2})[-_][[:alpha:]]{2}$","\\1",s[long]) > s[nchar(s) != 2 & s != "c"] <- "unknown" > s > } but it

[R] please comment on my function

2012-09-14 Thread Sam Steingold
t;c"] <- "unknown" s } --8<-------cut here---end--->8--- was even slower (6.4 sec). My two concerns are: 1. avoid allocating many small objects which are never collected 2. run fast Which would be the best implementation? Thanks a lot f

Re: [R] cannot read iso639 table

2012-09-13 Thread Sam Steingold
ada NA Adangme adangme 6 ady NAAdyghe; Adygei adygh note that the first non-ASCII character terminates the input. so, I still cannot read the data from the URL. I can read the file though - with quote="" (thanks

[R] cannot read iso639 table

2012-09-13 Thread Sam Steingold
sage: In readLines("ISO-639-2_utf-8.csv", encoding = "utf-8") : incomplete final line found on 'ISO-639-2_utf-8.csv' > l[108:110] [1] "dgr|||Dogrib|dogrib" [2] "din|||Dinka|dinka" [3] &q

Re: [R] merge a list of data frames

2012-09-06 Thread Sam Steingold
h column? the 3rd ("score") column. Meanwhile I realised that the fastest way is actuall shell: sort+cut+paste produced the csv file which can be loaded into R much faster than the individual score files, so this issue is now purely academic. However, I appreciate the replies I got so far

Re: [R] merge a list of data frames

2012-09-06 Thread Sam Steingold
> * David Winsemius [2012-09-05 21:02:16 -0700]: > > On Sep 5, 2012, at 8:51 PM, Sam Steingold wrote: > >> I have a list of data frames: >> >>> str(data) >> List of 4 >> $ :'data.frame': 700773 obs. of 3 variables: >&g

[R] merge a list of data frames

2012-09-05 Thread Sam Steingold
, Recall(dfs[-1]), all = TRUE, sort = FALSE, : formal argument "all" matched by multiple actual arguments > data.1 <- merge_all(data,by="V1",sort=TRUE) Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort = FALSE, : formal argument "sort"

Re: [R] apply --> data.frame

2012-08-31 Thread Sam Steingold
> * William Dunlap [2012-08-31 18:38:52 +]: > > Is the following something like what you are doing? yes, absolutely, thanks a lot! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://pmw.org.il http://dhimmi

Re: [R] apply --> data.frame

2012-08-31 Thread Sam Steingold
"0" $ c :List of 2 ..$ : chr "10" ..$ : chr "10" I guess the easiest way is to replace c(...list()...) with c(...) but that would mean converting num1,num2,num3 to string and back which I want to avoid for aesthetic reasons. Any better suggestions?

Re: [R] apply --> data.frame

2012-08-30 Thread Sam Steingold
ke c(1,2,"a") ==> "1" "2" "a" =[as.numeric]=> 1 2 "a" -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://openvotingconsortium.org http://www.memritv.org http://ffii.org http://

Re: [R] apply --> data.frame

2012-08-30 Thread Sam Steingold
tion, so they slowness is not surprising) -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://pmw.org.il http://thereligionofpeace.com http://truepeace.org http://openvotingconsortium.org http://ffii.org The best propaganda of ath

Re: [R] apply --> data.frame

2012-08-30 Thread Sam Steingold
> * Sam Steingold [2012-08-30 08:56:17 -0400]: > > Is there a way for an apply-type function to return a data frame? > the closest thing I think of is > > foo <- as.data.frame(t(sapply(...))) > names(foo) <- c() alas, this has a problem of creating a "ho

[R] apply --> data.frame

2012-08-30 Thread Sam Steingold
Is there a way for an apply-type function to return a data frame? the closest thing I think of is foo <- as.data.frame(sapply(...)) names(foo) <- c() is there a more "elegant" way? Thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11

Re: [R] variable scope

2012-08-29 Thread Sam Steingold
> * Duncan Murdoch [2012-08-29 10:30:10 -0400]: > > On 29/08/2012 12:50 AM, Sam Steingold wrote: >> > * Duncan Murdoch [2012-08-28 21:06:33 -0400]: >> > >> > On 12-08-28 5:55 PM, Sam Steingold wrote: >> >> >> >> my observation i

Re: [R] variable scope

2012-08-28 Thread Sam Steingold
> * Duncan Murdoch [2012-08-28 21:06:33 -0400]: > > On 12-08-28 5:55 PM, Sam Steingold wrote: >>> * R. Michael Weylandt [2012-08-28 13:45:35 >>> -0500]: >>> >>>> always you shouldn't need manual garbage collection. >> >> my obser

  1   2   >