similar to: problems with image.plot()

Displaying 20 results from an estimated 500 matches similar to: "problems with image.plot()"

2011 Aug 25
2
axes start at end of plot
Hello all, I used the following script to generate a plot, but when I try to place axes, the axes start at the end of my plot and continue off the plot; the attached image shows what happens when I try to generate axes. library(fields) as.matrix(read.table("Matrix.txt", sep="\t"))->x #the matrix is a square matrix measuring 104x104; it was too large to attach #on left:
2011 Jul 19
1
Assigning colors to cells
Hi everyone, I was wondering if there was a simple way to assign a color to a cell based on value in a data frame and return the cell as an image? For example, if the value is >1, then blue, if between 1 and 2, green, if between 2 and 3, yellow, etc. I tried using a heatmap function but I was hoping there was an easier way to do this. Thanks, Sumukh
2011 Aug 20
0
axis does not show up
Hello everyone, Using the following script I generated a heatmap for my matrix with image.plot from the fields package: library(fields) as.matrix(read.table("Matrix.txt", sep="\t"))->x #on left: labels are: Side<-as.character(x[1,2:ncol(x)]) length(Side)->nS #on bottom, labels are: Bot<-as.character(x[2:nrow(x),1]) #remove first row and column
2011 Dec 06
1
Unable to collate and parse R files with R CMD check
Hi all, I'm trying to build a package on Windows 7 (64 bit) and although R cmd build worked fine and I got pkg.tar.gz with no errors, but when I tried doing R CMD check everything turns out ok except for the warning: "checking whether package 'pkg' can be installed ... ERROR. Installation failed." It then refers me to the error file "00install.out" which reads as
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
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
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 ->
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 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 =
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 May 17
1
suggestions/improvements for recoding strategy
I am recoding some data. Many values that should be 1.5 are recorded as 1-2. Some example data and my solution is below. I am curious about better approaches or any other suggestions. Thanks! # example input data myData <- read.table(textConnection("id, v1, v2, v3 a,1,2,3 b,1-2,,3-4 c,,3,4"),header=TRUE,sep=",") closeAllConnections() # the first column is IDs so remove
2009 Nov 30
1
Plotting color.legend() outside of plot region
Dear List, I am trying to plot a color.legend() in the right outer margin of my device region. I have read multiple threads on the subject and still can't get it right. I have stolen an example from one of the threads to demonstrate my problem. I have extended the outer margin using par(oma()), and have used par(xpd=NA) to tell it to plot in the device region. I can get the legend to plot
2011 Aug 09
1
rgl how to plot a cylinder like arrow3d?
Dear List, I'm trying to draw vector in XYZ with rgl under use of a cylinder3d. Therefore I scale and rotate a basis-cylinder). However, somehow the rotation is wrong as verified by overplotting arrow3d(). Where is my mistake? library(heplots) library(rgl) # ... 2 vectors data=data.frame(row.names=c('X','Y','Z'), x1=c(2,1,5),y=c(4,3,2))
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