Displaying 20 results from an estimated 20 matches for "round_any".
2008 Jan 14
6
Ceiling to the nearest ten?
R-users,
Is there a function for ceiling to the nearest ten?
a <- 1:10*4
a
[1] 4 8 12 16 20 24 28 32 36 40
The resulting vector should look like this ("ceiling to the nearest ten")
[1] 10 10 20 20 20 30 30 40 40 40
Thanks in advance
Lauri
2010 Mar 31
1
ggplot2: Adding points to a density plot
Hi,
Consider something like
> library(ggplot2)
> movies$decade <- round_any(movies$year, 10)
> m <- qplot(rating,data=movies,colour=factor(decade),geom="density")
> m
(modified from "?stat_density").
I'd like to add on the line y=0 a dot for the median of each "decade"
category (using the same colour coding as the "fill&quo...
2011 Dec 20
1
column permutation of sparse matrix
Hi,
I'm very new to working with sparse matrices and would like to know how I
can column permute a sparse matrix. Here is a small example:
> M1 <-
> spMatrix(nrow=5,ncol=6,i=sample(5,15,replace=TRUE),j=sample(6,15,replace=TRUE),x=round_any(rnorm(15,2),0.001))
> M1
5 x 6 sparse Matrix of class "dgTMatrix"
[1,] 2.983 . 1.656 5.003 . .
[2,] . . 2.990 . . .
[3,] . 0.592 5.349 1.115 . .
[4,] 1.836 . 2.804 . . ....
2010 Nov 10
1
ggplot2 problem in interacting mode
Hi all,
When running R interactively, I have the problem as following:
> library(ggplot2)
Loading required package: reshape
Loading required package: plyr
Attaching package: 'reshape'
The following object(s) are masked from 'package:plyr':
round_any
Loading required package: grid
Loading required package: proto
> data(VADeaths)
> pg <- ggplot(melt(VADeaths), aes(value, X1)) + geom_point() +
+ facet_wrap(~X2) + ylab("")
> print(pg)
Error in get("transform", env = ., inherits = TRUE)(., ...) :
attempt to apply...
2009 Apr 30
2
gridding values in a data frame
Hi all,
I have a data frame that looks like such:
LATITUDE LONGITUDE TEMPERATURE TIME
36.73 -176.43 58.32 1
50.95 90.00 74.39 1
-30.42 5.45 23.26 1
15.81 -109.31 52.44 1
-80.75 -144.95 66.19 2
90.00 100.55 37.50 2
2012 Feb 01
1
ggplot2(0.9.0): could not find function "=="
...h 0.9.0.
I just want to figure out how to fix the blog example, and then make
the same changes to my own work.
So this is the output:
> library(ggplot2)
> library(plyr)
> library(reshape)
Attaching package: ?reshape?
The following object(s) are masked from ?package:plyr?:
rename, round_any
> trade <- read.csv("http://pastie.org/pastes/629247/download", header = TRUE, stringsAsFactors = FALSE)
> balance <- ddply(trade, .(Time), summarise, balance = sum(EXP - IMP))
> trade.m <- melt(trade, id.vars = c("BEC", "Time"))
> ggplot(trade.m,...
2012 Jan 09
2
[R] fix and edit don't work: unable to open X Input
...hether I get the segfault problem.) My sessioninfo() is
reporting additional information about namespace imports:
> library(ggplot2)
Loading required package: reshape
Loading required package: plyr
Attaching package: ?reshape?
The following object(s) are masked from ?package:plyr?:
rename, round_any
Loading required package: grid
Loading required package: proto
> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: i686-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8
[5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8
[7...
2011 Mar 16
1
object not found whilst loading namespace
...-Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Resources/library/caret/libs/x86_64
** R
** data
** inst
** preparing package for lazy loading
Loading required package: plyr
Attaching package: 'reshape'
The following object(s) are masked from 'package:plyr':
round_any
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
Error : object 'confusionMatrix' not found whilst loading namespace 'caret'
ERROR: loading failed
* removing ?/Library/Frameworks/R.framework/Resources/library/caret?
*...
2009 Jan 24
2
ggplot2 - how to change location / position of wind rose axis labels?
...d Kingdom.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
base
other attached packages:
[1] ggplot2_0.8.1 reshape_0.8.2 plyr_0.1.4 proto_0.3-8
#Using an example form the coord_polar help
library(ggplot2)
movies$rrating <- factor(round_any(movies$rating, 1))
movies$budgetq <- factor(chop(movies$budget, 4), labels = 1:4)
doh <- ggplot(movies, aes(x = rrating, fill = budgetq))
doh + geom_bar(width = 1) + coord_polar()
#Now with my theme (hacked from theme_bw) getting close to what I need
theme_bwdn<-function (base_size = 12)...
2010 Sep 10
0
plyr: version 1.2
...pply directly to avoid all the
overhead associated with those unused extra features.
* llply: in serial case, for loop replaced with custom C function that takes
about 40% less time (or about 20% less time than lapply). Note that as a
whole, llply still has much more overhead than lapply.
* round_any now lives in plyr instead of reshape
BUG FIXES
* list_to_array works correct even when there are missing values in the array.
This is particularly important for daply.
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
________...
2010 Sep 10
0
plyr: version 1.2
...pply directly to avoid all the
overhead associated with those unused extra features.
* llply: in serial case, for loop replaced with custom C function that takes
about 40% less time (or about 20% less time than lapply). Note that as a
whole, llply still has much more overhead than lapply.
* round_any now lives in plyr instead of reshape
BUG FIXES
* list_to_array works correct even when there are missing values in the array.
This is particularly important for daply.
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
________...
2011 May 27
1
Error with BRugs 0.53 and 0.71, on Win7 with R 2.12.2 and 2.13.0 (crashes R GUI)
...r interface to help.
Type 'q()' to quit R.
Loading required package: proto
Loading required package: grid
Loading required package: reshape
Loading required package: plyr
Attaching package: 'reshape'
The following object(s) are masked from 'package:plyr':
rename, round_any
[Previously saved workspace restored]
> install.packages("BRugs")
Installing package(s) into 'C:/Users/cchap/Documents/R/win-library/2.13'
(as 'lib' is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependency 'c...
2011 Sep 14
4
I cannot load my workspace in R
I was trying to open up the workspace that you help me write last night,
but for some reasons, when I tried to load the saved file R reads
"load("C:\\Users\\Documents\\Statistical Learning\\HW1 #3 hint")
and then it basically just stopped.
I changed the file to a .Rdata file but the problem still persist, any
ideas how to fix this?
Thank you.
--
View this message in context:
2008 Apr 04
0
ggplot2 - version 0.6
...ounts when the x
axis was a categorical variable with a single level (thanks to Bob
Muenchen for pointing this out!)
* stat_bin: no longer incorrectly warns that binwidth is unspecified
when breaks are set
* stat_bin: now takes origin argument to manually specify origin of
first bin (default is round_any(min(range), bin_width, floor))
* stat_boxplot, stat_contour, stat_density2d, stat_qq, stat_density:
na.rm parameter added to the following statistics (thanks to Leena
Choi for suggesting this)
* stat_function: new, makes it easy to superimpose a function on the plot
* stat_qq: axes flipped to...
2008 Apr 04
0
ggplot2 - version 0.6
...ounts when the x
axis was a categorical variable with a single level (thanks to Bob
Muenchen for pointing this out!)
* stat_bin: no longer incorrectly warns that binwidth is unspecified
when breaks are set
* stat_bin: now takes origin argument to manually specify origin of
first bin (default is round_any(min(range), bin_width, floor))
* stat_boxplot, stat_contour, stat_density2d, stat_qq, stat_density:
na.rm parameter added to the following statistics (thanks to Leena
Choi for suggesting this)
* stat_function: new, makes it easy to superimpose a function on the plot
* stat_qq: axes flipped to...
2012 Jan 08
1
fix and edit don't work: unable to open X Input Method->segfault
...at
the problem was fixed.
The really bad part is that the second try causes a segmentation fault
in R itself.
> library(ggplot2)
Loading required package: reshape
Loading required package: plyr
Attaching package: ?reshape?
The following object(s) are masked from ?package:plyr?:
rename, round_any
Loading required package: grid
Loading required package: proto
> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_ME...
2010 Dec 21
2
Warning message when items of Hmisc are masked by loading a package.
I've noticed that I get a warning message every time a package masks
some functions from Hmisc. The warning message says :
Warning message:
In identical(get(., i), get(., lib.pos)) : ignoring non-pairlist attributes
This happens with eg:
library(plyr)
library(xtable)
I think I've seen this passing by before, but I'm not sure any more.
Just thought I'd mention it.
Cheers
Joris
2012 Jul 21
4
rhsape2 bug?
All,
I believe I am running the latest version of rshape2 (1.2.1). But this code:
library(reshape2)
tmp <- melt(smiths,
id.vars=1:2,
measure.vars=c("age","weight","height"),
variable.name="myvars",
value.name="myvals"
)
names(tmp)
Produces this output:
> names(tmp)
[1] "subject" "time"
2011 Apr 16
2
(no subject)
I have just upgraded to R 2.13 and have library(ggplot2) in my
.Rprofile (among other things). when i start R I get an error
message. Has something in the start up scripts changed? Is there a
better way to specify the library calls in .Rprofile? Thanks for all
of the help in advance.
Error:
Loading required package: grid
Loading required package: proto
Error in rename(x, .base_to_ggplot) :
2012 Jun 28
6
Help
Dear all,
I need some help on plotting multiple boxplots on one figure.
I have three matrix A, B and C. Each of them is a 1000 by 10 matrix.
The 10 columns of all three matrix correspond to the
10 values of the same parameter, say k=1, ..., 10.
I want to make a plot where x axis represents different values of k.
For each k value, I want to plot three boxplots, one on top of another.
For