Given I have a zoo dataset, I'd like to perform a sliding operation against it with the result being another zoo dataset.
> x
Y
(09/24/09 08:00:13) 3.1
(09/24/09 08:05:13) 4.2
(09/24/09 08:10:13) 4.5
(09/24/09 08:15:13) 9.4
(09/24/09 08:20:13) 9.8
(09/24/09 08:25:13) 7.7
(09/24/09 08:30:13) 13.3
(09/2...
Hello all.
I am a devoted R (r-project.org) user, and love infographics.
I just came across this article:
http://www.noupe.com/design/fantastic-information-architecture-resources.html
Giving a long list of resources for information designers.
And it raised in me the desire to do more beautiful (not just informative) R plots.
Do you have...
Is it possible to use a TTF font in R? Is the cairo package intended for this task? How would a minimal example look like?
...
I'm trying to alter the functionality of a few commands in a package in R. It's easy enough to see the source of the commands. However the function calls other functions that are in the package namespace. These functions are not exported objects. So how can I access them?
specific example:
How would I access the asCall() function that i...
The following R commands will install all CRAN packages:
availablePackages <- available.packages()[,1]
install.packages(availablePackages)
And the following command will list all installed packages:
installedPackages <- .packages(all.available = TRUE)
My question is: How do I instruct R to install all CRAN packages that are not alr...
When installing R packages (say mcmcpack in this example) under Ubuntu I have the choice between the following two methods of installation:
# Let the distribution's packaging system take care of installation/upgrades
apt-get install r-cran-mcmcpack
# Let R take care of installation/upgrades
install.packages("mcmcpack")
Questions:
I...
How can I view the definition of a S4 function? For instance, I would like to see the definition of TSconnect in package TSdbi. The command
showMethods("TSconnect")
reveals that there is, among others, a function for drv="histQuoteDriver", dbname="character".
How can I see the definition of this function? If it were a S3 function, th...
Hello,
my R code ends up containing plethora of statements of the form:
if (!is.null(aVariable)) {
do whatever
}
But this kind of statement is hard to read because it contains two negations. I would prefer something like:
if (is.defined(aVariable)) {
do whatever
}
Does a is.defined type function that does the oppo...
What's the best way to call R functionality from within Java?
I'm looking for a quick, easy and reliable way to make standard 2d scatter plots and histograms in R using my Java applications. I was wondering which packages/interfaces that came up in a quick Google search would be most convenient to use.
I look forward to your suggesti...
Is there some way to use a specific small image as a point in a scatterplot with ggplot2. Ideally I will want to resize the images based on an variable.
Here's an example:
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point(aes(size = qsec, shape = factor(cyl)))
So I basically want to know if there is a way to supply a...
I'm using R to call a mySQL statement, where I define the variable outside the statement e.g.
foo = 23;
dbGetQuery(con, "select surname from names WHERE age = '.foo.' ;")
But this returns an empty set, I've googled around and tried'.&foo.' ".foo." '".&&foo."'
and many different combinations, but none of them work, I think this s...
At some point in my script I like to see the number of missing values
in my data.frame and display them.
In my case I have:
out <- read.csv(file="...../OUT.csv", na.strings="NULL")
sum(is.na(out$codeHelper))
out[is.na(out$codeHelper),c(1,length(colnames(out)))]
It works perfectly fine.
However, the last command obviously gives me th...
I have some trouble to convert my data.frame from a wide table to a long table.
At the moment it looks like this:
Code Country 1950 1951 1952 1953 1954
AFG Afghanistan 20,249 21,352 22,532 23,557 24,555
ALB Albania 8,097 8,986 10,058 11,123 12,246
Now I like to transform this data.frame into a ...
I'm working on a project now that's rather unlike anything I've done before. I have two tests with binary results that will be administered to the same sample, which is drawn from a clustered population (i.e., some subjects will be from the same family). I'd like to compare proportions of positive test results, but the clustering makes...
In R's DBI package, I'm not finding a facility for using bound variables. I did find a document (the original vignette from 2002) that says about bound variables, "Perhaps the DBI could at some point in the future implement this feature", but it looks like so far that's left undone.
What do people in R use for a substitute? Just conca...
Basically I want an autoincremented id column based on my cohorts - in this case .(kmer, cvCut)
> myDataFrame
size kmer cvCut cumsum
1 8132 23 10 8132
10000 778 23 10 13789274
30000 324 23 10 23658740
50000 182 23 10 28534840
100000 65 23 10 33943283
200000 25 23 10 37954383
...
I have data points that represent a logarithmic function.
Is there an approach where I can just estimate the function that describes this data using R?
Thanks.
...
I want to show a block ascii character in R █ (its ascii code is 219)
How can I show it in terminal?
I am using RGui on WinXP
...
I previously asked this question which was useful in plotting a function. I want to try and plot twenty functions on the same axes to illustrate how a function varies between two ranges. I have successfully done this using individually specified functions, but I wanted to do this using a loop.
What I have attempted doing is:
## add gg...
Hi there,
I've been looking around for some data about naming trends in USA. I managed to get top 1000 names for babies born in 2008. The data is formated in this manor:
male.name n.male female.name n.female
Jacob 22272 Emma 18587
Michael 20298 Isabella 18377
Ethan 20004 Emily 17217
Joshua 18924 Madison 16853
Daniel 18717 Ava 168...