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

2017-11-09 Thread Sam Steingold
package name "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 oper

Re: [R] help with binom.power

2015-08-17 Thread Sam Steingold
* Bert Gunter othagre.4...@tznvy.pbz [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---start-8--- strsplit(c(a,b;c,d;e,f),[,;]) [[1]] [1] a b c [[2]] [1] d e f --8---cut here---end---8--- Is this a bug or did I misunderstand the docs? Thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring

[R] promise already under evaluation

2013-07-03 Thread Sam Steingold
venues. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring) X 11.0.11303000 http://www.childpsy.net/ http://iris.org.il http://mideasttruth.com http://honestreporting.com http://openvotingconsortium.org Linux - find out what you've been missing while you've been rebooting Windows

Re: [R] promise already under evaluation

2013-07-03 Thread Sam Steingold
* Sam Steingold f...@tah.bet [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 which

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

2013-04-21 Thread Sam Steingold
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.1130 http://www.childpsy.net/ http://www.PetitionOnline.com/tap12009/ http://memri.org http://thereligionofpeace.com http

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

2013-04-09 Thread Sam Steingold
---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/) on Ubuntu 12.10 (quantal) X 11.0.1130 http

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

2013-03-18 Thread Sam Steingold
* Bert Gunter thagre.ore...@trar.pbz [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 (http

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 s...@gnu.org wrote: * Rui Barradas ehvconeen...@fncb.cg [2013-01-18 21:02:20 +]: Try the following. complete.cases(f) apply(f, 1

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

2013-01-19 Thread Sam Steingold
* Rui Barradas ehvconeen...@fncb.cg [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 11.0.11103000

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

2013-01-18 Thread Sam Steingold
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.org/) on Ubuntu 12.04 (precise

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 f...@tah.bet [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] non-consing count

2013-01-04 Thread Sam Steingold
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://iris.org.il http://honestreporting.com

[R] vectorization modifying globals in functions

2012-12-27 Thread Sam Steingold
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 http://www.childpsy.net/ http://honestreporting.com http://pmw.org.il http

[R] lattice::xyplot file output

2012-12-20 Thread Sam Steingold
, 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://mideasttruth.com cogito cogito ergo

[R] axes labeling

2012-12-20 Thread Sam Steingold
. -- 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 when there are so many stupid users

Re: [R] axes labeling

2012-12-20 Thread Sam Steingold
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 from variable range to axis tick positions first, and then sapply my formatting to the positions. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X

[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://truepeace.org Type louder

Re: [R] the value of the last expression

2012-12-10 Thread Sam Steingold
---end---8--- On Thu, Feb 9, 2012 at 9:44 PM, Sam Steingold s...@gnu.org wrote: Is there an analogue of common lisp * variable which contains the value of the last expression? E.g., in lisp: (+ 1 2) 3 * 3 I wish I could recover the value of the last expression without re

[R] sum portions of a vector

2012-12-10 Thread Sam Steingold
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 (http://sds.podval.org/) on Ubuntu 12.04 (precise) X

Re: [R] the value of the last expression

2012-12-10 Thread Sam Steingold
- From: Sam Steingold s...@gnu.org To: r-help@r-project.org; Richard M. Heiberger r...@temple.edu Cc: Sent: Monday, December 10, 2012 2:13 PM Subject: Re: [R] the value of the last expression * Richard M. Heiberger e...@grzcyr.rqh [2012-02-09 21:48:50 -0500]: .Last.value Thanks; it worked

[R] list to matrix?

2012-12-04 Thread Sam Steingold
,] 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 11.0.11103000 http

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

2012-11-27 Thread Sam Steingold
* Steve Lianoglou znvyvatyvfg.ubarl...@tznvy.pbz [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 suggestion! R result - f[, list

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

2012-11-27 Thread Sam Steingold
* Steve Lianoglou znvyvatyvfg.ubarl...@tznvy.pbz [2012-11-27 12:53:23 -0500]: On Tue, Nov 27, 2012 at 11:29 AM, Sam Steingold s...@gnu.org wrote: * Steve Lianoglou znvyvatyvfg.ubarl...@tznvy.pbz [2012-11-26 19:47:25 -0500]: [snip] It just occurred to me that this is even better: R

Re: [R] printing difftime summary

2012-11-26 Thread Sam Steingold
...@pbzpnfg.arg [2012-11-25 00:50:51 -0800]: On Nov 24, 2012, at 7:48 PM, Sam Steingold wrote: * David Winsemius qjvafrz...@pbzpnfg.arg [2012-11-23 13:14:17 -0800]: See http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-should-I-write-summary-methods_003f --8---cut here

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

2012-11-26 Thread Sam Steingold
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) X 11.0.11103000 http://www.childpsy.net/ http://openvotingconsortium.org http

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

2012-11-26 Thread Sam Steingold
hi Steve, * Steve Lianoglou znvyvatyvfg.ubarl...@tznvy.pbz [2012-11-26 16:08:59 -0500]: On Mon, Nov 26, 2012 at 3:13 PM, Sam Steingold s...@gnu.org wrote: * Steve Lianoglou znvyvatyvfg.ubarl...@tznvy.pbz [2012-11-19 13:30:03 -0800]: For instance, if you want the min and max of `delay

Re: [R] printing difftime summary

2012-11-26 Thread Sam Steingold
* David Winsemius qjvafrz...@pbzpnfg.arg [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, 1.77 hrs, 8.20 hrs, 8.13 hrs, 6.98 days) secs :c( 0.5

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

2012-11-26 Thread Sam Steingold
as many times as there are unique countrys? 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), count=.N,country=country[1L]), by=share.id] -- Sam Steingold (http

Re: [R] printing difftime summary

2012-11-26 Thread Sam Steingold
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Sam Steingold Sent: Monday, November 26, 2012 2:20 PM To: r-help@r-project.org; David Winsemius Subject: Re: [R] printing difftime summary * David Winsemius qjvafrz...@pbzpnfg.arg [2012-11

Re: [R] printing difftime summary

2012-11-26 Thread Sam Steingold
: 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.org; David Winsemius Subject: Re: [R] printing difftime summary Thanks a lot - almost there! --8---cut here

Re: [R] printing difftime summary

2012-11-24 Thread Sam Steingold
should somehow accept a list of options in summary.difftime() and pass them on to the inner call to summary() (or should it be explicitly summary.numeric()?) how do I do that? -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http

Re: [R] printing difftime summary

2012-11-23 Thread Sam Steingold
-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.childpsy.net/ http://dhimmi.com http://honestreporting.com http

Re: [R] printing difftime summary

2012-11-22 Thread Sam Steingold
method. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://memri.org http://honestreporting.com http://jihadwatch.org http://openvotingconsortium.org http://ffii.org Sex is like air. It's only a big deal if you can't get any

[R] printing difftime summary

2012-11-21 Thread Sam Steingold
? Thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://openvotingconsortium.org http://memri.org http://camera.org http://mideasttruth.com http://pmw.org.il MS Windows: error: the operation completed successfully

Re: [R] printing difftime summary

2012-11-21 Thread Sam Steingold
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.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http

[R] generated list element names

2012-11-19 Thread Sam Steingold
---8--- 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://thereligionofpeace.com http://truepeace.org Unix roulette: `dd if=/dev/urandom of=/dev/kmem bs=1 count=1 seek=$RANDOM

Re: [R] generated list element names

2012-11-19 Thread Sam Steingold
(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 s...@gnu.org wrote: How can I create lists with element names created on the fly? --8---cut here---start-8--- list

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

2012-11-19 Thread Sam Steingold
...@gmail.com wrote: Hi, On Fri, Sep 14, 2012 at 3:26 PM, Sam Steingold s...@gnu.org 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 running for ~30

Re: [R] LiblineaR: accept sparse matrices

2012-11-09 Thread Sam Steingold
Hi, * Thibault Helleputte guvonhyg.uryyrch...@qanylgvpf.pbz [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 s

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

2012-11-09 Thread Sam Steingold
! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://jihadwatch.org http://think-israel.org http://www.PetitionOnline.com/tap12009/ http://honestreporting.com Programming is like sex: one mistake and you have to support it for a lifetime

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

2012-11-09 Thread Sam Steingold
-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 the best thing before sliced

Re: [R] LiblineaR: accept sparse matrices

2012-11-08 Thread Sam Steingold
* Ben Bolker ooby...@tznvy.pbz [2012-11-07 21:51:07 +]: Sam Steingold sds at 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 nice if there were functions to read

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

2012-11-07 Thread Sam Steingold
* Martin Maechler znrpu...@fgng.zngu.rgum.pu [2012-11-07 10:10:51 +0100]: Sam == Sam Steingold s...@gnu.org 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 Sam convert some csr matrices to the regular ones

[R] c weirdness

2012-11-07 Thread Sam Steingold
=tab[2]) nons seed.1 ## don't want .1! 1 6843 tab 0 1 23446006843 --8---cut here---end---8--- -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http

[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 deal

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

2012-11-06 Thread Sam Steingold
://www.econ.uiuc.edu/~roger/research/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 f...@tah.bet

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

2012-11-06 Thread Sam Steingold
is small enough). * Sam Steingold f...@tah.bet [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 avoid this? Thanks

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

2012-11-06 Thread Sam Steingold
On 2012-08-27 21:15, Sam Steingold wrote: * jim holtman wubyg...@tznvy.pbz [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 got it), sorry, library(e1071) '0' and '1

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

2012-11-06 Thread Sam Steingold
it prints 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, especially, write.matrix.csr are extremely slow

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

2012-11-05 Thread Sam Steingold
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/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
. 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://openvotingconsortium.org http

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
, then update.packages() 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 s...@gnu.org wrote: I have some packages installed using install.packages(). Do I need

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
* Marc Schwartz znep_fpujn...@zr.pbz [2012-11-04 12:33:20 -0600]: On Nov 4, 2012, at 12:22 PM, Sam Steingold s...@gnu.org wrote: * Bert Gunter thagre.ore...@trar.pbz [2012-11-04 09:48:58 -0800]: ?update.packages It is not obvious to me that this is the answer to my question. Take note

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
* Bert Gunter thagre.ore...@trar.pbz [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/) on Ubuntu 12.04 (precise) X

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
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://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://palestinefacts.org http://www.memritv.org http://www.PetitionOnline.com/tap12009

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
* R. Michael Weylandt zvpunry.jrlyn...@tznvy.pbz [2012-10-18 16:01:37 +0100]: On Thursday, October 18, 2012, Sam Steingold wrote: * Bert Gunter thagre.ore...@trar.pbz [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

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
* Jeff Newmiller wqarj...@qpa.qnivf.pn.hf [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

Re: [R] how to concatenate factor vectors?

2012-10-18 Thread Sam Steingold
(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.11103000 http://www.childpsy.net/ http

Re: [R] uniq -c

2012-10-17 Thread Sam Steingold
* Sam Steingold f...@tah.bet [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)]) isFirstInRun.data.frame - function(x

[R] how to concatenate factor vectors?

2012-10-17 Thread Sam Steingold
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 (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http

[R] uniq -c

2012-10-16 Thread Sam Steingold
) --8---cut here---end---8--- thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://thereligionofpeace.com http://dhimmi.com http://ffii.org http://truepeace.org http://mideasttruth.com Bus

Re: [R] uniq -c

2012-10-16 Thread Sam Steingold
,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--- you should not need much larger data sets for this. x is sorted. -- Sam Steingold (http

Re: [R] uniq -c

2012-10-16 Thread Sam Steingold
* Duncan Murdoch zheqbpu.qha...@tznvy.pbz [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

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

2012-10-16 Thread Sam Steingold
- 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.com/tap12009/ http://camera.org char*a=char*a=%c%s%c;main

Re: [R] uniq -c

2012-10-16 Thread Sam Steingold
* Duncan Murdoch zheqbpu.qha...@tznvy.pbz [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

Re: [R] uniq -c

2012-10-16 Thread Sam Steingold
* Duncan Murdoch zheqbpu.qha...@tznvy.pbz [2012-10-16 14:22:51 -0400]: On 16/10/2012 1:46 PM, Sam Steingold wrote: * Duncan Murdoch zheqbpu.qha...@tznvy.pbz [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

[R] what to use for sna/graphs?

2012-10-15 Thread Sam Steingold
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! -- Sam Steingold (http://sds.podval.org

[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). -- Sam Steingold (http

Re: [R] a merge() problem

2012-10-10 Thread Sam Steingold
* Prof Brian Ripley evc...@fgngf.bk.np.hx [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 ruy...@hpnytnel.pn [2012-10-07 10:03:42 -0700]: On 2012-10-07 08:34, Sam Steingold wrote: I know it does not look very

[R] a merge() problem

2012-10-07 Thread Sam Steingold
, I expected that the second a to be a.y. (when I omit suffixes, the result is the same). Thanks. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://palestinefacts.org http://honestreporting.com http://truepeace.org http

Re: [R] a merge() problem

2012-10-07 Thread Sam Steingold
* Peter Ehlers ruy...@hpnytnel.pn [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---start

[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.11103000 http

Re: [R] aggregate help

2012-09-23 Thread Sam Steingold
   c  1    NA  NA    1   z  1    NA #  a2.num2 #0   1 #1  NA #2  NA #It is not an elegant way! A.K. - Original Message - From: Sam Steingold s...@gnu.org To: r-help@r-project.org Cc: Sent: Thursday, September 20, 2012 2:06 PM Subject: [R

[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 (http

[R] drop zero slots from table?

2012-09-19 Thread Sam Steingold
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.04 (precise) X 11.0.11103000 http

Re: [R] drop zero slots from table?

2012-09-19 Thread Sam Steingold
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 table() as is? thanks! * Sam Steingold f...@tah.bet [2012-09-19

Re: [R] drop zero slots from table?

2012-09-19 Thread Sam Steingold
-help-boun...@r-project.org] On Behalf Of Sam Steingold Sent: Wednesday, September 19, 2012 9:13 AM To: r-help@r-project.org Subject: Re: [R] drop zero slots from table? Function --8---cut here---start-8--- sorted.table - function (vec) { tab - table

[R] where are these NAs coming from?

2012-09-19 Thread Sam Steingold
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! -- Come on, you just don't know how to cook

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

2012-09-19 Thread Sam Steingold
, Sep 19, 2012 at 1:50 PM, Sam Steingold s...@gnu.org wrote: I see this: --8---cut here---start-8--- length(which(is.na(z$language))) [1] 0 locals - z[z$country == mycountry,] length(which(is.na(locals$language))) [1] 229 --8---cut here

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: Wednesday, September 19, 2012 10:48 AM To: r

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

2012-09-19 Thread Sam Steingold
, thanks! x - data.frame(country = 1:5, language = 1:5) mycountry - NA z - x[x$country == mycountry,] z country language NANA NA NA.1 NA NA NA.2 NA NA NA.3 NA NA NA.4 NA NA On Wed, Sep 19, 2012 at 1:50 PM, Sam Steingold s

[R] multi-column factor

2012-09-16 Thread Sam Steingold
---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] sum(table(v)) == length(v)

2012-09-16 Thread Sam Steingold
- 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-israel.org http

[R] please comment on my function

2012-09-14 Thread Sam Steingold
] - 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 for your insight! -- Sam Steingold (http

Re: [R] please comment on my function

2012-09-14 Thread Sam Steingold
(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 does not convert EN to en, so it is not good for my purposes. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http

[R] aggregate() runs out of memory

2012-09-14 Thread Sam Steingold
(not 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

[R] cannot read iso639 table

2012-09-13 Thread Sam Steingold
2.15.1 (2012-06-22) installed from cran using aptitude. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://dhimmi.com http://memri.org http://ffii.org http://think-israel.org http://honestreporting.com The past is gone, the present

Re: [R] cannot read iso639 table

2012-09-13 Thread Sam Steingold
read the data from the URL. I can read the file though - with quote= (thanks Peter!) - except that the first record is \357\273\277aar. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://thereligionofpeace.com http

Re: [R] merge a list of data frames

2012-09-06 Thread Sam Steingold
* David Winsemius qjvafrz...@pbzpnfg.arg [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: ..$ V1: chr [1:700773] 200130446465779 200070050127778

Re: [R] merge a list of data frames

2012-09-06 Thread Sam Steingold
the replies I got so far, it was quite educational, thanks! (I also appreciate comments on the code above) -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://www.memritv.org http://truepeace.org http://openvotingconsortium.org http

[R] merge a list of data frames

2012-09-05 Thread Sam Steingold
(data,by=c(V1)) Error in `[.data.frame`(df, , match(names(dfs[[1]]), names(df))) : undefined columns selected what does 'formal argument sort matched by multiple actual arguments' mean? thanks. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http

Re: [R] apply -- data.frame

2012-08-31 Thread Sam Steingold
..$ : chr 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? thanks a lot! -- Sam Steingold

Re: [R] apply -- data.frame

2012-08-31 Thread Sam Steingold
* William Dunlap jqha...@gvopb.pbz [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.com

[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.0.11103000 http

Re: [R] apply -- data.frame

2012-08-30 Thread Sam Steingold
* Sam Steingold f...@tah.bet [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 homogeneous data frame, i.e., all

Re: [R] apply -- data.frame

2012-08-30 Thread Sam Steingold
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 atheism is done

Re: [R] apply -- data.frame

2012-08-30 Thread Sam Steingold
,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://truepeace.org http://palestinefacts.org Those who can't write, write manuals

Re: [R] variable scope

2012-08-29 Thread Sam Steingold
* Duncan Murdoch zheqbpu.qha...@tznvy.pbz [2012-08-29 10:30:10 -0400]: On 29/08/2012 12:50 AM, Sam Steingold wrote: * Duncan Murdoch zheqbpu.qha...@tznvy.pbz [2012-08-28 21:06:33 -0400]: On 12-08-28 5:55 PM, Sam Steingold wrote: my observation is that gc in R sucks. (it cannot

[R] variable scope

2012-08-28 Thread Sam Steingold
At the end of a for loop its variables are still present: for (i in 1:10) { x - vector(length=1) } ls() will print i and x. this means that at the end of the for loop body I have to write rm(x) gc() is there a more elegant way to handle this? Thanks. -- Sam Steingold (http

  1   2   >