Displaying 20 results from an estimated 53 matches for "mycols".
Did you mean:
mycol
2011 Jun 09
2
scatterplot3d - help assign colors based on multiple conditions
...column and second column contain "Anterior_nares" and assign black to any other combination.
Thanks!
Karthik
library(scatterplot3d)
chd1=read.table(file="test.out", header=F, sep="\t")
col=as.vector(chd1[,1])
xlabels=as.vector(chd1[,1])
ylabels=as.vector(chd1[,2])
mycols<-c("red","blue","green","chocolate","orange", "brown")
col[grep("_Stool", xlabels) ]<-mycols[1]
#col[grep("_Stool", xlabels) && grep("_Stool", ylabels) ]<-mycols[1]
col[grep("_Tongue_dors...
2010 Jul 15
2
replace negative numbers by smallest positive value in matrix
Hi Group,
I have a matrix, and I would like to replace numbers less than 0 by
the smallest minimum number. Below is an
small matrix, and the loop I used. I would like to get suggestions on
the "R way" to do this.
Thanks,
Juliet
# example data set
mymat <- structure(c(-0.503183609420937, 0.179063475173256, 0.130473004669938,
-1.80825226960127, -0.794910626384209, 1.03857280868547,
2017 Jan 21
2
problema con grafico lattice ....
Hola,
Por si lo quieres con colores rellenando cada punto:
#----------------
library(data.table)
library(lattice)
dat <- read.table("pba.csv", header=TRUE, dec=",", as.is=TRUE)
row.names(dat) <- NULL
dat <- as.data.table(dat)
dat$mycol <- ifelse(dat$sol =="ControlAE", "red", dat$sol)
dat$mycol <- ifelse(dat$mycol
2012 Jul 29
1
Zoo panel function
I would really like some help with understanding the panel function, in
zoo. Thank you.
R 15.1 and zoo 1.7-7.
library(zoo)
x = seq(0,3*pi,length.out=100)
y = sin(x)
zobj = zoo(y, x)
###########################################################
## EXAMPLE 1 - GLOBAL ARGUMENT
## This panel function works
## But, it relies on mycol, which is a global variable
2007 Feb 04
3
Reference to dataframe and contents
This is probably easy for experienced users but I could not find a solution.
I have several R scripts that process several columns of a dataframe
(several dataframes and columns actually, but simplified for my question).
References such as:
myDF$myCol
are all over. I like to automate this for other dataframes and columns by
defining a reference only once in the beginning of the script.
One
2011 Dec 05
2
barplot ignoring col parameter
Hi All,
I'm having a problem with barplot:
mydata
[1,] 2 108 0 0 0 1 3 0 0 0 0 0 7 18 3 4 8 20 26 20 19 7 1 1
mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9))
barplot(mydata, col = mycol)
gives me an uniformly yellow barplot. How do I solve this?
bw
Federico
2013 Jun 10
1
Selecting divergent colors
...olors (i.e. perhaps
20) that are as different from each other as possible?
Here is my example code using the palette:
**********************
mat <- matrix(sample(1:1000,1000,replace=T),nrow=20,ncol=20)
snames <- paste('Sample_',1:ncol(mat),sep='')
colnames(mat) <- snames
mycols <- palette(rainbow(ncol(mat)))
for(k in 1:ncol(mat)){
plot(density(mat[,k]),col=mycols[k],xlab='',ylab='',axes=F,main=F)
par(new=T)
}
legend(x='topright',legend=snames,fill=mycols)
****************************
thanks!
[[alternative HTML version deleted]]
2007 Aug 06
3
Error in using nlevels in apply function
Dear R users,
I am currently trying to create my first personnal function and use it
with the apply function. The purpose of this function is to create a
vector summarizing the number of levels in a given selection of
data.frame columns.
I tried to transpose the indexation method used by the nlevels function
but it doesn't seem to work. I did not find anything uesful in the
archives so
2003 Feb 13
2
multi-color plot
hi all,
i am trying to make multi-color plots. that is, i generally use,
plot(x, y, type="n")
text(x, y, labels=class)
here, the vector class denotes the class of each point. there are
usually 3-4 classes of points. how may i display the different
classes in different colors?
thanks for any help.
--
saurav
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 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
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?
tha...
2012 May 07
1
Plotting a raster image
...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 <- image(d[,"a1"],d[,"a2"],d[,"j"],col=mycols(length(f)),useRaster=TRUE)
(where mycols is from colorRampPalette(c("#000000","#FFFFFF"),bias=1.5)
However, i got the following error:
Error in image.default(d[, "a1"], d[, "a2"], d[, "j"], col =
mycols(length(f)), :
increasing 'x' and...
2013 Jan 12
3
heatmap.2 problem
Dear List,
I'm trying to generate a simple heatmap that has each row and column
separated by a black line. However, for some reason this only happens
for the first and last color. The middle color in my colorpanel()
command has an addition horizontal and vertical line that I would like
to get rid off. Any suggestions?
#my code below
my.matrix <- cbind(func.1 =
2006 Aug 01
2
rgb and col2rgb color conversion/modification/shading
I want to get a lighter shade of a color...I have a lot of colored objects and
want each one printed as a foreground against a slightly lighter background.
I thought I could try something like changing the alpha channel by first
converting it to rgb.
But prior to trying that, I'm stuck with how to get the color after converting
using col2rgb() to be interpreted again as a color, rather than
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
2010 Jan 12
1
Multiple symbols per single line in a legend
Hello everybody,
Is it possible to coax legend() into displaying more than one simbol per
line in legend? I have a graph like the one attached to this mail; I would
like to reorganize the legend in such a way that the duplicate text would be
omitted, i.e., the first line would read <square> <triangledown> "increasing
frequency" and the second one would read <circle>
2010 Dec 12
4
legend not appearing in Word document
I need help with using graphics in Word 2007 that will later be converted into a
pdf document.? I have tried several formats and found that?I get the best
quality of graphics using .wmf, .eps format, but when I convert it to .pdf I get
a bunch of lines across the figures.? I also tried .tiff and .png but they give
me much lower quality.? The best quality that converts to pdf appears to be
2010 Aug 21
1
lattice::xyplot() with one factor for points and another for lines
Hi:
In lattice, how does one handle separate graphical behavior for two
different factors? In the xyplot below, the objective is to use the levels
of one factor to distinguish corresponding shapes and colors, and the levels
of the other factor to perform level-wise loess smooths.
# Illustrative data:
d <- data.frame(time = rep(1:8, each = 6), val = rnorm(48),
gp1 =
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