Re: [R] Sorting based a custom sorting function

2023-12-14 Thread Martin Morgan
In the spirit of 'advent of code', maybe it is better to exploit the features of the particular language you've chosen? Then the use of factors seems very relevant. value_levels <- c("Small", "Medium", "Large") df <- data.frame( person = c("Alice", "Bob", "Bob", "Charlie"), value =

Re: [R] R does not run under latest RStudio

2023-04-06 Thread Martin Morgan
employee. Martin Morgan From: R-help on behalf of Steven Yen Date: Thursday, April 6, 2023 at 3:20 PM To: Uwe Ligges Cc: R-help Mailing List , Steven T. Yen Subject: Re: [R] R does not run under latest RStudio The RStudio list generally does not respond to free version users. I was hoping

Re: [R] How to access source code

2022-12-08 Thread Martin Morgan
showMethods(LGD, includeDef = TRUE) shows the implementation of all methods on the LGD generic, and can be a useful fast track to getting an overview of what is going on. Martin Morgan From: R-help on behalf of Ivan Krylov Date: Thursday, December 8, 2022 at 11:23 AM To: Christofer Bogaso

Re: [R] interval between specific characters in a string...

2022-12-02 Thread Martin Morgan
You could split the string into letters and figure out which ones are �b� which(strsplit(x, "")[[1]] == "b") and then find the difference between each position, �anchoring� at position 0 > diff(c(0, which(strsplit(x, "")[[1]] == "b"))) [1] 2 4 1 6 4 From: R-help on behalf of Evan Cooch

Re: [R] Partition vector of strings into lines of preferred width

2022-10-28 Thread Martin Morgan
> strwrap(text) [1] "What is the best way to split/cut a vector of strings into lines of" [2] "preferred width? I have come up with a simple solution, albeit naive," [3] "as it involves many arithmetic divisions. I have an alternative idea" [4] "which avoids this problem. But I may miss some

Re: [R] Handling dependencies on Bioconductor packages for packages on CRAN

2021-12-07 Thread Martin Morgan
One possibility is to make graph a Suggests: dependency, and preface any code using it (or, e.g., in an .onLoad function) with if (!requireNamespace("graph", quietly = TRUE)) stop( "install the Bioconductor 'graph' package using these commands\n\n", ## standard Bioconductor

Re: [R] How to create a proper S4 class?

2021-11-18 Thread Martin Morgan
am still struggling with the inheritance. The information may be useful, though: it helps in deciding the design of the data-structures. [Actually, all base-methods should work natively as well - but to have a solution in any case.] Sincerely, Leonard On 11/17/2021 5:48 P

Re: [R] How to create a proper S4 class?

2021-11-17 Thread Martin Morgan
function; this is relatively complicated to get right, but worth exploring. I hope that gets you a little further along the road. Martin Morgan On 11/16/21, 11:34 PM, "R-help on behalf of Leonard Mada via R-help" wrote: Dear List-Members, I want to create an S4 class with 2 d

Re: [R] RSQLite slowness

2021-10-06 Thread Martin Morgan
the relevant example at the sqlite command line? Martin Morgan On 10/6/21, 2:50 PM, "R-help" wrote: Thank you Bert, I set up a new thread on BioStars [1]. So far, I'm a bit unfamilliar with Bioconductor (but will hopefully attend a course about it in November, which I'm kinda hyped about),

Re: [R] inverse of the methods function

2021-05-03 Thread Martin Morgan
see '?methods' for accessing help and source code Martin Morgan On 5/3/21, 6:34 PM, "R-help on behalf of Therneau, Terry M., Ph.D. via R-help" wrote: Is there a complement to the methods function, that will list all the defined methods for a class?One solution is to look di

Re: [R] parallel: socket connection behind a NAT router

2021-01-18 Thread Martin Morgan
A different approach uses doRedis https://CRAN.R-project.org/package=doRedis (currently archived, but actively developed) for use with the foreach package, or RedisParam https://github.com/mtmorgan/RedisParam (not released) for use with Bioconductor's BiocParallel package. These use a redis

Re: [R] error in installing limma

2020-12-22 Thread Martin Morgan
practices documented on, e.g., https://bioconductor.org/packages/limma to install packages BiocManager::install("limma") Martin Morgan On 12/22/20, 1:11 PM, "R-help on behalf of Ayushi Dwivedi" wrote: Good afternoon Sir, With due respect I want to convey that wh

Re: [R] Inappropriate color name

2020-11-16 Thread Martin Morgan
Lainey wishes to report a bug, so should see ?bug.report. Mail sent to R-core will be held for moderator approval, and relevant input or ultimate resolution would not be visible to the wider community; it is not a good place to report bugs. Martin Morgan On 11/16/20, 4:48 PM, "R

Re: [R] Installing bioconduction packages in connection with loading an R package

2020-10-12 Thread Martin Morgan
ckly to your package web site and clear installation instructions; I do not think use of Bioc packages is a particular barrier to use. Martin Morgan On 10/11/20, 2:52 PM, "R-help on behalf of Søren Højsgaard" wrote: Dear all, My gRbase package imports functionality

Re: [R] combine filter() and select()

2020-08-20 Thread Martin Morgan
ntly, but for what it's worth subset() can be used to perform these operations individually > mytbl %>% subset(, files) # A tibble: 6 x 1 files 1 a 2 b 3 c 4 d 5 e 6 f > mytbl %>% subset(grepl("a", files), ) # A tibble: 1 x 2 files prop 1 a 1 Martin Morg

Re: [R] Best settings for RStudio video recording?

2020-08-13 Thread Martin Morgan
small, and try to remember to expand things at the time when the end result is in sight (so to speak;)). I hope others with more direct experience are not dissuaded by Bert's opinions, and offer up their own experiences or resource recommendations. Martin Morgan On 8/13/20, 6:05 PM, "R

Re: [R] Plotting DMRs (Differentially Methylated Regions) using Gviz package in R

2020-02-07 Thread Martin Morgan
Probably have more success asking on https://support.bioconductor.org. Martin Morgan On 2/7/20, 12:57 PM, "R-help on behalf of pooja sinha" wrote: Hi All, I have a file list consisting of Chromosome, Start , End & Methylation Difference in the following f

Re: [R] how to find number of unique rows for combination of r columns

2019-11-08 Thread Martin Morgan
a b v1_mean v2_median 1 1 1 1.5 3.5 2 2 2 3 2 3 2 3 4 1 I do not know how performant this would be with data of your size. Martin Morgan On 11/8/19, 1:39 PM, "R-help on behalf of Ana Marija" wrote: Thank you

Re: [R] how to use a matrix as an index to another matrix?

2019-10-11 Thread Martin Morgan
A matrix can be subset by another 2-column matrix, where the first column is the row index and the second column the column index. So idx = matrix(c(B, col(B)), ncol = 2) A[] <- A[idx] Martin Morgan On 10/11/19, 6:31 AM, "R-help on behalf of Eric Berger" wrote: He

Re: [R] BiocManager problem.

2019-10-10 Thread Martin Morgan
Please follow the response to your question on the Bioconductor support site https://support.bioconductor.org/p/125493/ Martin Morgan On 10/10/19, 12:23 PM, "R-help on behalf of Ali Siavosh" wrote: Hi, I have installation of R in a server running on redhat 7. I have

Re: [R] Trying to coerce an AnnotatedDataFrame in order to access Probeset Info

2019-07-17 Thread Martin Morgan
Are you remembering to attach the Biobase package to your R session? > AnnotatedDataFrame() Error in AnnotatedDataFrame() : could not find function "AnnotatedDataFrame" > suppressPackageStartupMessages({ library(Biobase) }) > AnnotatedDataFrame() An object of class 'AnnotatedDataFrame': none

Re: [R] Was there a change to R ver. 3.5.2 so that it now treats warnings during installs as errors?

2019-01-20 Thread Martin Morgan
lling the package would address this problem. Martin Morgan On 1/20/19, 6:58 AM, "R-help on behalf of Duncan Murdoch" wrote: On 19/01/2019 8:22 p.m., Peter Waltman wrote: > I'm trying to install a devel package called gGnome ( > https://github.com/mskilab/gGnome). On

Re: [R] Efficient way of loading files in R

2018-09-07 Thread Martin Morgan
Ask on the Bioconductor support site https://support.bioconductor.org Provide (on the support site) the output of the R commands library(GEOquery) sessionInfo() Also include (copy and paste) the output of the command that fails. I have > gseEset2 <- getGEO('GSE76896')[[1]] Found 1 file(s)

Re: [R] mzR fails to install/compile (linuxes)

2018-06-16 Thread Martin Morgan
on the maintainer's github https://github.com/sneumann/mzR/issues/ this is linked to from the package 'landing page' https://bioconductor.org/packages/mzR Martin Morgan On 06/15/2018 10:49 AM, lejeczek via R-help wrote: hi guys, just an admin here. I wonder if anybody see what I see, or similar? I'm

Re: [R] S4 class slot type S4 class

2018-05-21 Thread Martin Morgan
;b": An object of class "B" Slot "y": numeric(0) Slot "z": numeric(0) > .C(a = .A(x = 1:2), b = .B(y = 2:1, z = 1:2)) An object of class "C" Slot "a": An object of class "A" Slot "x": [1] 1 2 Slot "b": An object of

Re: [R] Possible Improvement to sapply

2018-03-13 Thread Martin Morgan
rs and re-thinking the algorithm. Why would one need to call sapply() millions of times, in a situation where this becomes rate-limiting? Can the algorithm be re-implemented to avoid this step? Martin Morgan Harold __ R-help@r-project.org mailing list --

Re: [R] UseDevel: version requires a more recent R

2018-01-09 Thread Martin Morgan
is at http://bioconductor.org/developers/how-to/useDevel/ Martin Morgan On 01/09/2018 01:32 PM, Sariya, Sanjeev wrote: Hello R experts: I need a developer version of a Bioconductor library. sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7

Re: [R] Facing problem in installing the package named "methyAnalysis"

2017-12-29 Thread Martin Morgan
On 12/29/2017 07:00 AM, Pijush Das wrote: Thank you Michael Dewey. Can you please send me the email id for Bioconductor. https://support.bioconductor.org Make sure you are using packages from a consistent version of Bioconductor source("https://bioconductor.org/biocLite.R;)

Re: [R] dplyr - add/expand rows

2017-11-29 Thread Martin Morgan
On 11/29/2017 05:47 PM, Tóth Dénes wrote: Hi Martin, On 11/29/2017 10:46 PM, Martin Morgan wrote: On 11/29/2017 04:15 PM, Tóth Dénes wrote: Hi, A benchmarking study with an additional (data.table-based) solution. I don't think speed is the right benchmark (I do agree that correctness

Re: [R] dplyr - add/expand rows

2017-11-29 Thread Martin Morgan
1  1963 QMC 5   07EA001  1964 QMC ... ...   ... ... 20  07EA001  1979 QRC 21  07EA001  1980 QRC 22  07EA001  1981 QRC 23  07EA001  1982 QRC 24  07EA001  1983 Q

Re: [R] dplyr - add/expand rows

2017-11-28 Thread Martin Morgan
On 11/26/2017 08:42 PM, jim holtman wrote: try this: ## library(dplyr) input <- tribble( ~station, ~from, ~to, ~record, "07EA001" ,1960 , 1960 , "QMS", "07EA001" , 1961 , 1970 , "QMC", "07EA001" ,1971 , 1971 , "QMM",

Re: [R] R_LIBS_USER not in libPaths

2017-09-16 Thread Martin Morgan
On 09/16/2017 11:29 AM, Rene J Suarez-Soto wrote: I have not intentionally set R_LIBS_USER. I looked for an Renviron.site file but did not see it in R/etc or my home directory. The strange part is that if I print Sud.getenv I see a value for R_LIBS_USER. However, this directory is not showing

Re: [R] How to add make option to package compilation?

2017-09-15 Thread Martin Morgan
On 09/15/2017 08:57 AM, Michael Dewey wrote: In line On 15/09/2017 13:30, Martin Møller Skarbiniks Pedersen wrote: On 15 September 2017 at 14:13, Duncan Murdoch wrote: On 15/09/2017 8:11 AM, Martin Møller Skarbiniks Pedersen wrote: Hi, I am installing a lot

Re: [R] Error in readRDS(dest) (was Re: Error with installed.packages with R 3.4.0 on Windows)

2017-05-31 Thread Martin Morgan
call. 'method' can be determined when you are in available.packages while debugging; if R says that it is missing, then it will be assigned, in download.file, to either getOption("download.file.method") or (if the option is NULL or "auto") "libcurl". If the download 'succeeds' but t

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-05-22 Thread Martin Morgan
onnectivity issue, or perhaps an issue with the CRAN mirror you're using. Can you debug on your end, e.g,. options(error=recover) install.packages("withr") ... then select the 'frame' where the error occurs, look around ls() find the value of 'dest', and e.g., try to op

Re: [R] renameSeqlevels

2017-02-14 Thread Martin Morgan
Rsamtools and GenomicAlignments are Bioconductor packages so ask on the Bioconductor support site https://support.bioconductor.org You cannot rename the seqlevels in the bam file; you could rename the seqlevels in the object(s) you have created from the bam file. Martin On 02/14/2017

Re: [R] Using a mock of an S4 class

2017-02-02 Thread Martin Morgan
On 02/01/2017 02:46 PM, Ramiro Barrantes wrote: Hello, I have a function that applies to an S4 object which contains a slot called @analysis: function calculation(myObject) { tmp <- myObjects@analysis result <- ...operations on analysis... return result } I am writing a unit test for

Re: [R] Error In DESeq installation

2016-10-24 Thread Martin Morgan
On 10/23/2016 10:13 PM, Yogesh Gupta wrote: Dear All, I am getting error in DESeq installation in R. package ‘DESeq’ is not available (for R version 3.3.1) source("http://www.Bioconductor.org/biocLite.R;) Bioconductor version 3.4 (BiocInstaller 1.24.0), ?biocLite for help

Re: [R] Faster Subsetting

2016-09-28 Thread Martin Morgan
On 09/28/2016 02:53 PM, Hervé Pagès wrote: Hi, I'm surprised nobody suggested split(). Splitting the data.frame upfront is faster than repeatedly subsetting it: tmp <- data.frame(id = rep(1:2, each = 10), foo = rnorm(20)) idList <- unique(tmp$id) system.time(for (i in idList)

Re: [R] src/Makevars ignored ?

2016-09-27 Thread Martin Morgan
/doc/manuals/r-release/R-exts.html#Using-Makevars Martin Morgan PS I tested the ssame behaviour with various version of R from R/2.15 to R/3.3 best regards Eric __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see http

Re: [R] makePSOCKcluster launches different version of R

2016-08-05 Thread Martin Morgan
On 08/05/2016 12:07 PM, Guido Kraemer wrote: Hi everyone, we are running R on a Linux Cluster with several R versions installed in parallel. If I run: library(parallel) cl <- makePSOCKcluster( rep('nodeX', 24), homogeneous = FALSE, rscript = '/usr/local/apps/R/R-3.2.2/bin/Rscript' )

Re: [R] Get the location of a numeric element in a list

2016-06-28 Thread Martin Morgan
ate a vector rep(seq_along(d), lengths(d)), and split it into groups defined by f f = factor(unlist(d, use.names=FALSE), levels=queries) split(rep(seq_along(d), lengths(d)), f) Martin Morgan Thanks in advance !! Tanvir Ahamed Göteborg, Sweden | mashra.

Re: [R] Warning when running R - can't install packages either

2016-05-13 Thread Martin Morgan
r-project.org/bin/linux/debian/) Martin Morgan Jakub On 13. May 2016, at 11:31, Martin Morgan <martin.mor...@roswellpark.org> wrote: On 05/12/2016 10:25 PM, Alba Pompeo wrote: Martin Morgan, I tried an HTTP mirror and it worked. What could be the problem and how to fix? Also, shou

Re: [R] Warning when running R - can't install packages either

2016-05-13 Thread Martin Morgan
On 05/12/2016 10:25 PM, Alba Pompeo wrote: Martin Morgan, I tried an HTTP mirror and it worked. What could be the problem and how to fix? Also, should I ignore the warning about ignoring environment value of R_HOME? It depends on why you set the value in your environment in the first place

Re: [R] Warning when running R - can't install packages either

2016-05-13 Thread Martin Morgan
On 05/12/2016 10:25 PM, Alba Pompeo wrote: Martin Morgan, I tried an HTTP mirror and it worked. What could be the problem and how to fix? The problem is in the warning message 1: In download.file(url, destfile = f, quiet = TRUE) : URL 'https://cran.r-project.org/CRAN_mirrors.csv': status

Re: [R] Warning when running R - can't install packages either

2016-05-12 Thread Martin Morgan
when choosing a non-https mirror, #28 in your screenshot? Martin Morgan Thanks a lot. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] S4 non-virtual class with no slots?

2016-04-22 Thread Martin Morgan
ved classes corresponding to stateless or stateful conditions Base = setClass("Base"); A = setClass("A", contains="Base"); A() Martin Morgan Thanks. Ross Boylan __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Martin Morgan
grepl) on non-Windows > system.time(res2 <- pvec(seq_along(grams), function(i) grepl("^91", grams[i]), mc.cores=8)) user system elapsed 24.996 1.709 3.974 > identical(res0, res2) [[1]] TRUE I think anything else would require pre-processing of some kind, and then

Re: [R] Ask if an object will respond to a function or method

2016-03-31 Thread Martin Morgan
(object, ...) object$coefficients Maybe fail on use, rather than trying to guess up-front that the object is fully appropriate? Martin Morgan Right now, I'm contemplating this: zz1 < - try(coef(zz)) if (inherits(zz1, "try-error")) stop("Your model has no coef method"

Re: [R] Persistent state in a function?

2016-03-23 Thread Martin Morgan
Use a local environment to as a place to store state. Update with <<- and resolve symbol references through lexical scope E.g., persist <- local({ last <- NULL# initialize function(value) { if (!missing(value)) last <<- value

Re: [R] regex - extracting src url

2016-03-22 Thread Martin Morgan
On 03/22/2016 12:44 AM, Omar André Gonzáles Díaz wrote: Hi,I have a DF with a column with "html", like this:

Re: [R] R problem : Error: protect(): protection stack overflow

2016-03-15 Thread Martin Morgan
On 03/14/2016 06:39 PM, Mohammad Tanvir Ahamed via R-help wrote: Hi, i got an error while i am running a big data. Error has explained by the following sample sample This is an error in the package, and should be reported to the maintainer. Discover the maintainer with the command

Re: [R] Is there orphan code in seq.default?

2015-08-15 Thread Martin Morgan
] sea which is the case for seq.default args(seq.default) function (from = 1, to = 1, by = ((to - from)/(length.out - 1)), length.out = NULL, along.with = NULL, ...) Martin Morgan -- Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA

Re: [R] Release schedule (was (no subject) )

2015-08-05 Thread Martin Morgan
On 08/05/2015 10:08 AM, Jeff Newmiller wrote: New versions are released when they are ready. This is volunteer-driven software. From https://developer.r-project.org/ : The overall release schedule is to have annual x.y.0 releases in Spring, with patch releases happening on an as-needed

Re: [R] writing binary data from RCurl and postForm

2015-08-05 Thread Martin Morgan
On 08/05/2015 11:52 AM, Greg Donald wrote: I'm using RCurl with postForm() to post to a URL that responds with a PDF. I cannot figure out how to write the resulting PDF data to a file without corruption. result = postForm(url, binary=TRUE) Both this: capture.output(result,

Re: [R] Error when compiling R-2.5.1 / *** [d-p-q-r-tests.Rout] Fehler 1

2015-08-01 Thread Martin Morgan
take out the middleman ? Martin Morgan But after doing make check I get comparing 'method-dispatch.Rout' to './method-dispatch.Rout.save' ... OK running code in 'd-p-q-r-tests.R' ...make[3]: *** [d-p-q-r-tests.Rout] Fehler 1 make[3]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird

Re: [R] S4 / operator [ : Compatibility issue between lme4 and kml

2015-06-06 Thread Martin Morgan
On 06/05/2015 10:52 AM, Martin Maechler wrote: Christophe Genolini cgeno...@u-paris10.fr on Fri, 5 Jun 2015 00:36:42 -0700 writes: Hi all, There is a compatibility issue between the package 'lme4' and my package 'kml'. I define the [ operator. It works just fine in my

Re: [R] is.na for S4 object

2015-06-04 Thread Martin Morgan
On 06/04/2015 10:08 AM, cgenolin wrote: Hi the list, I have a variable y that is either NA or some S4 object. I would like to know in which case I am, but it seems taht is.na does not work with S4 object, I get a warnings: --- 8 setClass(myClass,slots=c(x=numeric))

Re: [R] Can't seem to install packages

2015-05-28 Thread Martin Morgan
On 05/28/2015 08:21 AM, Duncan Murdoch wrote: On 28/05/2015 6:10 AM, Claire Rioualen wrote: Hello, I can't seem to install R packages, since it seemed there were some permission problems I chmoded /usr/share/R/ and /usr/lib/R/. However, there are still errors in the process. Here's my config:

Re: [R] Help manipulating 23andme data in R - reproducing relationship results

2015-05-17 Thread Martin Morgan
/2012/03/12/23andme-gwascat.html which is a little dated and maybe not relevant to your question. A little tangentially, see also https://support.bioconductor.org/p/67444/ Martin Morgan On 18 May 2015 at 03:04, Bert Gunter gunter.ber...@gene.com wrote: (No response necessary) What struck

Re: [R] some general advice sought on the use of gctorture()

2015-04-24 Thread Martin Morgan
://bioconductor.org/developers/how-to/c-debugging/#case-study Of course this might lead to nothing, and then you'll be back to your original question about using gctorture or other strategies. Martin Morgan I have already undertaken several attempts to debug the C++ code with gdb(), but until now I have been

Re: [R] Returning to parent function

2015-03-17 Thread Martin Morgan
On 03/16/2015 05:05 PM, Saptarshi Guha wrote: Example was complicated, but here is a simpler form continueIfTrue - function(mm=return()){ eval(mm) } telemStats - function(){ y - substitute(return()) continueIfTrue(y) print(I would not like this message to be printed) }

Re: [R] Checking whether specific packages (from bioconductor) are installed when loading a package

2015-03-11 Thread Martin Morgan
On 03/11/2015 01:36 AM, Søren Højsgaard wrote: Dear all, My package 'gRbase' uses three packages from Bioconductor and these are not automatically installed when gRbase is installed. My instructions (on the package webpage) to users are therefore to run: Treat Bioconductor packages as any

Re: [R] Installing GO.db Package in R

2015-03-05 Thread Martin Morgan
On 03/05/2015 01:21 AM, Zaynab Mousavian wrote: Hi all, I have tried to install GO.db package in R, but the following error is please ask questions about Bioconductor packages on the Bioconductor support forum https://support.bioconductor.org. Please also review answers to your question on

Re: [R] character type and memory usage

2015-01-17 Thread Martin Morgan
On 01/16/2015 10:21 PM, Mike Miller wrote: First, a very easy question: What is the difference between using what=character and what=character() in scan()? What is the reason for the character() syntax? I am working with some character vectors that are up to about 27.5 million elements long.

Re: [R] Fwd: which is faster for or apply

2014-12-31 Thread Martin Morgan
to coerce I would use the approach cidx - sapply(df, is.character) # index of columns to coerce df[cidx] - lapply(df[cidx], as.numeric) which seems to be reasonably correct, expressive, compact, and speedy. Martin Morgan Ô__ c/ /'_;kmezhoud (*) \(*) ⴽⴰⵔⵉⵎ ⵎⴻⵣⵀⵓⴷ http

Re: [R] RCurl much faster than base R

2014-12-09 Thread Martin Morgan
mirror from http://bioconductor.org/about/mirrors/, e.g., chooseBioCmirror() Martin Morgan Bioconductor AlexG __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] need help with withRestarts ?

2014-12-06 Thread Martin Morgan
On 12/06/2014 02:53 PM, ce wrote: Dear all, Let's say I have this script , below. tryCatch indeed catches the error but exists, I want function to continue and stay in the loop. I found very examples of withRestarts on internet to figure it out. Could you help me how to do it ? myfunc -

Re: [R] recoding genetic information using gsub

2014-12-05 Thread Martin Morgan
. -- Dr. Martin Morgan, PhD Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Profiling a C/C++ library from R

2014-12-02 Thread Martin Morgan
-devel mailing list http://www.r-project.org/posting-guide.html#which_list) Martin Morgan Best, Charles -- Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793

Re: [R] cyclic dependency when building a package

2014-11-30 Thread Martin Morgan
this; maybe you meant something like .foo - function(x, ...) {} setGeneric(foo, function(x, ...) standardGeneric(foo), useAsDefault=.foo) or simply reversing the order of the declarations foo - function(x, ...) {} setGeneric(foo, function(x, ...) standardGeneric(foo)) ? Martin Morgan

Re: [R] Gender balance in R

2014-11-25 Thread Martin Morgan
. Martin Morgan Bioconductor Note also on that tweet that Gabriela de Queiroz posted it, who is the founder of R-ladies; and that David Smith showed interest in discussing the topic. So there is definitely demand for some data analysis and discussion on the topic. It would be interesting

Re: [R] Reading FCS files with flowCore package

2014-11-24 Thread Martin Morgan
On 11/24/2014 06:18 AM, Luigi wrote: Dear all, I would like to use the R's Bioconductor package flowCore to do flow cytometry Please address questions about Bioconductor packages to the Bioconductor support site https://support.bioconductor.org and... analysis. I generated a FCS file

Re: [R] Reading FCS files with flowCore package

2014-11-24 Thread Martin Morgan
command waiting for the user to type something into standard input (because scan() and others treat file= the same as scan=stdin()). Bill Dunlap TIBCO Software wdunlap tibco.com http://tibco.com On Mon, Nov 24, 2014 at 10:36 AM, Martin Morgan mtmor...@fredhutch.org mailto:mtmor...@fredhutch.org wrote

Re: [R] Problem on annotation of Deseq2 on reportingtools

2014-11-16 Thread Martin Morgan
On 11/16/2014 10:25 AM, jarod...@libero.it wrote: Dear all!, I use this code: dds - DESeq(ddHTSeq) res -results(dds) #reporting library(ReportingTools) library(org.Hs.eg.db) des2Report - HTMLReport(shortName ='RNAseq_analysis_DESeq2.html',title ='RNA-seq analysis of differential expression

Re: [R] snow/Rmpi without MPI.spawn?

2014-09-04 Thread Martin Morgan
is progress. I'm just not sure is that expected behavior for parSupply or not. Jim -Original Message- From: Martin Morgan [mailto:mtmor...@fhcrc.org] Sent: Wednesday, September 03, 2014 5:08 PM To: Leek, Jim; r-help@r-project.org Subject: Re: [R] snow/Rmpi without MPI.spawn? On 09/03

Re: [R] snow/Rmpi without MPI.spawn?

2014-09-03 Thread Martin Morgan
On 09/03/2014 03:25 PM, Jim Leek wrote: I'm a programmer at a high-performance computing center. I'm not very familiar with R, but I have used MPI from C, C++, and Python. I have to run an R code provided by a guy who knows R, but not MPI. So, this fellow used the R snow library to

Re: [R] How should I do GO enrichment of differential expressed miRNA?

2014-08-29 Thread Martin Morgan
On 08/28/2014 11:47 PM, my1stbox wrote: Hi all, First, I carried out GO enrichment to predicted/validated target genes of those miRNA using GOstats package. Then I find myself in a dead end. So what is the good practice? Is it possible to directly do GO enrichment to miRNAs? Are they included

Re: [R] dev-lang/R-3.1.0: biocLite(vsn) removes all files in /

2014-05-19 Thread Martin Morgan
the as-root bit). A warn-off on R-help seems entirely warranted. Good to see that Martin Morgan is taking the issue very seriously in his post below. As a non-BioC user using BioC packages I've always wondered why the standard R functionality isn't enough. Can someone, please, tell me why 'biocLite

Re: [R] dev-lang/R-3.1.0: biocLite(vsn) removes all files in /

2014-05-18 Thread Martin Morgan
This would be very bad and certainly unintended if it were the responsibility of biocLite. Can we communicate off-list about this? In particular can you report noquote(readLines(http://bioconductor.org/biocLite.R;)) ? Martin Morgan On 05/17/2014 10:16 PM, Juergen Rose wrote: I had

Re: [R] flowDensity package

2014-04-09 Thread Martin Morgan
On 04/09/2014 07:23 AM, Raghu wrote: I am unable to install flowDensity package from bioconductor in R version 3.0 or 3.1. did anyone have the same problems with this. Please ask questions about Bioconductor packages on the Bioconductor mailing list

Re: [R] memory use of copies

2014-01-27 Thread Martin Morgan
Hi Ross -- On 01/23/2014 05:53 PM, Ross Boylan wrote: [Apologies if a duplicate; we are having mail problems.] I am trying to understand the circumstances under which R makes a copy of an object, as opposed to simply referring to it. I'm talking about what goes on under the hood, not the user

Re: [R] Error in dispersionPlot using cummeRbund

2014-01-05 Thread Martin Morgan
Hi Nancy -- cummeRbund is a Bioconductor package so please ask questions about it on the Bioconductor mailing list. http://bioconductor.org/help/mailing-list/mailform/ Be sure to include the maintainer packageDescription(cummeRbund)$Maintainer in the email. You have the 'latest' version

Re: [R] S4; Setter function is not chaning slot value as expected

2013-11-10 Thread Martin Morgan
. If instead of a single account you modelled 'Accounts', i.e., all accounts, then updating 1000 account id's would only make one copy, whereas if you model each account separately this would require 1000 copies. Martin thanks.. On Sat, Nov 9, 2013 at 4:20 PM, Martin Morgan mtmor...@fhcrc.org

Re: [R] S4; Setter function is not chaning slot value as expected

2013-11-10 Thread Martin Morgan
On 11/09/2013 11:31 PM, Hadley Wickham wrote: Modelling a mutable entity, i.e. an account, is really a perfect example of when to use reference classes. You might find the examples on http://adv-r.had.co.nz/OO-essentials.html give you a better feel for the strengths and weaknesses of R's

Re: [R] S4; Setter function is not chaning slot value as expected

2013-11-09 Thread Martin Morgan
On 11/09/2013 06:31 AM, daniel schnaider wrote: It is my first time programming with S4 and I can't get the setter fuction to actually change the value of the slot created by the constructor. I guess it has to do with local copy, global copy, etc. of the variable - but, I could't find anything

Re: [R] S4 vs S3. New Package

2013-11-09 Thread Martin Morgan
on implementation, updating S3 objects could as easily trigger copies; this is a fact of life in R. Mitigate by modelling objects in a vector (column)-oriented approach rather than the row-oriented paradigm of Java / C++ / etc. Martin Morgan 2) Documentation. It has been really hard to find

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

2013-11-01 Thread Martin Morgan
On 11/01/2013 08:22 AM, Magnus Thor Torfason wrote: Sure, I was attempting to be concise and boiling it down to what I saw as the root issue, but you are right, I could have taken it a step further. So here goes. I have a set of around around 20M string pairs. A given string (say, A) can

Re: [R] S4 base class

2013-10-17 Thread Martin Morgan
On 10/17/2013 08:54 AM, Michael Meyer wrote: Suppose you have a base class Base which implements a function Base::F which works in most contexts but not in the context of ComplicatedDerived class where some preparation has to happen before this very same function can be called. You would

Re: [R] how to merge GRange object?

2013-10-16 Thread Martin Morgan
On 10/16/2013 06:32 AM, John linux-user wrote: Hello everyone, I am wondering how to simply merge two GRanges objects by range field and add the value by additional vector. For example, I have two objects below Hi -- GRanges is from a Bioconductor package, so please ask on the Bioconductor

Re: [R] Bioconductor / AnnotationDbi: Why does a GOAllFrame contain more rows than its argument GoFrame?

2013-10-02 Thread Martin Morgan
On 10/02/2013 09:28 AM, Asis Hallab wrote: Dear Bioconductor Experts, This will be responded to on the Bioconductor mailing list; please address any follow-ups there. http://bioconductor.org/help/mailing-list/ Martin thank you for providing such a useful tool-set. I have a question

Re: [R] EdgeR annotation

2013-08-25 Thread Martin Morgan
On 08/24/2013 04:50 AM, Robin Mjelle wrote: after updating R and edgeR I lost the annotations in the final Diff.Expressed matrix (toptags) when running the edgeR pipeline. How do I get the row.names from the data matrix into the topTag-matrix? data -

Re: [R] Method dispatch in S4

2013-08-09 Thread Martin Morgan
can I find the source code? Best Simon On Aug 8, 2013, at 10:00 PM, Martin Morgan mtmor...@fhcrc.org wrote: On 08/04/2013 02:13 AM, Simon Zehnder wrote: So, I found a solution: First in the initialize method of class C coerce the C object into a B object. Then call the next method

Re: [R] Method dispatch in S4

2013-08-08 Thread Martin Morgan
On 08/04/2013 02:13 AM, Simon Zehnder wrote: So, I found a solution: First in the initialize method of class C coerce the C object into a B object. Then call the next method in the list with the B class object. Now, in the initialize method of class B the object is a B object and the respective

Re: [R] Check the class of an object

2013-07-23 Thread Martin Morgan
On 07/23/2013 09:59 AM, Simon Zehnder wrote: Hi David, thanks for the reply. You are right. Using the %in% is more stable and I gonna change my code. you said you were you were using S4 classes. S4 classes do not report vectors of length != 1, from ?class For objects which have a

Re: [R] 'save' method for S4 class

2013-07-18 Thread Martin Morgan
On 07/18/2013 03:47 AM, Simon Zehnder wrote: Hi Christopher, I think, that save is no generic function like plot, show, etc. So at first you have to determine a generic. setGeneric(save, function(x, file_Path) standardGeneric(save)) The implementation offered by Christofer shows

Re: [R] Setting Derived Class Slots

2013-07-16 Thread Martin Morgan
On 07/16/2013 06:36 AM, Steve Creamer wrote: Dear AllI am really struggling with oo in R. Trying to set attributes of the base class in a derived class method but the slot is only populated in the method itself, not when I try to print out the object from the console. Code is

Re: [R] suppress startup messages from default packages

2013-07-15 Thread Martin Morgan
On 07/15/2013 06:25 AM, Duncan Murdoch wrote: On 15/07/2013 8:49 AM, Andreas Leha wrote: Hi Helios, Helios de Rosario helios.derosa...@ibv.upv.es writes: Hi all, several packages print messages during loading. How do I avoid to see them when the packages are in the defaultPackages?

Re: [R] Check a list of genes for a specific GO term

2013-07-08 Thread Martin Morgan
I want to retain only those annotations which annotate less than a specified number of genes. (say 1000 genes) I hope I have put it clearly. sorry again. Thanks! On Sun, Jul 7, 2013 at 6:55 AM, Martin Morgan mtmor...@fhcrc.org wrote: In Bioconductor, install the annotation

Re: [R] Check a list of genes for a specific GO term

2013-07-07 Thread Martin Morgan
In Bioconductor, install the annotation package http://bioconductor.org/packages/release/BiocViews.html#___AnnotationData corresponding to your chip, e.g., source(http://bioconductor.org/biocLite.R;) biocLite(hgu95av2.db) then load it and select the GO terms corresponding to your probes

  1   2   3   4   5   6   >