2 0.922
> nlmod
Nonlinear regression model
model: Y ~ A + B * sin(C * X)
data: mydata
A B C
1.999 5.002 1.000
residual sum-of-squares: 0.007378
Number of iterations to convergence: 3
Achieved convergence tolerance: 1.499e-08
----
differences, not just the two smallest absolute values.
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun.
t;- 1:15
> z <- outer(x, y, "*")
> persp(x, y, z)
You must define a grid and specify a single value at each point on that
grid.
----------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX
Don't delete the context of the message. If you are sure that windowsize is
positive, are you also sure that it is less than length(inputseq)?
> seq(1, -10, 1)
Error in seq.default(1, -10, 1) : wrong sign in 'by' argument
----------
David L
commands to label it properly.
----------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of
[3,]3 NA 11
[4,] NA8 NA
> zdf[jx] <- NA
> zdf
X1 X2 X3
1 1 NA 9
2 NA 6 NA
3 3 NA 11
4 NA 8 NA
----------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Origi
select your own colors, line types, and add a
legend:
?matplot
?legend
If you want separate plots in one plot window:
par(mfrow=c(2, 3))
for (i in 1:5) {
plot(TSdata[,i], ylab=paste("V", i, sep=""), type="l")
}
--
David
In RStudio select the lines to be commented (or uncommented) and press
Ctrl+/ or select comment/uncomment on the Edit menu tab
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -O
.5), 0)
for (i in 11:20) X[,i] <- rnorm(20)
str(X) # structure of X
# convert numbers to factors for the first 10 columns
X2 <- X
for (i in 1:10) X2[,i] <- factor(X[,i])
str(X2)
------
David L Carlson
Associate Professor of Anthropology
Texas
interactions with that host. Use sample() to randomly draw
a host. You'll probably want to combine the vectors into a list to automate
the process over all parasites.
--
David L Carlson
Associate Professor of Anthropology
Texas A&M Universit
at packages xlsx, xlsReadWrite,
and R2wd.
----------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.
You didn't tell us what your problem is, but it probably relates to the fact
that mydata is never defined.
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message---
Look at the aggregate function to create a new data.frame in which you have
M rows that have the means of the K variables for each group. Then use
cluster analysis to cluster the M groups.
--
David L Carlson
Associate Professor of Anthropology
Texas A&a
Views from the list on the left.
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> pr
This overwrites the data so you might want to create a copy first.
example <- data.frame(V1=c(3, -1), V2=c(-2, 4), V3=c(4, 1))
tf <- ifelse(example<0, TRUE, FALSE)
example[tf] <- NA
apply(example, 1, mean, na.rm=TRUE)
----------
David L Carls
ant to clean up the rownumbers with
rownames(newdats) <- 1:nrow(newdats)
------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project
To generate multivariate normal distributions, you will want mvrnorm in
package MASS.
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Petr Savicky
> Sent: Tuesday, May 15, 2012 7:14 AM
> To: r-help@r-project.org
> Subject: Re:
capture.output(moransI, file="moransI.txt")
------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project.org [mai
Deepayan
Sarkar's webpage.
This is a simple example modified from the example in the lattice package
manual:
qqmath(~ rnorm(100),
panel = function(x, ...) {
panel.qqmathline(x, ...)
panel.qqmath(x, ...)
})
--
David L Carlson
Associate Prof
loop).
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Priya Bhatt
> Sent: Wednesday,
t
the formulas as factors. I don't get any NA's. I can also place a formula on
the second sheet that accesses data from the first sheet without any
problems. I haven't tried, Excel 2010.
Could your formulas be accessing data from another spreadsheet?
------
mod[,2:4] <- NA
# Recoded values into samplemod
for (i in 1:nrow(sample)) {
for (j in 2:4) {
if (!is.na(sample[i,j])){
if (sample[i, 5] == "A") {
samplemod[i,j] <- switch(sample[i,j], AA = 2,
AB = 1, BA = 1, BB = 0)
}
else {
if (sam
d
with one another or you have more variables than cases. The function prcomp
also computes PCs but it uses singular value decomposition rather than
matrix inversion.
------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
Colle
Here is a slightly different approach that takes advantage of recycling:
# Make 7 data frames
for (i in 1:7) {
assign(paste("TOWER", i, sep=""), data.frame(A=letters[1:4],
X=rnorm(4)))
}
# Add Tower column taking advantage of recyling
tnames <- paste("TOWER", 1:7, sep="")
for (i in 1:7) {
I should have added
TOWER$Tower <- factor(TOWER$Tower)
To the end to convert Tower from an integer to a factor.
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Origin
ccomplishes what you want
read<-read.xlsx("D:\\FYP\\image\\Cropped
Images\\user227\\user227forger.xlsx",
sheetName="Sheet1")
----------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 7784
2, sd) > 1e-10)]
----------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Chris Burns
> Sent: Wednesday,
ern[,2]])/2)
}
}
Combine(l1, l2)
This simply prints the results, but you didn't indicate how you wanted the
output organized.
----------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
>
2))
lnew <- lapply(1:length(l1), function(i)
(l1[[i]][,pattern[,1]]+l2[[i]][,pattern[,2]])/2)
lnew
If all the information from your several posts had been included in the
original request, we could have responded more quickly.
----------
David L Carlso
1 <- a
alag <- c(NA, a1[1:length(a1)-1])
# change NA to the value to use if the first value in a is NA
while (sum(is.na(a1)) > 0) {
a1 <- ifelse(is.na(a1), f*alag, a1)
alag <- c(NA, a1[1:length(a1)-1])
}
----------
David L Carlson
Associate
How about this?
exdf <- read.table("clipboard", sep=",", header=T, row.names=1)
extbl <- as.table(as.matrix(exdf))
----------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-
901 - 931 of 931 matches
Mail list logo