Displaying 20 results from an estimated 800 matches similar to: "A "stack" function"
2013 Apr 19
5
how to subtotal by rows
Dear R-users,
I have a dataset as like below, and I want to subtotal the values of rice,wheat and maize by year for each fid.
fid year rice wheat maize
------------------------------------------------
1 1995 5 NA NA
1 1995 NA 3 NA
1 1995 NA NA 2
1 1996 4 NA NA
1
2008 Apr 16
1
transposition problem
Hi use Rs,
I have a csv file:
"1989-90","1990-91"
Barley,23,34
Oats,15,16
Which I want to turn into:
year, Barley, Oats
1 "1989-90", 23, 15
2 "1990-91",34,16
Transpose doesn't quite do it, is there a standard way?
Cheers,
Geoff Russell
2003 Jan 31
1
TukeyHSD
Hello everybody!
I?m working with a dataset from eleven field trails on barley
fertilization. I use R 1.6.2 (Windows)
It is quite easy to fit aov() objects to the dataset.
The call:
> (l1t4y.aov <- aov(Yield ~ Trial + Treatment, data=led1t4b))
Results in an object with this anova table:
Df Sum Sq Mean Sq F value Pr(>F)
Trial 10 121423585 12142358 63.499
2012 Dec 01
1
reading json tables
I'm trying to read two data sets in json format from a single .js file.
I've tried fromJSON()
in both RJSONIOIO and RJSON packages, but they require that the lines be
pre-parsed somehow in ways I don't understand. Can someone help?
> wheat <- readLines("http://mbostock.github.com/protovis/ex/wheat.js")
> str(wheat)
chr [1:70] "var wheat = [" "
2007 Jun 28
2
aov and lme differ with interaction in oats example of MASS?
Dear R-Community!
The example "oats" in MASS (2nd edition, 10.3, p.309) is calculated for aov and lme without interaction term and the results are the same.
But I have problems to reproduce the example aov with interaction in MASS (10.2, p.301) with lme. Here the script:
library(MASS)
library(nlme)
options(contrasts = c("contr.treatment", "contr.poly"))
# aov: Y ~
2004 Jul 27
1
re: help with lattice plot
Dear List,
I have been using R to create an xyplot using the panel function within
lattice libraries. This plot is based on the data supplied in R named
'Oats'. The graph represents oat yield by nitro level with an overlay of
each variety of oats for each nitro level.
I have three questions regarding this graph:
1) I cannot seem to specify the type of symbol used by the plot, even
though
2017 Oct 18
4
Error messages using nonlinear regression function (nls)
Hi all,
I am trying to use nonlinear regression (nls) to analyze some seed germination data, but am having problems with error codes.
The data that I have closely matches the germination dataset included in the drc package.
Here is the head of the data
temp species start end germinated TotSeeds TotGerminated Prop
1 10 wheat 0 1 0 20 0 0.0
2 10 wheat
2006 Nov 06
1
rule seems to be matching all but last occurrence
Every hour I get a mail from logcheck with a line like
Nov 6 12:08:34 wheat fetchnews[13617]: clamping maxage for comp.os.linux.admin to global expire 50
The strange thing is that syslog is filled with similar lines, but
this is the only one I get in the report. It is the last such line in
each group:
# many similar lines deleted
Nov 6 12:08:32 wheat fetchnews[13617]: comp.std.c++: considering
2009 Oct 30
1
How to properly shade the background panels of an xyplot?
Dear R users,
this is a follow up of this message
http://tolstoy.newcastle.edu.au/R/e6/help/09/05/13897.html
I'm reproducing the core of it for convenience.
> //
> / data(Oats, package = "MEMSS") /
> / tp1.oats <- xyplot(yield ~ nitro | Variety + Block, /
> / data = Oats, /
> / panel = function(x, y, subscripts, ...) { /
2004 Apr 23
1
Weirdness with choose.files on Microsoft Windows (PR#6818)
Full_Name: Kevin Wright
Version: 1.8.0
OS: Windows 95
Submission from: (NULL) (170.54.59.160)
This bug also happens to me using R 1.9.0 on Windows 2000.
Took me a long time to create a reproducible bug, but I think I have succeeded.
I suspect my test function has a bug, but I don't see anything wrong. Plus, the
bug only shows up when selecting certain filenames. Nearest I can speculate,
2009 Oct 10
1
lattice auto.key drop unused levels
The following code produces a legend ("key") that mentions the unused
levels of Block.
library(MEMSS)
xyplot(yield~nitro, subset=(Block=="I" | Block=="II"), data=Oats,
group=Block, auto.key=T)
and adding "drop.unused.levels=T" does not fix it. And in fact even
the following does not solve the problem:
xyplot(yield~nitro,
2017 Oct 20
1
Error messages using nonlinear regression function (nls)
Hi
Keep your messages in the list, you increase your chance to get some answer.
I changed your data to groupedData object (see below), but I did not find any problem in it.
plot(wlg)
gives reasonable picture and I am not such expert to see any problem with data. Seems to me, that something has to be wrong with nlsList function.
> wheat.list <- nlsList(Prop ~ SSlogis(end,Asym, xmid,
2005 Oct 27
2
RSQLite problems
Hi, I'm experimenting with using (R)SQLite to do data management. Here are
two little problems that I've encountered:
1. The presence of ',' in string values causes trouble since ',' is also the
delimiter used in the SQL statement.
2. A newline '\n' line attached to the last string value of each row.
Some examples:
> library (RSQLite)
Loading required
2004 Feb 12
2
lattice: showing panels for factor levels with no values
How to show panels for factor levels of conditioning variables
which do have no values?
E.g. there are panels for "Grand Rapids" when they have values:
data( barley )
with( barley, dotplot(variety ~ yield | year * site, layout=c(6,2) ) )
There are no panels for "Grand Rapids"
when there are no values for "Grand Rapids":
my.barley <- subset( barley, ! ( site ==
2010 May 11
1
merge two data frames
Dear group,
I have these 2 following data frame:
allcon <-
structure(list(DESCRIPTION = structure(1:17, .Label = c("COFFEE C Jul/10",
"COPPER May/10", "CORN Jul/10", "CORN May/10", "COTTON NO.2 Jul/10",
"CRUDE OIL miNY May/10", "GOLD Jun/10", "HENRY HUB NATURAL GAS May/10",
"ROBUSTA COFFEE (10)
2012 Nov 15
1
strip.custom() with more than one conditioning variable
Suppose I wanted to plot the barley data like this:
dotplot(variety ~ yield | year+ site, barley,
strip = strip.custom(style = 4))
The factor levels are far too long for that to be useful. I can
overcome that problem if I shorten the levels like this:
dotplot(variety ~ yield | year + site, barley,
strip = strip.custom(style = 4,
factor.levels =
2006 Dec 08
1
lattice: defining an own function using args for "formula" and "groups"
x.fun <- function( formula, data ) dotplot( formula, data )
x.grp <- function( formula, groups, data ) dotplot( formula, groups, data )
data( barley )
> x.fun( variety ~ yield | site, data=barley )
# no problem
> dotplot( variety ~ yield | site, groups=year, data=barley )
# no problem
> x.grp( variety ~ yield | site, groups=year, data=barley )
object "year" not found
2010 Apr 29
3
convert Factor as numeric
Dear group,
I know this issue has been already covered, and before you reply I must say
I have read the R-FAQ and search the mailing list archive.
I still can't manage to change my factor to numeric as I couldn't find any
clear answer.
Here is my df :
Pose1 <-
structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L,
8L), .Label = c(" SUGAR NO.11 May/10 ", "COTTON
2010 Apr 14
6
sum specific rows in a data frame
I have a data frame called "pose":
DESCRIPTION QUANITY CLOSING.PRICE
1 WHEAT May/10 1 467.75
2 WHEAT May/10 2 467.75
3 WHEAT May/10 1 467.75
4 WHEAT May/10 1 467.75
5 COTTON NO.2 May/10 1 78.13
6 COTTON NO.2 May/10 3 78.13
7 COTTON NO.2 May/10 1 78.13
2002 Mar 27
0
Re: RE Vertical bars with barchart()
Hi,
[I'mm cc-ing r-help on this, since some others might be interested (Tony
Rossini is, at least)]
Yes, I saw your mail and was wondering about what would be the best approach
to do it. It's definitely not trivial, mainly because Trellis is not designed
to handle factors on the x-axis (chiefly for convenience, as factors typically
have long names which are difficult to write on the