[Rd] requesting a mentor for R development
I'd like to learn the process of revising R functions & packages and then submitting proposed patches to the R Core team. Would someone be willing to mentor me through one example? For starters, consider an example. I'd like to revise the t.test function to return the stderr value to the user. We only need to change the "rval" in the third-from-the end line of stats:::t.test.default. Change this: rval <- list(statistic = tstat, parameter = df, p.value = pval, conf.int = cint, estimate = estimate, null.value = mu, alternative = alternative, method = method, data.name = dname) class(rval) <- "htest" return(rval) To this: rval <- list(statistic = tstat, parameter = df, stderr=stderr, p.value = pval, conf.int = cint, estimate = estimate, null.value = mu, alternative = alternative, method = method, data.name = dname) class(rval) <- "htest" return(rval) Here is where I need help. 1. What other changes in the R code & documents would be required for consistency? 2. How does R Core Team expect/accept patches? I do understand a bit about SVN and CVS. I think I could mark this up and make a diff, but I'm uncertain about the details. 3. How would I best prepare a suggestion like this so as to get it accepted into R? If somebody will raise a hand, I'm willing to do the work to learn. pj -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] arbitrary size data frame or other stcucts, curious about issues invovled.
Mike, Neither bigmemory nor ff are "drop in" solutions -- though useful, they are primarily for data storage and management and allowing convenient access to subsets of the data. Direct analysis of the full objects via most R functions is not possible. There are many issues that could be discussed here (and have, previously), including the use of 32-bit integer indexing. There is a nice section "Future Directions" in the R Internals manual that you might want to look at. Jay - Original message: We keep getting questions on r-help about memory limits and I was curious to know what issues are involved in making common classes like dataframe work with disk and intelligent swapping? That is, sure you can always rely on OS for VM but in theory it should be possible to make a data structure that somehow knows what pieces you will access next and can keep thos somewhere fast. Now of course algorithms "should" act locally and be block oriented but in any case could communicate with data structures on upcoming access patterns, see a few ms into the future and have the right stuff prefetched. I think things like "bigmemory" exist but perhaps one issue was that this could not just drop in for data.frame or does it already solve all the problems? Is memory management just a non-issue or is there something that needs to be done to make large data structures work well? -- John W. Emerson (Jay) Associate Professor of Statistics Department of Statistics Yale University http://www.stat.yale.edu/~jay __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Quote the path of graphics output in Sweave when it contains spaces
Hi, I'm aware of the definition of a "valid filename" in .SweaveValidFilenameRegexp, but I think it might be better to quote the filename when it contains spaces instead of just giving a warning. This should bring us safer LaTeX code (although I never use spaces in paths). Here is the simple patch: Index: src/library/utils/R/SweaveDrivers.R === --- src/library/utils/R/SweaveDrivers.R (revision 56193) +++ src/library/utils/R/SweaveDrivers.R (working copy) @@ -390,6 +390,8 @@ } if (options$include) { +if (grepl("[[:space:]]", chunkprefix)) +chunkprefix = shQuote(chunkprefix, type = "cmd") cat("\\includegraphics{", chunkprefix, "}\n", sep = "", file = object$output) linesout[thisline + 1L] <- srcline Thanks! Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Quote the path of graphics output in Sweave when it contains spaces
On 11-06-20 5:57 PM, Yihui Xie wrote: Hi, I'm aware of the definition of a "valid filename" in .SweaveValidFilenameRegexp, but I think it might be better to quote the filename when it contains spaces instead of just giving a warning. This should bring us safer LaTeX code (although I never use spaces in paths). That works in MikTeX 2.9's version of pdflatex, but not in latex. I imagine in 5 years it's possible all the different latex versions will consistently handle quotes, but it hasn't happened yet. Duncan Murdoch Here is the simple patch: Index: src/library/utils/R/SweaveDrivers.R === --- src/library/utils/R/SweaveDrivers.R (revision 56193) +++ src/library/utils/R/SweaveDrivers.R (working copy) @@ -390,6 +390,8 @@ } if (options$include) { +if (grepl("[[:space:]]", chunkprefix)) +chunkprefix = shQuote(chunkprefix, type = "cmd") cat("\\includegraphics{", chunkprefix, "}\n", sep = "", file = object$output) linesout[thisline + 1L]<- srcline Thanks! Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel