Displaying 20 results from an estimated 10000 matches similar to: "densities from a list with data.frames"
2008 Oct 06
3
horizontal boxplot + xlim
Hi there,
I get a strange behaviour of a boxplot with the following code. There seems to
be a problem with the xlim-parameter. Did I do anything wrong? What else can I
do to force the boxplot to have a defined x-range?
x <- rnorm(100)
boxplot(x, notch=TRUE, xlab=parameter, xlim <- c(-4,4), horizontal = TRUE)
Antje
2008 Dec 05
6
levels update
Hello,
I hope this question is not too stupid. I would like to know how to update
levels after subsetting data from a data.frame.
df <- data.frame(factor(c("a","a","c","b","b")), c(4,5,6,7,8), c(9,1,2,3,4))
names(df) <- c("X1","X2","X3")
my.sub <- subset(df, X1 == "a" | X1 == "b")
2006 Aug 23
5
two density curves in one plot?
Hello,
I was wondering if I can plot two curves I get from "density(data)" into
one plot. I want to compare both.
With the following commad, I just get one curve plotted:
plot( density(mydata) )
Sorry for this stupid question but I could not find a solution until now...
Antje
2011 May 23
1
How is the relation between Frequency and Counts in hist/density defined?
Hi all,
I'm looking to add a "density" smoother on top of a hist when Freq=T.
In order to do this I can use the relation between count and density, but I
would like to know if there is a way for me to predict it upfront.
Here is an example:
set.seed(242)
z = rnorm(30)
hist_z <- hist(z)
hist_z$counts / hist_z$density # the relation is 15
# why is this 15 ??
# So I can now do:
2008 Feb 05
2
two densities with same stepsize
Hi there,
I have two series of data. plotting the density function of both gives me an
idea about the difference of the data. But I would like to quantify the
difference I see.
a <- rnorm(100)
b <- rnorm(100)
da <- density(a)
db <- density(b)
The problem is that da$x and db$x are different and so I have difficulties to
compare them... Is there any way to force the density
2008 Sep 01
1
warning with hist
Hello everybody,
I don't understand the warning I get when executing the following code:
x <- rnorm(100)
h <- hist(x, plot= FALSE, freq = FALSE)
If I don't use the plot-argument, I don't get a warning...
Any explanations for me?
Antje
2009 May 21
1
[newbie] how to do a 3d plot of bivariate density?
Hello everybody.
I am new to R. Yesterday I passed the afternoon reading the
introduction and language reference, but I could'nt find a way to do a
3d plot of the density of a data table of size 2.
I am trying with:
plot(density(t(t2)))
but it mixes the two columns and calculate the density like it is a
1-dimensional casual variable.
I have looked at the documentation of density, but I was
2007 Feb 15
1
sapply and its return value
Hello,
I have some problems with sapply. I wanted to do the following:
s <- sapply(filelist, function(x) {
if(file.exists(x))
{
...
return( list(density(file$V1)$x, density(file$V1)$y))
}
else
{
print(paste("plotDensity ERROR - File does not exist: ",x,sep=""))
return( NULL)
}
})
if(is.null( - ??? - ))
{
print("no plot")
}
That
2008 Sep 01
3
another histogram question
Hi there,
I hope this question is not as stupid as the one before ...
I tried to shorten my histogram (because the distribution is quite skewed and I
simply don't want to see the long tail but still use the histogram plot). How
can I do something like this? (The example does not work but I don't know why...)
data <- rnorm(100) # as example, of course this is not skewed...
h <-
2008 Dec 05
1
Legend and Main Title positioning
Hi folks,
can anybody give me a hint how to solve the following problem?
I have several plots in one window like this:
layout(matrix(c(1,2,3,4), nrow = 2, byrow = TRUE))
plot(rnorm(100))
plot(rnorm(200))
plot(rnorm(300))
plot(rnorm(400))
Now, I'd like to create a legend below each plot and generate a common title.
How can I do that?
Antje
2011 Feb 11
2
fitdistr question
Hello,
I tried to fit a poisson distribution but looking at the function
fitdistr() it does not optimize lambda but simply estimates the mean
of the data and returns it as lambda. I'm a bit confused because I was
expecting an optimization of this parameter to gain a good fit...
If I would use mle() of stats4 package or mle2() of bbmle package, I
would have to write the function by myself
2006 Oct 31
5
Odd behaviour of removing 'nothing' from an array or data frame
I've just found some behaviour which strikes me as odd, but I'm not sure
whether it's a bug or a feature. If you don't mind, I'd like to explain
via a couple of examples.
Let x = 1:10.
Then intuitively, to me at least, the command x[-integer(0)] should leave
x untouched. However the actual output under R2.4.0 is integer(0).
A slightly more involved example demonstrates
2011 Feb 21
2
Console output
Hi there,
I though there has been a possibility to force the output on the
console with one element per line. Instead of this:
> 1:10
[1] 1 2 3 4 5 6 7 8 9 10
something like this
> 1:10
[1] 1
[2] 2
[3] 3
[4] 4
[5] 5
[6] 6
[7] 7
[8] 8
[9] 9
[10] 10
Can anybody help?
Antje
2009 Jul 14
2
nls - find good starting values
Hi there,
it might be a very simple question and I'd be glad to even get a link to
some useful documentation...
I have several data sets, I'd like to fit to a gaussian distribution.
I've tried to give an estimate of the mean and the sd of this
distribution but still, I run into problems if these estimates are not
close enough.
For example, nls() breaks with this message:
singular
2009 May 28
3
R help
Dear Sir
I am new user of R.
I am interested in modeling hydrological extreme events. I found MSClaio2008 very interesting function. In this function four criterions for choosing distributions. Can we call these criterions as model selection techniques or goodness of fit techniques or both? Because goodness of fit techniques are usually performed after modle selection.
Can I found
2008 Apr 28
5
Combine Values into a Vector or List
Hi all,
I have the following
x1<-paste("A", 1:6, sep = "")
x2<- round(rgamma(6,2,1))
x3<-paste("B", 1:6, sep = "")
x4<- round(rgamma(6,2,1))
data1 <- data.frame(x1,x2,x3,x4)
I would like to get
data2 <- c(A1=4, A2=1, A3=0,...)
Is there any standard for such a case?
Thank you very much in advance,
Diego
2008 Oct 07
3
Fitting weibull, exponential and lognormal distributions to left-truncated data.
Dear All,
I have two questions regarding distribution fitting.
I have several datasets, all left-truncated at x=1, that I am attempting
to fit distributions to (lognormal, weibull and exponential). I had
been using fitdistr in the MASS package as follows:
fitdistr<-(x,"weibull")
However, this does not take into consideration the truncation at x=1. I
read another posting in this
2007 Dec 13
6
ls() pattern
Hello everyone,
I get some data in the following format and I would like to combine them to
form a dataframe.
The data is like:
cbcname1 = 0.1,
cbcname2= 0.2,
cbcname3=0.3,...
name1, name2, name2 are just some random names. I would like to achieve sth
like:
(cbcname1=0.1, cbcname2=0.2, cbcname3=0.3,......)
I am using the following codes
do.call(cbind,
2007 Dec 06
2
Any package for deconvolution?
I want to run deconvolution of a time series by an impulse or point-spread function through Wiener filter, regularized filter, Lucy-Richardson method, or any other approaches. I searched the CRAN website and the mailing list archive, but could not find any package for such a deconvolution analysis. Does anybody know an existing R function for deconvolution?
TIA,
Gang
2008 Jan 17
4
aaMI
hi
i am new to R language. I want to use aaMI package which calculates the
amino acid mutual interaction for a given protein sequence. I had installed
the package but when i run the program it gives me the error could not find
function "aaMI". can anyone tell me what might be the problem..
--
View this message in context: http://www.nabble.com/aaMI-tp14915744p14915744.html
Sent from