Displaying 20 results from an estimated 1000 matches similar to: "Selecting divergent colors"
2011 Jun 09
2
scatterplot3d - help assign colors based on multiple conditions
Hi
I am relatively new to R and am trying to figure out to plot 3d scatter plot using defined colors based on x-axis and y-axis values. Right now in the code below, I assign colors based on certain values in the names of the x-axis. Now if I want to extend the condition to assign a color based on the names of both x-axis and y-axis values, what should I be doing? Any help or ideas would be
2011 Mar 15
1
How to read only specified columns from a data file
R-help,
I'm trying to read a data file with plenty of columns.
I just need the first 5 but it doe not work by doing something like:
> mycols <- rep(NULL, 430) ; mycols[c(1:4)] <- NA
> read.table(myfile, skip=2, colClasses=mycols)
Any suggestions?
Thanks in advance
2012 May 07
1
Plotting a raster image
Hello,
I have a data frame which looks like
> head(d)
a1 a2 n j col
1 1 1 88341002 11 #E7E7E7
2 1 2 25094882 11 #E7E7E7
3 1 3 16916246 11 #E7E7E7
4 1 4 14289229 11 #E7E7E7
5 1 5 11945929 11 #E7E7E7
6 1 6 8401235 11 #E7E7E7
The values in 'j' run from 1 to 11. I would like to plot the point (a1,a2)
with color given by j
I tried
mi <-
2010 Nov 27
1
return vector of element names for vector, matrix or array
Just as as.vector() takes a vector, matrix or array and returns a
vector in row-major order,
I'd like to write a function to take such an object and return the
dimension names,
pasted with some separator, as a similar vector.
Here is something ugly cobbled together to demonstrate what I want: a
function to work
for any number of dimensions.
vecnames <- function(x, sep=':') {
2011 Oct 19
2
Simple color strip
Hi,
I was trying to get an image/pdf of a sequence of colors in the order given.
For example:
myCols <- c('#0000BF','#0000BF','#0000FF','#0000FF','#0000BF','#0000FF')
I'd like to make a strip of colors as they appear in the order above and
save it as a pdf file. Is there a function in the base package (or some
other package) to do this?
2003 Jan 14
1
How to change the label position in axis() ?
Dear R People,
I'm working on a plot function to produce the graph shown below. One of
the features my supervisor does not like is that the labels in the Y-
axix are shown vertically. Is there a way to change that to horizontally
?
This is the axix() function I used :
axis(2,at=seq(nstrat),labels=snames)
The labels (snames) are: SEV1:HU:C, SEV1:MU:C, SEV1:MU:L, SEV1:RT:C
and SEV1:RT:L,
2004 Nov 20
2
subset on data frame
I have a data frame. And I'd like to subset according to rownames.
subset(mydataframe, rownames(mydataframe) == myrow, select = mycols)
it turned out that "myrow" cannot be a vector. But I have multiple rows to
pick. Is there a way to get around this problem??
Thank you for your help!!
Lei Jiang
Department of Chemsitry
University of Washington
Box 351700
Seattle, WA 98195
2004 Dec 03
1
How to wrap or split labels on plot
Dear R gurus,
I want to wrap labels that are too long for a plot. I have looked at
strsplit(), substr(), nchar(), and strwrap(). I think it's some
combination but I'm having difficulty trying to figure out the right
combo. I think I need to create some new matrix containing the labels
already split, though I'm not sure if maybe there is a quick and dirty
way to address this
2008 Apr 30
3
Cross Spectrum Analysis
I am reading some documentation about Cross Spectrum Analysis as a technique
to compare spectra.
My understanding is that it estimates the correlation strength between
quasi-periodic structures embedded in two signals. I believe it may be
useful for my signals analysis.
I was referred to the R functions that implement this type of analysis. I
tried all the examples which generated a series of
2004 Jul 19
10
How to compare X1 = X2 = ... = Xn?
Dear All,
I have a data frame with n columns: X1, X2, ., Xn. Now I want to create a
new column: if X1 = X2 = . = Xn, the value is 1; Otherwise, the value is 0.
How to do that in a quick way instead of doing (n choose 2) comparisons?
Thank you,
Frank
[[alternative HTML version deleted]]
2010 Sep 26
1
acf function
Hi,
Im new to R so this question is quite fundamental.
Im trying to compare some autocorrelations generated by the acf function to some theoretical correlations. How can I have acces to just the autocorrelations, for computation?
This is some of my code:
> acf.data<-c(acf(x))
> acf.data
This is the R output:
$acf
, , 1
[,1]
[1,] 1.000000000
[2,]
2012 Mar 26
2
trellis plot
Hi everyone,
I am just trying to figure out how to do a xyplot where in addition to
dots and lines I can change dots' colors according to an individual
variable (e.g., marital disruption across time, a dummy 0/1). When I
use "groups" specification (see below), I get two different lines for
each individual based on groups, and what I want is to get one line
connecting dots, and
2002 Oct 18
7
RAM usage
Hi,
I'm having problems while working with large data sets with R 1.5.1 in
windows 2000. Given a integer matrix size of 30 columns and 15000 rows
my function should return a boolean matrix size of about 5000 rows and
15000 columns.
First of all I tried to run this function on computer with 256 MB of
RAM. I increased memory limit of R with memory.limit() up to 512 MB. I
was inspecting
2018 Oct 04
2
Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)
Hi Hugo,
I've been able to replicate your bug, including for other distributions (runif, rexp, rgamma, etc) which shouldn't be surprising since they're probably all drawing from the same pseudo-random number generator. ?Interestingly, it does not seem to depend on the choice of seed, I am not sure why that is the case.
I'll point out first of all that the R-devel mailing list is
2018 Oct 04
2
Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)
Hi Hugo,
I've been able to replicate your bug, including for other distributions (runif, rexp, rgamma, etc) which shouldn't be surprising since they're probably all drawing from the same pseudo-random number generator. ?Interestingly, it does not seem to depend on the choice of seed, I am not sure why that is the case.
I'll point out first of all that the R-devel mailing list is
2009 Mar 11
0
Working up examples of barplots with customized marginal items
Hello, everybody:
I'm back to share a long piece of example code. Because I had trouble
understanding the role of par() and margins when customizing barplots,
I have struggled with this example. In case you are a student wanting
to place legends or textual markers in the outer regions of a barplot,
you might run these examples.
There are a few little things I don't quite understand.
2009 Sep 11
3
Barplot+Table
I am trying to automate a report that my company does every couple of years
for the state of Maine. In the past we have used SPSS to run the data and then
used complicated Excel template to make the tables/graphics which we then
imported into Word. Since there are 256 tables/graphics for this report, this
work flow is a little painful. I would like to automate the process and I think
I can do
2005 Mar 30
5
2d plotting and colours
Hi!
I am new to R just 3 days in it and i apologize if my questions seem very
trivial and consumed your valuable time.
I am coding in perl and i stumbled upon R regarding plotting good
statistical graphs.
I tried the kmean clustering for a large matrix ,say > 150 * 150 . I tried
the example code given in the tutorial to perform 2d plot
# i ranges from 2 to 10
cl <- kmeans(x, i, 20)
2005 Jul 27
3
Asymmetric colors for heatmap
> Dear expeRts,
>
> Currently, my colors are as follows:
> mycol <-
> c("blue1","blue2","blue3","blue4","black","yellow4","yellow3","yellow2","y
> ellow1")
> heatmap(snp, Rowv=NA, Colv=NA, col=mycol)
>
> However, I would like to have the following colors:
> bright blue ->
2011 Feb 25
1
speed up process
Dear users,
I have a double for loop that does exactly what I want, but is quite
slow. It is not so much with this simplified example, but IRL it is slow.
Can anyone help me improve it?
The data and code for foo_reg() are available at the end of the email; I
preferred going directly into the problematic part.
Here is the code (I tried to simplify it but I cannot do it too much or
else it