Displaying 20 results from an estimated 1000 matches similar to: "Viewing Function Code"
2008 Dec 05
1
Loop swith String replacement
Hi All,
I'm trying to split my dataset, into multiple datasets that i'll analyse
later, i wanted to do this dynamically as i might need to rerun the code
later.
I was looking at doing this via a loop, (Are other methods more appropriate?
Would a function be better?)
However i'm not sure in R how do do string replacement within the loop in
order to create unique dataset names based on
2009 Aug 25
1
Help with nls and error messages singular gradient
Hi All,
I'm trying to run nls on the data from the study by Marske (Biochemical
Oxygen Demand Interpretation Using Sum of Squares Surface. M.S. thesis,
University of Wisconsin, Madison, 1967) and was reported in Bates and Watts
(1988).
Data is as follows, (stored as mydata)
time bod
1 1 0.47
2 2 0.74
3 3 1.17
4 4 1.42
5 5 1.60
6 7 1.84
7 9 2.19
8 11 2.17
I then
2008 Oct 02
1
Time conversion
I'm trying to convert a variable that is imported from CSV into a datetime,I'm
trying to use the strptime function but with no joy, can anyone offer any
advise?
i have a vector
timestamp
07-07-2008-21:03:55
07-07-2008-19:52:55
07-07-2008-19:54:14
07-07-2008-15:24:01
07-07-2008-13:39:17
07-07-2008-13:39:55
timestamp<-strptime(timestamp,"%d-%m-%y-%H:%M:%S")
## then filter on
2009 Oct 12
1
List mappings and variable creation
Hi All,
I have a questions about associative list mappings in R, and if they are
possible?
I have data in the form show below, and want to make a new 'bucket' variable
called combined. Which is the sum of the control and the exposed metric
values
This combined variable is a many to many matching as values only appear in
the file if they have a value > 0.
conversion.type filteredID
2008 Jun 06
2
Merging two dataframes
Hi All,
Newbie question for you all but i have been looking at the archieves and the
help dtuff to get a rough idea of what i want to do
I would like to merge two dataframes together based on a keyed variable in
one dataframe linking to the other dataframe. Only some of the cases will
match but i would like to keep the others as well.
My dataframes have 67 and 28 cases respectively and i would
2008 Jun 20
2
Problems with basic loop
I'm having trouble creating a looping variable and i can't see wher ethe
problem arises from any hep gratfully appreciated
First create a table
x<-table(SURVEY$n_0,exposed)
> x
exposed
False True
Under 16 24 1
16-19 68 9
20-24 190 37
25-34 555 204
35-44 330 87
45-54 198 65
55-64 67 35
65+
2004 Nov 26
2
barplot(2?) with CI from a zero reference line
Dear R Users, (and dear Marc)
First of all many thanks for the answers to my previous questions.
I would like to barplot the mean percent change of a variate with it's
CI. Bars should start from the zero reference line to height (in
barplot2).
Is there a way to tweak barplot2, for example, to do that ?
I have tried to see what the function was but unlike other functions was
not able to
2008 Jun 17
2
Calling functions
Another newbie question.
I've written a function and saved the file as Xtabs.R, in a central place on
a network so others will be able ot use the function,
My question is how do i call this function?
I've tried to chance the working directory, and tried to load it via;
> library(Xtabs, lib.loc="//filer/common/technical/surveys/R_test")
but neither seem to work? the function
2007 Oct 31
2
ylim in barplot2 function?
Hi list,
I'm using barplot2 form the gplots package to plot a few numbers (I want to add SD bars later).
However, I would like the y-axis not to start from 0 but 500. When I add the parameters YLIM, something goes wrong. The graph is not 'cut off' at 500. Instead the bars seems to sink trough the bottom of the graph.
Because its a little hard to explain, here is a self-containing
2003 Apr 16
2
barplot2
Hello,
I get a nice looking barplot using the barplot2 function in the gregmisc
package:
body2 <- barplot2(hh3, beside = TRUE,
col = c("mistyrose", "lightcyan"),
....
cex.names = 1.0, plot.ci = TRUE, ci.l = cil, ci.u = ciu,
plot.grid = TRUE)
box()
However, obviously I lose the collors when converting from ps to a pdf
(outside of R)
2006 Mar 01
1
Width of bars in barplot2
I'm using barplot2 to plot some data. Is there any way to determine
the width of the bars in the generated plot? I know that barplot2
returns a list of the coordinates of the center of each bar, but since
there is some white space between each bar, I don't know how to get
the width of each bar.
Jamie
2011 Jun 21
2
par code help
I am making a barplot using barplot2 from gplots where each bar
represents a specific tree species. I have formatted the species names
on the x-axis so that the genus name is above the species name and
have then rotated the labels 45 degrees to save room. This is my code:
>columncolor<-c("grey20", "grey20", "grey20", "grey70",
2004 Nov 24
1
reshaping of data for barplot2
Dear All,
I have the following data coming out from
s <- with(final,
summarize(norm, llist(gtt,fdiab),
function(norm) {
n <- sum(!is.na(norm))
s <- sum(norm, na.rm=T)
binconf(s, n)
}, type='matrix')
)
ie
gtt fdiab norm.norm norm.norm2 norm.norm3
18
2004 May 07
1
x-axis tick mark labels running vertically
I'm plotting obesity rates (y-axis) vs Public Health Unit (x-axis) for the
province of Ontario and would like to have the Public Health Unit names appear
vertically rather than the default, horizontally.
I'm actually using the 'barplot2' function in the {gregmisc} library ... I
haven't been able to find a solution in either the barplot2 options or the
general plotting
2003 Aug 07
5
gregmisc
Hi
How do I install "gregmisc" packages?
I did-
% sudo R
> install.packages("gregmisc")
.
.
> barplot2()
but,
Error: couldn't find function "barplot2"
--
atuya
Mac OSX 10.2.6
R 1.7.1
2005 Jul 08
1
Overlying a Normal Dist in a Barplot
R-Users,
Hopefully someone can shed some light on these questions as I had
little luck searching the archives (although I probably missed something
in my search due to the search phrase). I estimated multinomial
probabilities for some count data (number successful offspring) ranging
from 0 to 8 (9 possible response categories). I constructed a barplot
(using barplot2) and I want to
2005 Apr 14
3
Wrapping long labels in barplot(2)
I am using barplot, and barplot2 in the gregmisc bundle, in the
following way:
barplot2(sort(xtabs(expend / 1000 ~ theme)),
col = c(mdg7, mdg8, mdg3, mdg1), horiz = T, las = 1,
xlab = "$ '000", plot.grid = T)
The problem is that the values of 'theme', which is a factor, are in
some cases rather long, so that I would like to wrap/split them at a
space once they
2012 Apr 24
2
Positioning main title
Hello,
I have a barplot where each row has quite long texts and I have used "par"
to make some room in the left:
par(mar=c(0, 17, 3, 0), oma=c(0, 0, 0, 0))
barplot2(prueba, main = l, col=colores, horiz=TRUE,las=1, cex.names=.7)
My problem is that main text appears justified to the plot. I want to put it
in the middle of the image, and find a way to sort it out with mtex
par(mar=c(0,
2007 Aug 30
1
Barplot2 using for loop, how to adjust margins?
Hi R-users,
I inted to make multiple plots using for loop. The question is how can
I adjust the left hand side margin of the plot according to the
names.arg argument in barplot2. In every plot I have different
annotations in the y axis and they vary in length. Now when I have
fixed margins
opar <- par(mar=c(3,15,0,2)...
I get the same margins in all of the plots. That leaves lots of white
2011 May 23
2
Formatting names.arg
I am making a barplot using barplot2 from gplots and would like to
format the names of my categorical variables (tree species) on the x-
axis so that the genus name is above the species name (to save room).
My code so far is:
speciesnames<-c("Dialium guianensis", "Inga alba", "Tachigali
versicolor", "Brosimum utile", "Caryocar