[R] New mask.ok option for libraries

2021-01-07 Thread Magnus Torfason
It would be very useful for many users who are not ready to switch over to a strict conflicts.policy, to nevertheless be able to suppress messages about expected conflicts using mask.ok and thus only get messages when unexpected masking occurs. = Best, Magnus [[alternative HTML

Re: [R] Inserting 17M entries into env took 18h, inserting 34M entries taking 5+ days

2013-11-08 Thread Magnus Thor Torfason
of the help, Magnus On 11/4/2013 8:20 PM, Thomas Lumley wrote: On Sat, Nov 2, 2013 at 11:12 AM, Martin Morgan mailto:mtmor...@fhcrc.org>> wrote: On 11/01/2013 08:22 AM, Magnus Thor Torfason wrote: Sure, I was attempting to be concise and boiling it down to what

Re: [R] Inserting 17M entries into env took 18h, inserting 34M entries taking 5+ days

2013-11-04 Thread Magnus Thor Torfason
lusters to create final data set That might work ... Thanks! Magnus On 11/1/2013 4:52 PM, William Dunlap wrote: Have you looked into the 'igraph' package? Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mai

Re: [R] Inserting 17M entries into env took 18h, inserting 34M entries taking 5+ days

2013-11-04 Thread Magnus Thor Torfason
ms to be with entries of the form: O->G O->M Which imply that all of O/M/G are equivalent, but they are not detected as such. Will consider whether there is a good way around this. Best, Magnus Here's a function that returns a unique identifier (not well tested!), allowing for tran

Re: [R] Inserting 17M entries into env took 18h, inserting 34M entries taking 5+ days

2013-11-04 Thread Magnus Thor Torfason
There are around 16M unique values. After accounting for equivalence, the number is much smaller (I don't know how much smaller, since my program has not completed yet :-) Yes, I meant that "B and C are also equivalent". The original version was a typo. Best, Magnus On 11

Re: [R] Inserting 17M entries into env took 18h, inserting 34M entries taking 5+ days

2013-11-01 Thread Magnus Thor Torfason
ingers crossed that one of the R-help geniuses who sees this is sufficiently interested to crack the problem Best, Magnus On 11/1/2013 1:49 PM, jim holtman wrote: It would be nice if you followed the posting guidelines and at least showed the script that was creating your entries now so that we

[R] Inserting 17M entries into env took 18h, inserting 34M entries taking 5+ days

2013-11-01 Thread Magnus Thor Torfason
anner, which is contingent on the data I am encountering, and on the contents of the hash table at each moment. Does anyone have a good recommendation for alternatives to implement huge, fast, table-like structures in R? Best, Magnus __ R-h

Re: [R] min(NA,"bla") != min("bla", NA)

2013-09-27 Thread Magnus Thor Torfason
Thanks for putting together such a quick fix! Unfortunately the policy for the system that I'm working on doesn't allow unreleased versions, so I'll have to work around this for a little bit longer. But I'll ask my sysadmins to install 3.0.3 as soon as it gets released. B

[R] min(NA,"bla") != min("bla", NA)

2013-09-26 Thread Magnus Thor Torfason
uld this be considered a bug or is there a way to explain these results in a different way? Best, Magnus ps. Tested on R 3.0.1, 32 bit for Windows (as well as some older versions) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

[R] RCURL ftp upload - ASCII or Binary type?

2012-09-26 Thread Magnus Eriksson
uot; here, but it should be using "ASCII". I have been looking at curlSetOpt() but .encoding is not the problem here. Is there a way to change R:s "Transfer Type" from "Binary" to "ASCII" in this case? How? System: windows 7 R version: 2.15.0 Than

[R] [R-pkgs] Major update: paramlink version 0.6-1

2012-02-04 Thread Magnus Dehli Vigeland
th an introduction to the main features: http://cran.r-project.org/web/packages/paramlink/vignettes/paramlink.pdf Feedback, bug reports and feature requests are most welcome. Regards, Magnus -- Magnus Dehli Vigeland, PhD Department of Medical Genetics University of Oslo Norway E-mail: magnu...@medisin.u

[R] Inconvenient behavior of as.data.frame() for lists without names

2010-09-15 Thread Magnus Thor Torfason
ould be if way of generating default names in this function would be intelligent enough to never create names longer than - say 30 characters. Of course, explicit names should be honored. Anyway, that's my thoughts on this issue. No patch attached, and I will work around this

[R] How do I convert a XML file to a data.frame?

2010-07-12 Thread Magnus Statistik
ue is to use the children structure in my file (which is different compared to the one that can be used with the "xmlToDataFrame"), to convert the XML file to a meaningful data.frame with both categorical and quantitative data. Any tips or tricks? They are h

Re: [R] Trying to tile wireframe plots (using lattice package)

2010-06-25 Thread Magnus Torfason
t , split=c(1,1,2,2) , more=TRUE ) print(top.right, split=c(2,1,2,2) , more=TRUE ) print(bottom.left , split=c(1,2,2,2) , more=TRUE) print(bottom.right , split=c(2,2,2,2) ) ## Example ends Thanks again! Magnus On 6/25/2010 2:59 PM, Greg Snow wrote: The layout function is base graphics,

[R] Trying to tile wireframe plots (using lattice package)

2010-06-25 Thread Magnus Torfason
,3,4), 2, 2, byrow = TRUE)) # Top-left, as expected plot(rnorm(100),rnorm(100)) # Top-right, as expected plot(rnorm(100),rnorm(100)) # But the volcano fills the whole the device ... wireframe(volcano) ## End of example All has been to no avail up until now. I'd be grateful for any suggestion

Re: [R] Deleting duplicate rows in a matrix at random

2010-06-03 Thread Magnus Torfason
> 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

[R] Memory warning (Reached total allocation of ...) - but no error

2010-05-05 Thread Magnus Torfason
red - isn't that the whole point of GC, that it gets triggered when memory is running out? I'd be grateful for advise on this: Should I just ignore these warnings as long as there are no errors, should I bite the bullet and call gc() manually, or is there a third way to deal with this?

Re: [R] Advantages of using SQLite for data import in comparison to csv files

2010-01-14 Thread Magnus Torfason
the table. Unless you need to use bigger data sets, the simplest way is probably to just use csv files, read the contents into a data.frame with read.csv, and then use sqldf on the data.frame if you need to do complicated subsetting) Best, Magnus On 1/14/2010 2:12 AM, Juliet Jacobson wrote: Bu

Re: [R] Ask about large data set

2010-01-13 Thread Magnus Torfason
tell you that reading 1 rows should be a piece of cake on any decent computer. Different estimation techniques are different in terms of computational intensity. Trying it is the best approach. If you run into problems, you could come back with specific questions of optimization. Best, M

Re: [R] <= returns wrong result? Why

2010-01-13 Thread Magnus Torfason
precision" http://tolstoy.newcastle.edu.au/R/e9/help/10/01/index.html#718 Best, Magnus On 1/13/2010 3:25 AM, Stephan Kolassa wrote: take a look at FAQ 7.31. Trafim Vanishek wrote: Does anybody know the probable reason why <= gives false when it should give true?

Re: [R] Solving graph theory problems with R ? (minimum vertex cover)

2010-01-12 Thread Magnus Torfason
that they could be jerry-rigged to solve your problem. Even if not, the people involved may be able to help. For example, the igraph mailing list (igraph-h...@nongnu.org) is pretty active and the developers are very helpful. Best, Magnus __ R-help@r

Re: [R] Conditional Sampling

2010-01-12 Thread Magnus Torfason
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/

Re: [R] Strange behaviour of as.integer()

2010-01-11 Thread Magnus Torfason
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,

Re: [R] Newbie question on precision

2010-01-08 Thread Magnus Torfason
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

Re: [R] Newbie question on precision

2010-01-08 Thread Magnus Torfason
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 (

Re: [R] Strange behaviour of as.integer()

2010-01-07 Thread Magnus Torfason
ill 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. However, Wolfram Alpha will return the correct answer: http://tr.im/1plus1equals2 Best, Magnus

Re: [R] Naming functions for the purpose of profiling

2010-01-07 Thread Magnus Torfason
(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

[R] Naming functions for the purpose of profiling

2010-01-05 Thread Magnus Torfason
issues would be appreciated as well (I know of summaryRprof of course, but it can be difficult to get the full picture from the summaryRprof output if the calling structure is complicated). Best, Magnus __ R-help@r-project.org mailing list https://stat.

[R] Problems when using lag() in plm package

2009-12-29 Thread Magnus Torfason
-32398 > # But the labels of the lagged series could be > # interpreted as being correct in this case > lag(pdu$x) 1-1 1-2 1-3 1-5 1-6 1-7 2-1 2-2 NA 1 2 3 4 5 NA 7 8 attr(,"class") [1] "integer" > Best regards, Magnus

[R] The RSQLite version of dbGetQuery drops colums

2009-12-18 Thread Magnus Torfason
uot;)[FALSE,] [1] hey ho <0 rows> (or 0-length row.names) Any thoughts? Is this a bug, and are the developers of RSQLite reading this? Best regards, Magnus __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] Matrixes as data

2009-10-16 Thread Magnus Torfason
> 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

Re: [R] Creating a list of empty lists

2009-10-14 Thread Magnus Torfason
then perform an assignment using an argument of the length I want (using mapply()). The empty list is then recycled enough times to hold the corresponding values. Best, Magnus __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Creating a list of empty lists

2009-10-13 Thread Magnus Torfason
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 )

[R] Creating a list of empty lists

2009-10-13 Thread Magnus Torfason
()) } But it is not very neat to do this in a loop. Are there any cuter ways to do this? Best, Magnus __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] lapply / mapply and assignments

2009-10-13 Thread Magnus Torfason
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

[R] lapply / mapply and assignments

2009-10-12 Thread Magnus Torfason
uot;, "a")) [1] 1 3 > > # This will not actually work > l[[]]["a"] <- 5:6 > > unlist(lapply(l, "[[", "a")) [1] 5 6 I figure mapply is the solution to the problem, and I tried the following: > mapply( "[<-", l,

Re: [R] Basic question: Reading in multiple choice question responses to a single column in data frame

2009-08-20 Thread Magnus Torfason
tion was useful. My more comprehensive example assumed that you needed to be able to match individual multi-choice selections with other questions through the observation ID after the processing. If that is not needed, the one-liner should be adequate

Re: [R] Basic question: Reading in multiple choice question responses to a single column in data frame

2009-08-19 Thread Magnus Torfason
),length ) > d2 = data.frame( a=rep(d$a,counts), b=unlist(multis) ) > d2 a b 1 1 1 2 2 2 3 2 3 4 3 2 5 4 3 6 4 4 7 5 1 Best, Magnus On 8/19/2009 3:12 PM, Damion Dooley wrote: I'm using read.delim to successfully read in tab delimited data, but some columns' values are

[R] Selecting variables from a list of data.frames

2009-01-06 Thread Magnus
s and regards, Magnus __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Exact test in nxm contingency table

2008-09-17 Thread Magnus Pettersson
in this general table. Does there exist a general function for this test. Best regards, Magnus Pettersson Statistikkonsulterna Gårdavägen 1 412 50 Göteborg 0703-731297 www.statistikkonsulterna.se [[alternative HTML version deleted]] __ R

[R] Using ODBC/RODBC with DBI

2008-06-30 Thread Magnus Torfason
ing something wrong here or is DBI simply not implemented for ODBC? The latter seems unlikely considering the wide use of ODBC, but you never know. I hope it's just me doing something wrong. Best, Magnus [[alternative HTML version deleted]] __ R-