Displaying 20 results from an estimated 11000 matches similar to: "Plotting graphs using FOR loop"
2009 Nov 26
1
Adding text in the panels for Trellis plot ...
i was trying to do a for loop for plotting the histograms , but it doesnt
work properly
> library(lattice)
> columns <- 8:153
> plots <- vector("list", length(columns))
> j <- 0
> for (i in columns)
+ {
+ plots[[ j <- j+1 ]] <- histogram( ~ data[,i] | data[,2],ylab =
"Frequency",
+ xlab = "Score", xlim = c(1,5), ylim =
2009 Nov 19
1
RE shaping large dataset
I am doing a project which involve reshaping a large dataset, can any of you
please sugguest me some good reading/websites/ examples .... can be in R and
SAS
Thanks everyone !!!
--
View this message in context: http://old.nabble.com/REshaping-large-dataset-tp26421513p26421513.html
Sent from the R help mailing list archive at Nabble.com.
2009 Nov 17
3
re placing the dates format in R for exporting the data set...
hi everyone, i am having difficulties with replacing the dates format in R
for exporting the data set...
eg: the code that i used was
toms_dat<- replace(toms_dat, toms_dat ==2009-08-06, 2)
toms_dat<- replace(toms_dat, toms_dat ==2009-08-04, 1)
but when i export the data as into txt file or excel file the dates come up
with very large numbers .....:drunk:
please help me ...=)
--
View
2009 Nov 23
3
Trellis Plot
anyone know how to add text in the Trellis plot panel ?? i want to add things
eg: dot dot dot. in the headrer of the panel.
eg: http://old.nabble.com/file/p26486579/hist1.png hist1.png
--
View this message in context: http://old.nabble.com/Trellis-Plot-tp26486579p26486579.html
Sent from the R help mailing list archive at Nabble.com.
2010 Mar 03
1
Change current plot window size. Or - saving/loading current device plotting history
Hello dear R-help members,
Very soon I am to give a lecture on R. And in that lecture I intend to move
between: par(mfrow = c(1,1)) to par(mfrow = c(1,2)) back and forth.
I anticipate this will damage the image proportions and will force me to
resize the window.
So far I have found it is possible to close the window and then reopen it
(bigger/smaller) by using:
dev.off()dev.new(width=5,
2007 Jun 01
2
tapply histogram
Dear members,
I would like to pass the histogram settings to each subset of the dataframe,
and generate a multiple figures graph.
First, can anyone tell me how to generate a multiple figures environment? I
am trying
mfrow=c(2,4) and nothing appears.
Secondly, I want to pass the following function in tapply()
hist(x, freq=FALSE)
lines(density(x), col="red")
rug(x)
how can I manage
2009 Feb 09
2
How to plot multiple graphs each with multiple y variables
I am new to R and have a problem that I haven't been able to find the answer to in the guides or online.
I have multiple datasets, D1, D2, D3, D4, D5, D6, D7 and D8, and I would like to produce two plots side by side using mfrow. The first plot should contain data from D1-D4, the second should contain D5-D8.
I can plot these separately using the code,
par(mfrow=c(1,1))
2009 Jun 28
2
simple loop
Hi everyone!
I have this dataframe:
firm<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4),rep(5,4),rep(6,4))
year<-c(rep(2000:2003,6))
industry<-c(rep(10,4),rep(20,4),rep(30,4),rep(10,4),rep(20,4),rep(30,4))
X1<-c(10,14,18,16,20,45,23,54,24,67,98,58,16,32,57,12,54,0,0,22,11,3,5,6)
data<-data.frame(firm, industry,year,X1)
data
I need a loop that calculates the mean of X1 by year and
by
2011 Dec 29
3
Is it possible to "right align" text in R graphics?
Hello all,
The following line of code includes a right-to-left language text, yet the
R graphics engine displays it from left to right. One problem this causes
is when there are parenthesis in the test, here is a basic example?
plot(1:10, main = "שלום (טקסט)")
Is there a way to make sure the text is displayed from right to left?
Many thanks for any suggestions,
Tal
2005 Jul 19
1
initial points for arms in package HI
Dear R-users
I have a problem choosing initial points for the function arms()
in the package HI
I intend to implement a Gibbs sampler and one of my conditional
distributions is nonstandard and not logconcave.
Therefore I'd like to use arms.
But there seem to be a strong influence of the initial point
y.start. To show the effect I constructed a demonstration
example. It is reproducible
2009 Nov 26
2
Multivariate problems . . . with 200 resposes variables and 1 explanatory variable
How should I analysis it in R ???? all the resposes variables are ordinal
from 0 to 10. and the explanatory variable is a factor ...
--
View this message in context: http://old.nabble.com/Multivariate-problems-.-.-.-with-200-resposes-variables-and-1-explanatory-variable-tp26522912p26522912.html
Sent from the R help mailing list archive at Nabble.com.
2011 Mar 28
2
xlsx problem
Dear list,
I'm running windows xp with R 2.12.0. I'm trying to load a excel
spreadsheet into R using the xlsx package. I posted my code below with
the error I get.
> res <- read.xlsx("Copy of test_excel_input_data.xlsx", 6)
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.lang.IllegalStateException: Cannot get
2010 Apr 27
2
Histogram not plotting correct breaks
Hi,
I'm using the hist function to plot the frequency of 21 variables, but it
keeps starting the x-axis from 0 and adding variables 1 and 2 together (all
other vairables have the correct frequencies). I suspect it adds 1 and 2
together so that 0 can fit in with demarcations at intervals of 5. Using
"xlim=c(1,21)" to specify that i don't want to include 0 and using the
2011 Mar 07
1
help needed with histogram plotting
Dear all,
I am trying to plot 3 histograms on the same graph using the following
command.
hist(x,xlim=c(0,100))
hist(y,add=TRUE)
hist(z,add=TRUE)
The xlim of y is c(20,21) and that of z is c(99,99.5) , whereas the variable
x has xlim at c(0.5,2). Apparently, the graph end of displaying a line only,
corresponding to each histogram due to the wide range of the xlim and
tightness of the
2012 Jul 30
1
problem plotting in a grid
Hi all,
I'm trying to generate a grid of four plots. The first 2 appear
just fine, but the final 2 will not appear in the grid, instead
overwriting the first two. Any ideas on how to get them all in the
same window would be greatly appreciated.
Cheers,
Jonathan
library(fields)
par(mfrow=c(2,2)) #2x2 plot windows
plot(c(2,4),c(2,2)) # works fine
plot(c(2,4),c(2,2)) # works fine
2009 Sep 12
1
How to visualize paired t-test results?
I would like to know if you have any suggestions how to visualize the
results from a paired t-test (see the example data below). I tried to
produce plots that show the mean and CI's from the original data and the
estimate of the difference between means and the confidence intervals (see
below) from the t-test. I really don't know what would be the best way to
graphically display the
2009 May 11
1
Add data count to plot?
Hi
I'm a relative newbie to R and had a query concerning plotting. I have
generated a par(mfrow = c(2, 2)) graphic with 10 rose diagrams using
circular. What I wanted to add to each individual plot was "n = x" for the
number of data observations in each dataset. How might I go about doing
this??
Thanks
Mike
--
View this message in context:
2003 Feb 06
2
Fw: Plotting in subareas using par(fig=) parameter
Any idea why I can no longer plot two graphs on the same graphics device
using the par(fig=) parameter?
A simpler par(mfrow=c(1,2)) does work, showing the two plots side-by-side,
but I would like the first
to be larger. This simple example fails:
x<-c(1,1,NA,2,2,NA,3,3)
y<-c(2,4,NA,3,5,NA,1,4)
par(fig=c(0,2/3,0,1))
plot(x,y)
par(fig=c(2/3,1,0,1))
qqnorm(x)
When plotted, the last
2007 Apr 11
1
Programming Problem (for loop, random # control, 3 dimentional graph)
Dear List,
This is just a programming problem which i cannot seem
to figure out. I am trying to get a set of power from
a test (say, kolmogorov smirnov) out of a distribution
(say, G-K distribution) as follows. I am trying to
reduce to pain of writing the whole set of data points
(p# below) using "for" loop. However, I seem to have
some problem in it as the output "M" does not
2009 Nov 23
3
Translation from R codes to SAS.
my teachers doesnt understand R and I don't know how to use SAS.
Anyone interested in translating my codes to test whether your SAS codes are
as good as R???
I can test it on SAS codes once you have translated it ....
regards:working:
--
View this message in context: http://old.nabble.com/Translation-from-R-codes-to-SAS.-tp26486117p26486117.html
Sent from the R help mailing list