similar to: Batch replacement, by factor, of values in a data frame

Displaying 20 results from an estimated 10000 matches similar to: "Batch replacement, by factor, of values in a data frame"

2009 Feb 18
2
Counting/processing a character vector
Dear List, I have a data set stored in the following format: > head(dat, n = 10) id sppcode abundance 1 10307 10000000 1 2 10307 16220602 2 3 10307 20000000 5 4 10307 20110000 2 5 10307 24000000 1 6 10307 40210000 83 7 10307 40210102 45 8 10307 45140000 1 9 10307 45630000 1 10 10307 45630600 41 >
2010 Jan 19
5
OT: Software for specific visualisation of data...ideas?
Dear List, A student in the Department where I work would like to produce a graphic similar to this one: http://image.guardian.co.uk/sys-files/Guardian/documents/2009/09/16/Public_spending_160909.pdf Does anyone know if the figure in the pdf can be generated in a specific software application for example? Any suggestions would be most gratefully received by the student concerned. Many thanks,
2013 Jan 16
1
R CMD check not reading R_LIBS from ~/.R/check.Renviron
Dear List, Further to my earlier email, I note that, for me at least, R CMD check is *not* reading R_LIBS from ~/.R/check.Renviron on R 2.15.2 patched (r61228) and R Under Development (r61660). The only way I can get R CMD check to look for packages in a user-supplied library is by explicitly exporting R_LIBS set to the relevant directory. R CMD build *does* read R_LIBS from ~/.R/build.Renviron
2008 Feb 25
1
r44608 fails make check-all in scatter.smooth example
Dear List, Having had my appetite sufficiently whetted by Prof. Ripley's email about the new graphics capabilities in Unixes, I wanted to try them out. I updated to svn r44608, configured with the following options: R is now configured for x86_64-unknown-linux-gnu Source directory: .. Installation directory: /usr/local C compiler: gcc -O3 -g -std=gnu99
2011 Jan 27
1
Minor typo in influence.measures.Rd ?
Dear list, There is, I believe, a minor typo in the example section of influence.measures.Rd. In the final example the word `does` appears where I suspect `dose` is required: I couldn't remember exactly what format patches should be in, so here is one as diff would produce: Index: devel/src/library/stats/man/influence.measures.Rd
2009 Aug 28
1
Plotmath, sweave and lattice graphics interaction problem
Dear List, I have hit this problem with using a plotmath expression in an axis label on a lattice plot I'm including in a Sweave document. The actual document is far too long and boring (unless you are interested in the hydrochemistry of upland lakes) to include here, but the following minimal example reproduces the problem; basically, the PDF produced by Sweave has missing characters in the
2008 Apr 12
1
2.7.0 beta (rev 45263) failing 'make vignettes'
Dear list, On Fedora 8 I downloaded the beta version of R via svn. make and make check-all worked fine, but make vignettes is failing with: make[1]: Entering directory `/home/gavin/R/2-7-patched/build/src/library' building/updating vignettes for package 'grid' ... processing 'displaylist.Snw' /usr/bin/texi2dvi: pdflatex exited with bad status, quitting. Error in
2009 May 09
1
Improve aggregate.default ...?
Hi, I find it a bit annoying that aggregate.default forces the returned object to loose the 'name' of the variable aggregated, replacing it with 'x'. A brief example: > dat <- data.frame(A = runif(100), B = rnorm(100), + Group = gl(4, 25)) > with(dat, aggregate(A, by = list(Group = Group), FUN = mean)) Group x 1 1 0.6523228 2 2
2013 Jan 16
1
Trouble building package using R in development
Dear List, I'm having considerable trouble setting up my environment (Linux, Fedora 16, Bash) to build and check packages under R Under Development (r61660). I'm doing this to better get a handle on difference in the output from running checks on examples in one of my packages. Note I compiled R Under Development myself The problem I am now having is whenever I try to build my analogue
2011 Apr 05
1
Inconsistency between rowMeans documentation and reality?
Dear List, I'm not even sure this is an issue or not, but ?rowMeans has: Value: A numeric or complex array of suitable size, or a vector if the result is one-dimensional. The ?dimnames? (or ?names? for a vector result) are taken from the original array. If there are no values in a range to be summed over (after removing missing values with ?na.rm = TRUE?), that
2009 Jun 05
1
Bug in print.Arima and patch
Dear List, A posting to R-Help exposed this problem with the print method for objects of class Arima: > set.seed(1) > x <- arima.sim(n = 100, list(ar = 0.8897, ma = -0.2279)) > mod <- arima(x, order = c(1,0,1)) > coefs <- coef(mod) > mod2 <- arima(x, order = c(1,0,1), fixed = coefs) > mod2 Call: arima(x = x, order = c(1, 0, 1), fixed = coefs) Coefficients: Error
2009 Jan 13
1
Missing links on Windows and \link[bar]{foo}; clarification
Dear List, In one of my packages on R-Forge I have a custom panel function for Lattice graphics. In the Rd file for this panel function I want to provide links to some lattice functions (in package lattice). My first instinct was to use: \code{\link[lattice]{panel.xyplot}} for example. However, I missed a few references to lattice functions and just marked them up as \code{\link{panel.xyplot}}.
2012 Feb 20
1
Controlling simplification in apply()?
Dear list, Fully according to the documented behaviour, I was bitten by apply() simplifying results to vectors or arrays when the lengths of the individual objects returns by FUN are the same (over simplification). sapply() has argument simplify with default TRUE to control whether it attempts to simplify the returned objects or not. I do find it a little annoying that one is not able to force
2008 Jun 21
2
Generating groupings of ordered observations
Dear List, I have a problem I'm finding it difficult to make headway with. Say I have 6 ordered observations, and I want to find all combinations of splitting these 6 ordered observations in g groups, where g = 1, ..., 6. Groups can only be formed by adjacent observations, so observations 1 and 4 can't be in a group on their own, only if 1,2,3&4 are all in the group. For example,
2006 Oct 04
2
Status of R 2.4.0 in svn repository and R-Admin manual
Dear list, I have been using and testing the alpha/betas of R 2.4.0, sources for which I got from svn.r-project.org/R/branches/R-2-4-branch, and which I compiled on my Fedora Core 5 machine. No problems there. I have just updated the source tree today and re-compiled - which also works just fine. When run, this gives: R version 2.4.0 Patched (2006-10-03 r39576) So I assume from that, that I am
2011 Mar 27
1
Bug in tools::compactPDF() in 2.13-0-alpha
Dear List, There seems to be an bug in compactPDF() or at least an inconsistency with the documented behaviour. The documentations states: Details: This by default makes use of ?qpdf?, available from <URL: http://qpdf.sourceforge.net/>, including a Windows binary. If ?gs_cmd? is non-empty, GhostScript is used. I don't have qpdf on my system so planned to use
2008 Feb 04
1
Processing dates and generating sequences of dates
hits=-2.6 tests=BAYES_00 X-USF-Spam-Flag: NO Dear List, Say I have the following sequence of dates [*]: start <- as.Date("2005-01-05", format = "%Y-%d-%m") end <- as.Date("2007-10-07", format = "%Y-%d-%m") my.dates <- seq(start, end, by = "days") What I would like to generate is a sequence of dates, by month that goes from the first
2009 Sep 09
2
"predict"-fuction for metaMDS (vegan)
Dear r-Community, Step1: I would like to calculate a NMDS (package vegan, function metaMDS) with species data. Step2: Then I want to plot environmental variables over it, using function envfit. The Problem: One of these environmental variables is cos(EXPOSURE). But for flat releves there is no exposure. The value is missing and I can't call it 0 as 0 stands for east and west. Therefore I
2009 Aug 08
2
Problem using model.frame with argument subset in own function
Dear List, I am writing a formula method for a function in a package I maintain. I want the method to return a data.frame that potentially only contains some of the variables in 'data', as specified by the formula. The problem I am having is in writing the function and wrapping it around model.frame. Consider the following data frame: dat <- data.frame(A = runif(10), B = runif(10), C
2007 Jun 23
2
Names of objects passed as ... to a function?
Dear list, I have a function whose first argument is '...'. Each element of '...' is a data frame, and there will be at least 2 data frames in '...'. The function processes each of the data frames in '...' and returns a list, whose components are the processed data frames. I would like to name the components of this returned list with the names of the original data