Displaying 20 results from an estimated 10000 matches similar to: "For loop isn't working correctly"
2009 Oct 09
2
Problems with code containing a for loop
The following code isn't working and we can't figure out why..
letters = c("A","B","C","D","E","F","G","H","I","J")
numbers = 1:3
for(i in 1:6){ #6 letters
for (j in 1:3) { #3 numbers
for (k in -1:1) {
2002 Jul 05
1
PDF file not created correctly
I am trying to put some text data in a graphical output file so that I have
a single file with both the graphs and summary data. I was capturing the
output via a 'sink(textConnection('output','w')). This seems to work fine,
but in trying to put the text data in a graphics frame, I was having
problems. When creating a postscript file, things were fine, but a PDF
file appeared
2006 Dec 08
2
trouble with cloud output to bmp when in loop
I have some data that I need to view in various 3-D clouds. To better see
the cloud structure on a 2-D screen I would like to output a bunch of bmp
files with clouds at slightly different angles, then run them through an
external program to animate them. But I'm having trouble getting cloud()
from the lattice package to output to bmp files. Oddly, this is only a
problem when outputting
2009 Jan 28
2
Text data
i have a data column of text entries:
26M_AN_C.bmp
22M_AN_C.bmp
20M_HA_O.bmp
20M_AN_C.bmp
26M_HA_O.bmp
22M_HA_O.bmp
31M_AN_C.bmp
38M_HA_O.bmp
.
.
.
.
And I would like to sort by the middle tag: AN, HA, etc.
Is there a way to parse text data in R?
In excel, I would have used the "left" and "right" function to cut out just
the middle two letters out and put into another
2008 Nov 06
3
New to R - Errors in plotting
I am new to R and am running into trouble with the function plot.
When I enter in the simple code:
x<-1:4
y<-5:8
plot(x,y)
I get a scatter plot with 4 points as expected.
However, with my own data, A and B are both vectors of length ~85, each
entry a decimal in [0,1].
Using the same plot(A,B) with this data, the plot function no longer gives
me a simple plot with 85 points.
2006 Jul 11
1
Misunderstanding with lines (or elsewhere)
Misunderstanding with lines(...) :
http://7d4.com/r/
I would like the y coordinate of the horizontal line to be 1/4,
and also the line to begin at x=0 and end at y=1.
I'm obviously missing something
... so if anybody could help.
Many thanks.
test = function()
{
bmp('test.bmp', width=100, height=100)
m = matrix(0, 2, 2)
par(new=T, fig = c(0,1,0,1), mai=c(0,0,0,0), mar=c(0,0,0,0),
2008 Sep 08
1
Beginner graphics device questions.
Please forgive me if this has been asked before but I could not readily find an answer. First, from the example I was able to determine that graphics device commands such as plot can be redirected using 'png' and 'bmp' type commands. I tried this and it works as I understand it. The question is how this graphics device works. If I issue another 'plot' command will it also
2009 Oct 05
2
Loop function/comparison operator problem
Hi There,
I have created the following function
format<- function(){
repeat {
form<-readline(paste("\nIn what format do you want to save these
plots?\nChoose from: wmf, emf, png, jpg, jpeg, bmp, tif, tiff, ps, eps, or
pdf.\nNote: eps is the suggested format for publication quality plots.\nPlot
format --> "));
cat("\nI'm sorry, I don't know what that format
2012 Jan 01
1
bmp() shifts the image (Windows XP)
When using bmp() under Windows XP, I find that the saved image is a
shifted version of the correct image. Try this:
n<-5
fn<-"01.bmp"
x<-matrix(runif(n*n),nrow=n)
image(x,col=gray(0:255/255),axes=F,frame.plot=F)
bmp(filename = fn,width = n, height = n, units = "px")
par(mar=c(0,0,0,0),pty="s")
image(x,col=gray(0:255/255),axes=F,frame.plot=F)
dev.off()
The
2018 Jan 05
1
stat(2) cache, samba3 versus samba4
Short version:
Is there a way to enforce use of this cache:
./source3/smbd/statcache.c
I noticed it is absent from the ./source4 directory
I limited
server max protocol = SMB2
but that didn't do it.
Long story:
-----------
My samba server (4.2.14) hosts a couple of game install trees for a
Windows 7 computer.
Some of the games cause storms of stat(2) system calls, here is a
partial
2004 May 27
2
no transparent background in bmp
I've been attempting to export a graphics file of my lattice plots and no
matter what color I use for the bg= argument in the bmp/jpeg/png function,
the background is grey.
bmp(filename = "c:/my_paper/resids.bmp", width=1024, height=1024,
pointsize=10, bg="transparent")
# these are lattice plots. plot them in a 3x2 matrix
print( hgqqplot, position=c(0.0, 0.66, 0.5, 1.0 ),
2012 May 08
2
PPM to BMP converter
Dear all,
Several days ago, I posted How to write a bmp file pixel by pixel. Instead of bmp, I succeeded in writing a PPM file by using the pixmap package. Thanks for the hint generously provided by Uwe Ligges.
Now I have a new question. How to convert a PPM file to BMP file in R? I know I can do this in photoshop or by some other softwares, but I think if I Can do this in R, that
2005 Feb 08
1
Windows BMPs: Why grey background? How to display BMP in R?
"white" is supposed to be the default background for BMPs (according to
?bmp) but it doesn't work
> bmp("test.bmp", bg="white")
> plot(0)
> dev.off()
# results in grey background
# This seems to be a good enough workaround for now.
> bmp("test.bmp")
> par(bg="white")
> plot(0)
> dev.off()
# background is white
2001 Sep 06
2
file.copy() problems on WinNT (PR#1085)
For some files, file.copy() doesn't copy these files correctly.
Here you will find a file (Bitmap, 769Kb) to reproduce the problem:
http://www.statistik.uni-dortmund.de/leute/ligges/R/test1.bmp
Using
file.copy("c:/test1.bmp", "c:/test2.bmp", overwrite = TRUE)
produces a second file with the size of ~1.4 Mb:
http://www.statistik.uni-dortmund.de/leute/ligges/R/test2.bmp
2006 Apr 21
1
Titles in MAplots
Hi
Does anyone know how to set the titles in MAplots to just show the CEL file name?
So far I have;
#define 'Array' as object containing CEL names
Array <- col.names(Data)
#open bmp and make a separate bmp for each MAplot
bmp("C:/MAplot%03d.bmp")
#remove the annotation and minimise margins
par(ann=FALSE)
par(mar=c(1,1,1,1))
#MAplot
MAplot(Data...????
Does anyone know the
2003 Apr 14
6
Charts to M$Word - what's the best format
Hi
I'm exporting some graphs from R to M$Word. I used png, jpeg and bmp and
the quality is poor when comparing with the postscript.
What is the best way to export a chart to be included in a M$Word file ?
Thanks
EJ
2007 Jul 12
1
bmp => xpm
Salut Alex,
je voudrais savoir comment faire pour passer le format bmp, par exemple, en format xpm?
Est-ce qu''il est possible de lire des formats bmp(entre autre) avec StaticBitmap?
C''est toi en photo dans l''exemple de StaticBitmap?
merci
Sebastien
_______________________________________________
wxruby-users mailing list
wxruby-users@rubyforge.org
2004 May 18
3
Help : trellis.device
Hi, R members.
I want to save plots. So I use the R as fallows :
--------------------------------
a <- c(1,10)
b <- c(1,10)
c <- c(2,20)
d <- c(2,20)
require(lattice)
trellis.device("bmp", file = "test.bmp", bg = "white")
print(plot(a,b))
print(plot(c,d))
dev.off()
--------------------------------
However, I got a image of plot(c,d).
I want to get a
2008 Jul 24
3
Should this PDF render correctly without font embedding?
A professor here at Vanderbilt sent me the following code. Each of the
text strings should right justify against the center vertical bar, but
because of font issues it doesn't. I understand that there are
workarounds, but I was just curious if this was consistent across all
platforms. On linux with R 2.7.1 and R-trunk (r46103), both acrobat
reader 8 and kpdf render it incorrectly. How
2002 Jan 29
3
lattice dotplot and graphic devices on Windows
I am using R1.4.0 on WindowsNT (the precompiled version from Brian Ripley's
website) and the lattice package (version details are at the end of this
message).
After producing a lattice dotplot, I want to insert the graph into a
MicrosoftWord document. With "ordinary" R-graphics, I have done this
successfully by copying the graph as a metafile to the clipboard and pasting
this into my