similar to: color individual bar of histogram?

Displaying 20 results from an estimated 10000 matches similar to: "color individual bar of histogram?"

2009 Mar 31
4
what is the preferred method to create a package local variable?
for the moment, I'm using: .onAttach <- function(libname, pkgname) { .bbg.db.conn <<- dbConnect(dbDriver("PostgreSQL"), user="blah","blah") } .onUnload <- function(libpath) { dbDisconnect(.bbg.db.conn) } which results in a hidden global variable in the global environment. I would prefer to make the assignment only in the package namespace.
2003 Sep 17
3
Building and loading a DLL on Windows NT
I am trying to build a simple dll with Rcmd SHLIB to link into R. The results of the build are below. From my limited knowledge of building DLLs, it looks like it worked (I didn't get any errors). F:\R\dlls> Rcmd SHLIB add.C making add.d from add.C g++ -IC:/PROGRA~1/R/src/include -Wall -O2 -c add.C -o add.o ar cr add.a *.o ranlib add.a g++ --shared -s -o add.dll add.def add.a
2017 Jan 03
2
[R] Problems when trying to install and load package "rzmq"
On Tue, Jan 3, 2017 at 3:53 PM, Whit Armstrong <armstrong.whit at gmail.com> wrote: > > I maintian the rzmq project. > > love to get it running on windows, but zmq doesn't play nicely with R's > mingw. It's fairly easy to link against the libraries from rwinlib: https://github.com/rwinlib/zeromq. I'll send you a pull request later this week to fix the binary
2006 Jul 27
3
deparse(substitute(foo))
I see that plot.default uses deparse(substitute(x)) to extract the character name of an argument and put it on the vertical axis. Hence: foo <- 1:10 plot( foo ) will put the label "foo" on the vertical axis. However, for a function that takes a "..." list as an input, I can only extract the first argument name: x <- 1:10 y <- 10:20 foo <- function(...) {
2004 Sep 09
4
scoping rules
Can someone help me with this simple example? sq <- function() { y <- x^2 y } myfunc <- function() { x <- 10 sq() } myfunc() executing the above in R yields: > myfunc() Error in sq() : Object "x" not found I understand that R's scoping rules cause it to look for "x" in the environment in which "sq" was defined (the global environment in
2003 Aug 13
1
Problems with addition in big POSIX dates
Have you noticed any problems with big dates (>=1/1/2040) in R? Here is the bit of code that I'm having trouble with: > test.date <- strptime("1/1/2040",format="%m/%d/%Y") > > unlist(test.date) sec min hour mday mon year wday yday isdst 0 0 0 1 0 140 0 0 0 > > date.plus.one <- as.POSIXct(test.date) +
2008 Nov 18
2
anyone familiar with this error?
[whit at linuxsvr R.packages]$ sudo R CMD INSTALL portfolio.construction * Installing to library '/usr/local/lib64/R/library' * Installing *source* package 'portfolio.construction' ... ** R ** preparing package for lazy loading Loading required package: fts Loading required package: quadprog Loading required package: Rexcelpoi terminate called after throwing an instance of
2007 Dec 30
1
Histogram with different colors for different portions
Dear Rusers, I would like to color different sections of a histogram different colors. I have an example that was done by "brute force" given below. Has anyone implemented something like this in general? If not, any suggestions/pointers on how to write a general function to do so would be most appreciated. Alan-
2012 May 17
2
test suites for packages
Can anyone share some opinions on test suites for R packages? I'm looking at testthat and RUnit. Does anyone have strong opinions on either of those. Any additional packages I should consider? Thanks, Whit
2008 Dec 11
2
is there a way to recursilvely lapply
for a simple example: x <- list() x[["a"]] <- list(a=c(1,2,3),b=c(3,4,5)) x[["b"]] <- list(a=c(6,7,8),b=c(9,10,11)) lapply(x,sum) this fails w/ Error in FUN(X[[1L]], ...) : invalid 'type' (list) of argument Just wondering if I have overlooked something obvious. one can also do: lapply(x,lapply,sum) but that assumes that you already know how many levels
2006 Jul 26
2
RODBC on linux
Anyone out there using Linux RODBC and unixODBC to connect to a Microsoft SQL server? If possible can someone post a sample .odbc.ini file? I saw a few discussions on the archives a few years ago, but no config file details were available. Thanks, Whit This e-mail message is intended only for the named recipient(s) above. It may contain confidential information. If you are not the intended
2004 Oct 25
1
copyright issues when package maintainer changes
I will be taking over as maintainer of the its package from Giles Heywood. The code was originally written while he was working at Commerzbank. I have added the header below to the top of the R source file to indicate the changes in the copyrights for the code. The package was originally released under GPL2. I have no experience with copyright issues, and would appreciate it if someone who does
2008 Dec 09
1
any suggestions to deal with 'Argument list too long' for a R CMD check?
Since, gcc was using upwards of 2gb of ram to compile my package, I just split all the functions into individual files. I guess I'm too clever for myself, because now I get hit with the "Argument list too long" error. Is there a way to deal with this aside from writing my own configure script (which could possibly feed the gcc commands one by one). -Whit RHEL 5 [whit at
2004 Aug 19
2
proposed change to [.POSIXct
R developers, The "tzone" attribute is stripped from a POSIXct object when the subscript command is called ("[.POISXct"). This results in dates being printed in the locale specific format after a subscript operation is applied to a POSIXct object which has cause several problems for me in the past. Here is an example of this problem under R 1.9.1: > x <-
2005 Mar 02
2
apply a function to a rolling subset of a vector
Try this: > ?convolve > x<-rnorm(1000) > y<-rep(1,20) > z<-convolve(x,y,type="filter") > plot(x,type="l") > str(z) num [1:981] 6.31 7.28 8.16 7.39 4.65 ... > lines(c(rep(0,10),z,rep(0,10)),col="yellow",lwd=3) > lines(c(rep(0,10),z,rep(0,10))/length(y),col="red",lwd=3) #running mean You wrote: Does anyone know an easy way
2010 Jun 11
2
r code to broaden the boarder of the bars of a histogram
To whom it may concern, I have a problem concerning the design of a histogram. How do I change the border widths of the bars of a histogram. The initial command is: hist (punkte,breaks=30, xlab="Punkte", ylab="H?ufigkeit", main="Histogramm", col= heat.colors(30), border= "red") I suspect that it has to do with the "lwd" command but can't
2008 Oct 29
1
builtin to filter a list?
I know it's easy to write a simple loop to do this, but in the spirit of lapply, I thought I would ask if there is a builtin to filter or take a subset of a list based on a predicate in a similar way to the Erlang lists:filter/2 function: http://www.erlang.org/doc/man/lists.html#filter-2 filter(Pred, List1) -> List2 Types: Pred = fun(Elem) -> bool() Elem = term() List1 = List2 =
2010 Mar 04
2
Histogram color
In a histogram , is it possible to have different colors? Example. I generated x <- rnorm(1000000) hist(x) I want the histogram to have different colors based on the following condition mean(x)+sd(x) with red color and mean(x) - sd(x) with red color as well. The middle one with blue color. Is it possible to do that in R? Thanks
2004 Dec 29
2
help with Rcmd check
I've been working on a package that requires a shared library to be loaded. I have used the NAMESPACE file to load the library according to: http://cran.r-project.org/doc/manuals/R-exts.html#Load%20hooks <http://cran.r-project.org/doc/manuals/R-exts.html#Load%20hooks> my shared library is "excelpoi.so" hence I have added "useDynLib(excelpoi)" to my NAMESPACE file.
2005 Feb 09
2
Histogram Bar Spacing or Border Width
Is there any way to control the spacing between bars in a histogram, or change the border width (I'm assuming the hist() function, though alternatives are welcome)? I'm interested in changing the visual spacing between columns in a plotted histogram. The general effect I'm looking for can be accomplished in barplots using the "width=" parameter, but I have not been able