Displaying 20 results from an estimated 400 matches similar to: "Lm function: Error in model.frame.default"
2009 Oct 07
1
Buglet in qbeta?
Hi,
I sometimes play around with extreme parameters for distributions and
found that qbeta is not always monotone as the following example shows.
I don't know whether this is serious enough to submit a bug report (as
this example is near to the limitations of floating point arithmetic).
Josef
> x <- qbeta((0:100)/100,0.01,5)
> x
[1] 0.000000e+00 1.253990e-201 1.589622e-171
2008 Feb 12
4
summary statistics
below is my data frame. I would like to compute summary statistics
for mgl for each river mile (mean, median, mode). My apologies in
advance- I would like to get something like the SAS print out of PROC
Univariate. I have performed an ANOVA and a tukey LSD and I would
just like the summary statistics.
thanks
stephen
RM mgl
1 215 0.9285714
2 215 0.7352941
3 215 1.6455696
4 215
2007 May 05
1
(no subject)
Dear Mailing-List,
I think this is a newbie question. However, i would like to integrate a
loop in the function below. So that the script calculates for each
variable within the dataframe df1 the connecting data in df2. Actually it
takes only the first row. I hope that's clear. My goal is to apply the
function for each data in df1. Many thanks in advance. An example is as
follows:
df1
2007 Jul 17
1
distance function (analogue)
Hello R-Users,
its again me with a question.
I´m using R 2.5.0 on Mac Power Book running Mac OS X 10.4.10
I try to calculate distances betweeen two data tables looking like this
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18
V19 V20 V21 V22 V23 V24 V25 V26 V27 V28 V29 V30 V31 V32 V33 V34 V35 V36
1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1
0 0
2008 Feb 01
1
calculation fraction/ratio
Dear R users
I wonder if there is a quick way to calculate the ratio/fraction of a
list/data frame. For example, if I have a data frame with two fields:
"Index" and "A". I would like to know the fractions of A's within the same
"Index". That is, for Index =1, three fractions will be "1/(1+2+3)=0.17",
"2/(1+2+3)=0.33", and
2010 Jun 06
1
I need help in analyzing
I'm sory for my weak english. I need to analyze this subject :
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 y
0 0 1 0 0 1 0 0 1 0 czarne
1 1 0 0 0 0 1 0 0 0 rude
0 0 1 0 0 1 1 0 0 0 braz
0 0 1 0 1 0 1 0 0 0 blond
1 0 0 0 0 1 0 0 0 1 rude
1 1 0 0 0 0 0 0 0 1 blond
0 0 1 1 0 0 0 0 1 0 czarne
1 0 0 1 0 0 1 0 0 0 blond
0 0 1 0 0 1 1 0 0 0 blond
1 0 0 0 0 1 1 0 0 0 czarne
0 0 1 0 0 1 0 0 0 1 czarne
1 0 1 0 0 0
2013 Oct 18
1
read table and import of a text file
Hi,
Assuming that you provided the sample data from the file.
temp <- readLines(textConnection("#Hogd/met, Temp, 005[M], Value
#Hogd/met, Difftemp, 051[M], Value
BA0+
1 MTEMP005 1 [deg.C]
2 MDTMP051 1 [deg.C]
EOH
891231, 2400, -1.5, -0.21,
900101, 0100, -1.4, -0.25,
900101, 0200, -1.6, -0.28,
900101, 0300, -1.7, -0.25,
900101, 0400, -2.1, -0.0999999,
900101, 0500, -2.3, -0.0899999,
2006 Apr 17
0
Problem getting R's decision tree for Quinlan's golf exam ple data [Broadcast]
See ?rpart.control. I get:
> golf.rp = rpart(Outlook ~ ., golf, control=rpart.control(minsplit=1))
> golf.rp
n= 14
node), split, n, loss, yval, (yprob)
* denotes terminal node
1) root 14 9 rain (0.2857143 0.3571429 0.3571429)
2) Temperature< 71.5 6 2 rain (0.1666667 0.6666667 0.1666667)
4) Temperature< 64.5 1 0 overcast (1.0000000 0.0000000 0.0000000) *
5)
2007 Oct 17
1
How to save association rules generated by arules package
Hi,
I have been able to generate association rules for Market Basket Analysis
using the following codes:
****************************************************************************
*******************************************
library("arules")
rules <- read.csv("write1.csv",na.strings=c(".", "NA", "", "?"),header=TRUE)
2010 Oct 01
1
Question about Reduce
Hello!
In the example below the Reduce() function by default assigns "a" to
be the last accumulated value and "b" to be the current value in "x".
I could not find this documented anywhere as the default settings for
the Reduce() function. Does any sort of documentation for this
behavior exist?
x <- c(0,0,0,0,0,1,0,0,0,5,0,0,0,7,0,0,0,8,5,10)
2009 Jul 26
2
problems hist() and density
Hello,
I have a problem with the hist() function and showing densities. The
densities sum to 50 and not to 1! I use R version 2.9.1 (2009-06-26) and
I load the seqinR library.
My data is the following vector:
[1] 0.1400000 0.2000000 0.2200000 0.2828283 0.1600000 0.1600000
0.3600000
[8] 0.1600000 0.2200000 0.2600000 0.2000000 0.3000000 0.2200000
0.2342342
[15] 0.1800000 0.2200000 0.1600000
2013 Nov 28
1
Relative Cumulative Frequency of Event Occurence
Hi,
My objective is to calculate "Relative (Cumulative) Frequency of Event
Occurrence" - something as follows:
Sample.Number 1st.Fly 2nd.Fly Did.E.occur? Relative.Cum.Frequency.of.E
1 G B No 0.000
2 B B Yes 0.500
3 B G No 0.333
4 G B No 0.250
5 G G Yes 0.400
6 G B No 0.333
7 B B Yes 0.429
8 G G Yes 0.500
9 G B No 0.444
10 B B Yes 0.500
Please refer to the code below:
2009 Jan 23
1
Anova and unbalanced designs
Dear R-list!
My question is related to an Anova including within and between subject
factors and unequal group sizes.
Here is a minimal example of what I did:
library(car)
within1 <- c(1,2,3,4,5,6,4,5,3,2); within2 <- c(3,4,3,4,3,4,3,4,5,4)
values <- data.frame(w1 = within1, w2 = within2)
values <- as.matrix(values)
between <- factor(c(rep(1,4), rep(2,6)))
betweenanova <-
2010 Apr 29
1
R Anova Analysis
Dear all,
I have a quite basic questions about anova analysis in R, sorry for
this, but I have no clue how to explain this result.
I have two datasets which are named: nmda123, nmda456. Each dataset has
three samples which were measured three times. And I would like to
compare means of them with Posthoc test using R, following please see
the output:
(CREB, mCREB and No virus are the name of
2010 May 06
5
frequency
Dear list,
Im trying to do the following operation but im not able to do it
This is my table:
1 2 3
1 0 7 4
2 0 2 0
3 0 1 3
4 0 3 4
what i would like to do is
divide each row values with the corresponding column' sum,namely:
1 2 3
1 0 0.54 0.36
2 0 0.15 0
3 0 0.08
2009 Jun 10
1
R: Best way to plot a Matrix of all possible pair combinations
Hallo R Users,
Please help
I have some distance matrix data like
> M[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.8750000 0.5000000 0.5000000 0.3750000 0.6250000 0.00000000
[2,] 0.8928571 1.0000000 0.0000000 0.8928571 0.1071429 0.00000000
[3,] 0.8928571 1.0000000 0.0000000 0.8928571 0.1071429 0.00000000
[4,] 0.8928571 1.0000000 0.0000000 0.8928571
2006 Sep 17
2
histogram frequency weighing
Fellow R-helpers,
Suppose we create a histogram as follows (although it could be any vector
with zeroes in it):
R> lenh <- hist(iris$Sepal.Length, br=seq(4, 8, 0.05))
R> lenh$counts
[1] 0 0 0 0 0 1 0 3 0 1 0 4 0 2 0 5 0 6 0 10 0 9 0 4 0
[26] 1 0 6 0 7 0 6 0 8 0 7 0 3 0 6 0 6 0 4 0 9 0 7 0 5
[51] 0 2 0 8 0 3 0 4 0 1 0 1 0 3
2013 Apr 17
2
On matrix calculation
Hello again,
Let say I have a matrix:
Mat <- matrix(1:12, 4, 3)
And a vector:
Vec <- 5:8
Now I want to do following:
Each element of row-i in 'Mat' will be divided by i-th element of Vec
Is there any direct way to doing that?
Thanks for your help
2009 Jul 17
1
Arules questions. I need some help please
Question 2a)
I am also working with arules package and I have the following problem
let suppose the matrix b like:
b<-matrix(c(1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1),nrow=6)
rownames(b)=c("T1", "T2", "T3", "T4", "T5", "T6")
colnames(b)=c("It1", "It2", "It3", "It4")
bt<-as(b,
2010 Apr 18
3
xtabs() of proportions, and naming a dimension (not a row)
Hi,
xtabs() creates a table of counts. I want a table of proportions -- that
is, I want to divide every vector (along a particular dimension) by its sum.
The tiny example below does that. The call to xtabs() creates a matrix "A"
with dimensions ("x1","x2","y"). I transform "A" using aperm() and aaply()
to get the matrix "B". The