Displaying 20 results from an estimated 1000 matches similar to: "reshape question"
2008 Apr 30
2
Summary statistics across factor levels
R users,
I intention is to calculate some summary statistics across factor
levels. I know that in Hmisc package there is a summary function which
produces neat summary statistics when using "cross" option. I would
like to produce similar output with N and Missing columns but produce
a data.frame. Is there any built-in function for that?
#example data
install.packages("Hmisc")
2001 Dec 27
3
reshape error in 1.4 (PR#1231)
Full_Name: Kevin Wright
Version: 1.4
OS: Windows 95
Submission from: (NULL) (170.54.59.160)
Note: This was the 1.4 build for Windows that Brian Ripley made available.
The first example in the help for reshape doesn't work for me. When I cut and
paste, this is what happens:
> data(Indometh,package="nls")
> summary(Indometh)
Subject time conc
2008 Nov 14
1
Superimposing y-variables in Lattice formulas
Given a data frame of a categorical variable and two continuous
variables, I would like to display one continuous variable against the
other for each value of the categorical variable, all superimposed on
the same plot. For example:
data(Indometh); str(Indometh)
Classes 'nfnGroupedData', 'nfGroupedData', 'groupedData' and
'data.frame': 66 obs. of 3
2007 May 11
3
A simple question regarding plot of nls objects
Hi,
I was trying to run the example of Indomethacin kinetics from the book:
## From Pinheiro/Bates, Mixed-Effects-Models in S and S-Plus,
## Springer, Second Printing 2001, Section 6.2
library(nlme)
plot(Indometh)
fm1Indom.nls <- nls(conc~SSbiexp(time,A1,lrc1,A2,lrc2), data=Indometh)
summary(fm1Indom.nls)
plot(fm1Indom.nls,Subject~resid(.),abline=0)
## ....
the last plot command gives me the
2009 Dec 12
4
simple ts.plot question
*Respected Sir,
I have a simple question regarding plots of time series in R.
I have to plot "conc" against "time" **for each individual and display in
the same panel for the in-built dataset "Indometh" in R.
*
***I have six time series, say subject1.ts, subject2.ts, .............,
subject6.ts.
The observations are taken at an interval of 0.25 hr.
All of the series
2009 Feb 13
2
second axis title orientation
Hi,
I have added a second y-axis via axis() to a plot.
Then I tried to add an y axis title.
But the axis() function seems to have no argument like ylab.
and if I add a title with title() the text is centered at the first
axis, not the second defined one.
Is there a way to add an axis-title that orientates it's position at
the last defined axis?
2008 Sep 15
3
Problems changing to number from character
Hello all,
First of all, thanks for your examples to calculate the mode value. But now my problem is the next:
I have a?factor and I'm trying to convert it to number with as.numeric(x) but when I see the number it's different, I mean if I have:
b<-1,042
d<-as.numeric(b)
then when I show d, it appears 432 and I want to work with 1,042 because then I want to calculate the median of
2001 May 23
2
help: exponential fit?
Hi there,
I'm quite new to R (and statistics),
and I like it (both)!
But I'm a bit lost in all these packages,
so could someone please give me a hint
whether there exists a package for fitting
exponential curves (of the type
t --> \sum_i a_i \exp( - b_i t))
on a noisy signal?
In fact monoexponential decay + polynomial growth
is what I'd like to try.
Thanks in advance,
2006 Jul 24
3
random section of samples based on group membership
Hi all,
I have a matrix of 474 rows (samples) with 565 columns (variables).
each of the 474 samples belong to one of 120 groups, with the
groupings as a column in the above matrix. For example, the group
column would be:
1
1
1
2
2
2
.
.
.
120
120
I want to randomly select one from each group. Not all the groups
have the same number of samples, some have 4, some 3 etc. Is there a
function to
2007 Aug 23
0
Lost in substitute: nlsList and nlme with dynamic formula
DeaR
I am trying to use a dynamically create formula with nlsList and nlme, but I
cannot get the environment of the string-generated formal to work similarly
to the manually entered one.
Any idea?
Dieter
#-----
library(nlme)
# Pinheiro/Bates p 280
fm1Indom.lis = nlsList(conc~SSbiexp(time,A1,lrc1,A2,lrc2),
data=Indometh)
nlme(fm1Indom.lis,random=pdDiag(A1+lrc1+A2~1))
# works...
# Simulating
2010 Apr 26
1
finite difference scheme for 2D differential equations
Hello everyone,
I am trying to solve 2D differential equations using finite difference
scheme in R. I have been able to work with the equations with only one
spatial dimensions but I want to extend it to the two dimensional problem.
For example i can simulate one dimensional diffusion using a code like the
following. But I want to write a similar code for,say, a two dimensional
diffusion
2005 Oct 13
1
problems with loop and plot function
Hi all R users,
I have problems with my second loop for drawing the three curves in the
same graphic. I need help please
Thank you in advance
#########################################################################
simulation <- function(k, n){
conc <- seq(0,100,by=0.5)
#choixg <- seq(1, length(conc))
choixg <- rep(0,length(conc))
for (i in 1:length(conc)){
choixg[i] <- (k
2005 Oct 11
2
Problems with plot function
Hello all R users,
My simulation function works correctly, but I have problems with plot
function. You will find the following code using it.
Thank you for your help
##################################################"
simulation <- function(k, n){
conc <- seq(0,10,by=0.5)
#choixg <- seq(1, length(conc))
choixg <- rep(0,length(conc))
for (i in 1:length(conc)){
choixg[i]
2008 Nov 11
2
strsplit (regex)
#how do I break these up into first two letters (RM), number, and then
the last part
#is there an easily accessible regex tutorial on the internet?
v = (structure(1:122, .Label = c("RM215Temp", "RM215SpCond", "RM215DO.Conc",
"RM215Depth", "RM215pH", "RM215ORP", "RM215Turbidity.", "RM215Battery",
"RM215DO.",
2023 Oct 24
2
How to Calculate the Mean by Multiple Groups in R
Hi,
I think you're misunderstanding which set of variables go on either
side of the formula.
Is this what you're looking for?
> aggregate(OD ~ Time + Target + Conc, data = df, FUN = "mean")
Time Target Conc OD
1 1 BACT 1 765.3333
2 1 BACT 2 745.3333
3 1 BACT 3 675.0000
> aggregate(ODnorm ~ Time + Target + Conc, data = df, FUN =
2012 Aug 07
2
Passing arguments to a function within a function ...
Hallo Everybody
How do you specify arguments for a function used within another function?
Here is my problem:
I am reconstructing a calculator for the burden of disease due to air
pollution from publications and tools published by the WHO. The
calculations make use of published dose-response relationships for
particular health end-points. This is then applied to populations with
known or
2023 Oct 24
1
How to Calculate the Mean by Multiple Groups in R
Also,
> aggregate(cbind(OD, ODnorm) ~ Time + Target + Conc, data = df, FUN = "mean")
Time Target Conc OD ODnorm
1 1 BACT 1 765.3333 108.33333
2 1 BACT 2 745.3333 88.33333
3 1 BACT 3 675.0000 18.00000
(You might wish for "cbind(OD,ODnorm) ~ . - Well", but aggregate.formula is not smart enough for that.)
-pd
> On 24 Oct 2023, at
2005 Sep 14
1
Long lines with Sweave
I have used Sweave a lot the latest year, but never really used any long
function calls.
If I have code which look like this
-------------------------------------------------------------
gof <- benthic.flux(ID="Gulf of Finland",
meas.conc=conc,
bw.conc=bw.conc,
time=times,
2006 Jul 18
2
Using corStruct in nlme
I am having trouble fitting correlation structures within nlme. I would like to
fit corCAR1, corGaus and corExp correlation structures to my data. I either
get the error "step halving reduced below minimum in pnls step" or
alternatively R crashes.
My dataset is similar to the CO2 example in the nlme package. The one major
difference is that in my case the 'conc' steps are
2005 Apr 19
3
Help with predict.lm
Hi
I have measured the UV absorbance (abs) of 10 solutions of a substance at
known concentrations (conc) and have used a linear model to plot a
calibration graph with confidence limits. I now want to predict the
concentration of solutions with UV absorbance results given in the new.abs
data.frame, however predict.lm only appears to work for new "conc" variables
not new "abs"