Re: [R] integrating multi-dimensional dat along one dimension

2012-07-13 Thread David L Carlson
set.seed(42) d - array(as.integer(round(runif(125)*10, 0)), dim=c(5, 5, 5)) data_int - apply(d, c(1,2), sum) - David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77840-4352 - Original Message - From: Sam B

Re: [R] Adjusting format of boxplot

2012-07-12 Thread David L Carlson
the x-axis. axis(1, at=seq(10, 110, 20)) - David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77840-4352 - Original Message - From: darnold dwarnol...@suddenlink.net To: r-help@r-project.org Sent: Thursday

Re: [R] Adjusting format of boxplot

2012-07-12 Thread David L Carlson
=list(las=1, ylim=c(10, 110), xaxt=n), horizontal = TRUE, col = red) axis(1, at=seq(10, 110, 20)) par(oldpar) - David - David L Carlson Associate Professor of Anthropology Texas AM University College

Re: [R] Computing inverse cdf (quantile function) from a KDE

2012-07-11 Thread David L Carlson
Something like this? library(KernSmooth) x - rnorm(100) KS - bkde(x) diff - KS$x[2] - KS$x[1] yc - cumsum(KS$y*diff) approx(yc, KS$x, runif(1000)) If you are going to use approx() repeatedly, you can create a function with approxfun(). - David L Carlson

Re: [R] Mann-Whitney by group

2012-07-07 Thread David L Carlson
, Dtb) # Compute all the tests apply(Dtb[,3:10], 2, function(x) wilcox.test(x~Dtb$Group)) # Error relates to column B which is constant -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Declaring a density function with for loop

2012-07-07 Thread David L Carlson
dnewdis - function(x, a, b, n) { i - 0:exp(10) term -sum-1)**i)*(choose(b-1,i))*(beta(x+a+a*i,n-x+1 a*b*choose(n,x)*term } -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Tables extraction in R ?

2012-07-07 Thread David L Carlson
) -- David L Carlson Associate Professor of Anthropology Texas AM 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 John Kane Sent: Friday, July 06, 2012 12:55 PM

Re: [R] convert a table

2012-07-06 Thread David L Carlson
, max) newtbl - apply(tbl, 2, function(x) ifelse(xrowmx, 0, x)) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] convert a table

2012-07-06 Thread David L Carlson
-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of David L Carlson Sent: Friday, July 06, 2012 10:52 AM To: 'Amanduh320'; r-help@r-project.org Subject: Re: [R] convert a table A table is a matrix Filename - sample(LETTERS[1:5], 50, replace=TRUE) PREDICT - sample(1:7

Re: [R] Mann-Whitney by group

2012-07-06 Thread David L Carlson
() to create a readable version that can be pasted into a plain text email (don't use html) usually results in a faster response. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original

Re: [R] help in R programming

2012-07-06 Thread David L Carlson
Please hold. The r-help hive mind is attempting to probe your brain for further details of your problem related to Poisson Ridge Regression. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Heat Maps

2012-07-02 Thread David L Carlson
Something like this? image(x, y, outer(x, y, u), breaks=c(0, a), col=heat.colors(3)) contour(x, y, outer(x, y, u),levels=a, col=blue, add=TRUE) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] list to dataframe conversion-testing for identical

2012-07-01 Thread David L Carlson
the dat1 factors back to numeric. You would be fine with just dat1 - data.frame(listdat1) colnames(dat1) - paste0(Var, 1:3) Or you can name the list elements and then convert names(listdat1) - paste0(Var, 1:3) dat1 - data.frame(listdat1) -- David L

Re: [R] Help

2012-06-29 Thread David L Carlson
using color and changing the size of the boxes to make them visible. boxplot(A) boxplot(B, border=red, boxwex=.7, add=TRUE) boxplot(C, border=blue, boxwex=.6, add=TRUE) -- David L Carlson Associate Professor of Anthropology Texas AM University College

Re: [R] assign object with loop (translation from SAS to R)

2012-06-29 Thread David L Carlson
columns idx - expand.grid(2:9, 1:8) colnames(idx) - c(j, i) # Compute products in DM2 and label columns DM2 - DM[idx$i]*DM[idx$j] colnames(DM2) - paste0(p, idx$i, p, idx$j) # Combine original data with products DM - data.frame(DM, DM2) -- David L

Re: [R] Insert row in specific location between data frames

2012-06-29 Thread David L Carlson
step and merge everything at once. rbind() gives you a # data frame, but the row.names are messed up, this command fixes that d2 - data.frame(rbind(topdata, nadata, bottomdata), row.names=NULL) -- David L Carlson Associate Professor of Anthropology Texas

Re: [R] Insert row in specific location between data frames

2012-06-29 Thread David L Carlson
[11:nrow(dat1), , drop=FALSE] nadata - data.frame(dat1=NA) d2 - data.frame(rbind(topdata, nadata, bottomdata), row.names=NULL) Error in match.names(clabs, names(xi)) :   names do not match previous names A.K. - Original Message - From: David L Carlson dcarl...@tamu.edu

Re: [R] Error: figure margins too large

2012-06-28 Thread David L Carlson
that. -- David L Carlson Associate Professor of Anthropology Texas AM 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 Karly Harrod Sent: Wednesday, June 27, 2012

Re: [R] question about formatting Dates

2012-06-27 Thread David L Carlson
/2011 format(as.Date(dates, %m/%d/%Y), %m/%d/%Y) [1] 01/02/2011 01/04/2011 01/04/2011 01/04/2011 01/06/2011 [6] 01/07/2011 01/08/2011 01/09/2011 01/10/2011 -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX

Re: [R] formula version of sunflowerplot() fails when axis label specified

2012-06-27 Thread David L Carlson
=) sunflowerplot(Sepal.Length~Sepal.Width, data=iris, add=TRUE) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r

Re: [R] formula version of sunflowerplot() fails when axis label specified

2012-06-27 Thread David L Carlson
Or just avoid the formula version: with(iris, sunflowerplot(Sepal.Width, Sepal.Length, xlab=A)) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun

Re: [R] chisq.test

2012-06-26 Thread David L Carlson
more data. -- David L Carlson Associate Professor of Anthropology Texas AM 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 Omphalodes Verna

Re: [R] How to plot grouped bar plot in R?

2012-06-22 Thread David L Carlson
(t(DatFile[,2:3]), beside=TRUE, horiz=TRUE) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org

Re: [R] scatter.smooth() line colour

2012-06-22 Thread David L Carlson
You are correct about scatter.smooth, but loess.smooth (listed along with scatter.smooth on the same help page) gives you the way to get what you want: x - rnorm(25) y - rnorm(25) plot(x, y) lines(loess.smooth(x,y), col=red, lty=2, lwd=2) -- David L

Re: [R] 3D version of triax.plot (package plotrix)

2012-06-22 Thread David L Carlson
Look at quadplot in package klaR. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org

Re: [R] prcomp: where do sdev values come from?

2012-06-21 Thread David L Carlson
This should help you figure it out: getAnywhere(prcomp.default) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] weird --no 'dimnames' attribute for array-- error for R lordif package

2012-06-20 Thread David L Carlson
You probably need to contact the lordif package maintainer: Maintainer Seung W. Choi s-c...@northwestern.edu -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From

Re: [R] Plotting tidal speed and direction in R

2012-06-20 Thread David L Carlson
/RGM2/ and then typing package:CircSpatial into the search box. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r

Re: [R] Biplot - how can I make it more readable?

2012-06-19 Thread David L Carlson
Take a look at the posting instructions: http://www.R-project.org/posting-guide.html to see how to attach a file. Yours did not make the trip. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Smoothing a persp graph

2012-06-19 Thread David L Carlson
look at the Spatial Task View: http://cran.r-project.org/web/views/Spatial.html -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org

Re: [R] Smoothing a persp graph

2012-06-19 Thread David L Carlson
, at 10:02 AM, David L Carlson wrote: kde2d is for two dimensional data. The persp graph is 3d. Huh? The question asked about plotting data that was 2d. The third dimension was to be the density. kde2d in package MASS or the similarly named function in package KernSmooth would seem

Re: [R] Scaling a density.

2012-06-19 Thread David L Carlson
) -- David L Carlson Associate Professor of Anthropology Texas AM 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 Keith Weintraub Sent: Tuesday, June 19, 2012 11:00 AM To: Bert Gunter Cc: r

Re: [R] R start screen

2012-06-15 Thread David L Carlson
have installed R Commander, for example you were instructed to change it to MDI = No. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r

Re: [R] plot cdf

2012-06-14 Thread David L Carlson
-- David L Carlson Associate Professor of Anthropology Texas AM 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 MSousa Sent: Thursday, June 14, 2012 4

Re: [R] Median line with stripchart

2012-06-14 Thread David L Carlson
), medians, pch=-, cex=3, col=red) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: Luigi [mailto:marongiu.lu...@gmail.com] Sent: Wednesday, June 13, 2012 6:44 PM

Re: [R] R matrix help

2012-06-14 Thread David L Carlson
If the number of elements is 12, the dimensions could be 1x12, 12x1, 2x6, 6x2, 3x4, or 4x3. How did you decide on 3x4? -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

Re: [R] help

2012-06-13 Thread David L Carlson
?Lognormal -- David L Carlson Associate Professor of Anthropology Texas AM 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 Natalia Martins

Re: [R] Rotating characters in text

2012-06-13 Thread David L Carlson
Or for the y label and using gsub: plot(1:5, ylab=) text(.35,3, gsub((.), \\1\n, Like this), xpd=TRUE) Sticking it in ylab= does not work. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Median line with stripchart

2012-06-13 Thread David L Carlson
- rep(1:3, 25) stripchart(x~g) abline(v=median(x), lty=2) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r

Re: [R] generating random samples of IG distribution

2012-06-11 Thread David L Carlson
For the normal inverse Gaussian: Package 'GeneralizedHyperbolic' For the generalized inverse Gaussian: Package 'GeneralizedHyperbolic' -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] generating random samples of IG distribution

2012-06-11 Thread David L Carlson
Should have been For the normal inverse Gaussian: Package 'GeneralizedHyperbolic' For the generalized inverse Gaussian: Package 'HyperbolicDist' -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Kruskal Wallis Post hoc

2012-06-11 Thread David L Carlson
Look at kruskalmc in package pgirmess and package multcomView for plotting the results. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r

Re: [R] Converiting longitude/latitude to utm

2012-06-05 Thread David L Carlson
=WGS84 coordinatesUTM-spTransform(SP,CRS(+proj=utm +zone=52)) coordinatesUTM SpatialPoints: coords.x1 coords.x2 [1,] 240015.6 -1582256 Coordinate Reference System (CRS) arguments: +proj=utm +zone=52 +ellps=WGS84 -- David L Carlson Associate

Re: [R] Why do I have a column called row.names?

2012-06-04 Thread David L Carlson
). -- David L Carlson Associate Professor of Anthropology Texas AM 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 Ed Siefker Sent: Monday, June 04, 2012 12:47 PM

Re: [R] Why do I have a column called row.names?

2012-06-04 Thread David L Carlson
the same when row.names=NULL and FILL=TRUE is included). -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: Ed Siefker [mailto:ebs15...@gmail.com] Sent: Monday, June

Re: [R] Automated essay scoring by R

2012-05-31 Thread David L Carlson
. The documentation for package lsa is located at http://cran.r-project.org/web/packages/lsa/lsa.pdf -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r

Re: [R] cluster with mahalanobis distance

2012-05-31 Thread David L Carlson
Use distance() in package ecodist to compute the mahalanobis distance matrix and pass that to hclust(). -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help

Re: [R] print.data.frame to string?

2012-05-31 Thread David L Carlson
It will work if you paste a \n to the end of each line: a - data.frame(x=runif(4), y=runif(4), z=runif(4)) b - capture.output(a) c - paste(b, \n, sep=) cat(Your data set is:\n, c, \n) -- David L Carlson Associate Professor of Anthropology Texas AM

Re: [R] import contingency table

2012-05-28 Thread David L Carlson
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 AM University College Station, TX 77843-4352 -Original Message- From

Re: [R] applying cbind (or any function) across all components in a list

2012-05-25 Thread David L Carlson
(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 Carlson Associate Professor

Re: [R] Filling NA with cumprod?

2012-05-25 Thread David L Carlson
- 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 Professor of Anthropology Texas AM

Re: [R] Exclude when sd=0

2012-05-24 Thread David L Carlson
)] -- David L Carlson Associate Professor of Anthropology Texas AM 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, May 23, 2012 7:45 PM To: r-help@r

Re: [R] applying cbind (or any function) across all components in a list

2012-05-24 Thread David L Carlson
) } } 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 AM University College Station, TX 77843-4352 -Original Message

Re: [R] write.xls

2012-05-23 Thread David L Carlson
read-read.xlsx(D:\\FYP\\image\\Cropped Images\\user227\\user227forger.xlsx, sheetName=Sheet1) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r

Re: [R] Loop Help

2012-05-21 Thread David L Carlson
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) {

Re: [R] Loop Help

2012-05-21 Thread David L Carlson
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 AM University College Station, TX 77843-4352 -Original Message- From

Re: [R] Finding the principal components

2012-05-18 Thread David L Carlson
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 AM University College Station, TX 77843

Re: [R] Help needed for efficient way to loop through rows and columns

2012-05-17 Thread David L Carlson
{ if (sample[i, 5] == B) { samplemod[i,j] - switch(sample[i,j], AA = 0, AB = 1, BA = 1, BB = 2) } } } } } -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843

Re: [R] Help needed for efficient way to loop through rows and columns

2012-05-16 Thread David L Carlson
). -- David L Carlson Associate Professor of Anthropology Texas AM 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, May 16, 2012 3:08 AM To: r

Re: [R] Reading Excel Formulas as values

2012-05-16 Thread David L Carlson
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? -- David L

Re: [R] How to Un-group a grouped data set?

2012-05-15 Thread David L Carlson
to clean up the rownumbers with rownames(newdats) - 1:nrow(newdats) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] Probabilistic aggregation

2012-05-15 Thread David L Carlson
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: [R]

Re: [R] save to Rdata file and to txt

2012-05-15 Thread David L Carlson
capture.output(moransI, file=moransI.txt) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org

Re: [R] Lattice: Add abline to Single Value qqmath() Plot

2012-05-15 Thread David L Carlson
on 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 Professor

Re: [R] Help with writing data to csv

2012-05-14 Thread David L Carlson
. -- David L Carlson Associate Professor of Anthropology Texas AM 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 DL Sent: Saturday, May 12, 2012 3:33 PM To: r

Re: [R] how to write data using xlsReadWrite

2012-05-14 Thread David L Carlson
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 AM University College Station, TX 77843-4352 -Original Message- From: r

Re: [R] How do I do group wise clustering in R?

2012-05-14 Thread David L Carlson
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 AM

Re: [R] New to R

2012-05-14 Thread David L Carlson
Views from the list on the left. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf

Re: [R] select data

2012-05-14 Thread David L Carlson
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(example0, TRUE, FALSE) example[tf] - NA apply(example, 1, mean, na.rm=TRUE) -- David L Carlson Associate Professor

Re: [R] Random resampling of columns in species association matrices

2012-05-09 Thread David L Carlson
of 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 AM University College

Re: [R] convert 400 numeric variables to categorical together

2012-05-08 Thread David L Carlson
) 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 AM University College

Re: [R] commenting out a block of R code

2012-05-07 Thread David L Carlson
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 AM University College Station, TX 77843-4352 -Original

Re: [R] PLot a matrix

2012-05-06 Thread David L Carlson
?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 L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Data frame vs matrix quirk: Hinky error message?

2012-05-01 Thread David L Carlson
[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 AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r

Re: [R] Cluster Analysis

2012-04-16 Thread David L Carlson
At the R command prompt ?kmeans (for info on the R equivalent to FASTCLUS) ?hclust (for info on the R equivalent to CLUSTER) Install package clusterSim and look at function index.G1 for the Calinski-Harabasz pseudo F-statistic -- David L Carlson

Re: [R] Creating a point pattern with spatstat

2012-04-16 Thread David L Carlson
),] # Now your commands will work (with the window expanded slightly) X - as.ppp(points, owin(c(0, 13), c(0,13))) plot(X) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

Re: [R] cluster analysis with pairwise data

2012-04-04 Thread David L Carlson
)])^2 } dm - sqrt(dm) dm -- David L Carlson Associate Professor of Anthropology Texas AM 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 paladini

Re: [R] grouping

2012-04-03 Thread David L Carlson
Or just replace c(0, .333, .667, 1) with n - 10 split(x, cut(x, quantile(x, prob= c(0, 1:(n-1)/n, 1)), include.lowest=TRUE)) where n is the number of groups you want. -- David L Carlson Associate Professor of Anthropology Texas AM University College

Re: [R] Limitation on number of variables and data points in clustering

2012-04-02 Thread David L Carlson
You should probably read the posting guide, but the answer is Yes. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] Update Packages error

2012-03-30 Thread David L Carlson
You can check to see if you have authorization to update those files by right-clicking on the R shortcut icon (on your desktop or in Windows | All Programs | R | R2.14.1 (your version may be different). In the menu that opens, if there is an option to Run as Administrator (near the top on my

Re: [R] A question on histogram - area much less than 1

2012-03-12 Thread David L Carlson
multiplied by 35 is .279 exactly what you expected and the sum of the densities multiplied by the width of each bar (35) is 1. The height of the bar is not the probability, the area of the bar is the probability. -- David L Carlson Associate Professor

Re: [R] Maximum of remaining elements of vector

2012-03-12 Thread David L Carlson
-contained, reproducible code. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] find points on a graph

2012-03-07 Thread David L Carlson
(codon1, codon2, codon3))) Library(ca) plot(ca(table, suprow=c(4, 5))) This uses the first 3 rows for the correspondence analysis and then plots rows 4 and 5 in that space using an open circle. -- David L Carlson Associate Professor of Anthropology

Re: [R] How to apply two parameter function in data frame

2012-03-06 Thread David L Carlson
test data: df$a and x X-squared = 6.1221, df = 9, p-value = 0.7276 $e Pearson's Chi-squared test data: df$a and x X-squared = 6.6181, df = 9, p-value = 0.6768 -- David L Carlson Associate Professor of Anthropology Texas AM University

Re: [R] Frequencies from x/y data into a 2d table (for 3d histogram or heatmap)

2012-02-29 Thread David L Carlson
it properly. -- David L Carlson Associate Professor of Anthropology Texas AM 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 Marcio Pupin Mello Sent

Re: [R] error with persp()- increasing 'x' and 'y' values expected

2012-02-21 Thread David L Carlson
- 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 AM University College Station, TX 77843-4352 -Original Message- From: r-help

Re: [R] In R 2.14.1, what does wrong sign in 'by' argument mean?

2012-02-21 Thread David L Carlson
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 Carlson Associate

Re: [R] fit data to y~A+B*sin(C*x)

2012-02-14 Thread David L Carlson
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 -- David L Carlson

Re: [R] cumsum function to determine plankton phenology

2012-02-14 Thread David L Carlson
the differences, not just the two smallest absolute values. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r

Re: [R] multi-regression with more than 50 independent variables

2012-02-13 Thread David L Carlson
that you are only getting slope values for 11. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

Re: [R] Importing a CSV file

2012-02-10 Thread David L Carlson
believe that clipboard works only on Windows computers. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r

Re: [R] Arial font in eps figures in R

2012-02-09 Thread David L Carlson
(testArial.eps, horizontal=F, onefile=F, width=4, height=4) plot(1:10, 1:10) dev.off() -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org

Re: [R] calculating distance between latitude and longitude

2012-01-27 Thread David L Carlson
Look at distm() in package geosphere or geoDist() in package SoDA. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] contour(): Thickness contour labels

2012-01-23 Thread David L Carlson
Does adding font=2 (to select bold) work? See ?par - option font. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] graph paper look

2012-01-19 Thread David L Carlson
) -- David L Carlson Associate Professor of Anthropology Texas AM 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 Erin Hodgess Sent: Wednesday, January 18

Re: [R] Reading in tab (and space) delimited data within a script XXXX

2012-01-19 Thread David L Carlson
. -- David L Carlson Associate Professor of Anthropology Texas AM 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 Jeff Newmiller Sent: Thursday, January

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread David L Carlson
in black with the county boundaries in white. Otherwise just eliminate the last map command. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r

Re: [R] Adding a vertical line to plot with two overlapping density plots

2012-01-04 Thread David L Carlson
) } ) -- David L Carlson Associate Professor of Anthropology Texas AM 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 Petr PIKAL Sent: Wednesday, January 04, 2012 10:27 AM

Re: [R] lda output missing

2011-12-08 Thread David L Carlson
membership, look at predict.lda For tests of significance, look at Anova in package car For canonical discriminant analysis, look at package candisc -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] how to call a function for each row

2011-11-30 Thread David L Carlson
Isn't this even easier? X1 - c(1:3) X2 - c(3, 4, 6) X3 - c(5, 6, 1) Y - 6*X1 + 7*X2 + 8*X3 Y [1] 67 88 68 Or if you really need a function: MakeY - function(x, y, z) 6*x + 7*y + 8*z MakeY(X1, X2, X3) [1] 67 88 68 -- David L Carlson Associate

<    4   5   6   7   8   9   10   >