Re: [R] Spatial Statistics using R

2011-11-17 Thread David L Carlson
/files/rex1.pdf -- 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 vioravis Sent

Re: [R] barplot names.arg

2011-11-11 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 Diviya Smith Sent: Thursday, November 10, 2011 11:10

Re: [R] from points in Lon/Lat to physical distance in dist class

2011-11-08 Thread David L Carlson
Look at distm() in package geosphere. -- 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] Histograms in R

2011-11-03 Thread David L Carlson
The lines() command doesn't work and histogram combines categories unless you specify the number. How about a barplot Lam - 3 X - table(rpois(500, Lam)) Max - length(X)-1 barplot(rbind(X, 500*dpois(0:Max, Lam)), beside=TRUE, legend.text=c(Observed, Expected)) or a rootogram library(vcd)

Re: [R] Imputing Missing Data: A Good Starting Point?

2011-11-02 Thread David L Carlson
approaches and provides R code for them. -- 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

Re: [R] dotPlot with diagonal

2011-10-26 Thread David L Carlson
Try again. There is no dotPlot() function in lattice and dotplot() does not take two separate rows so the example you gave us generates an error message if dotPlot is changed to dotplot. -- David L Carlson Associate Professor of Anthropology Texas AM

Re: [R] replicating SAS's proc rank procedure

2011-10-21 Thread David L Carlson
You can get the same results with the cut() function in R: cut(cars$speed, breaks=quantile(cars$speed, probs=c(0:15/15)), labels=1:15, include.lowest=TRUE) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX

Re: [R] Converting data frame into multidimensional array

2011-10-21 Thread David L Carlson
How about? x - array(Titanic, dim=c(4,2,2,2)) str(x num [1:4, 1:2, 1:2, 1:2] 0 0 35 0 0 0 17 0 118 154 ... -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r

Re: [R] reading a dense file of binary number

2011-10-18 Thread David L Carlson
Or do you want each number separated? data - textConnection(010101001110101 + 10101001010 + 01001010010 + ) result - as.matrix(read.fwf(data, rep(1, 15))) result V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 [1,] 0 1 0 1 0 1 0 0 1 1 1 0 1 0 1 [2,] 1 0

Re: [R] x axis

2011-10-13 Thread David L Carlson
There are lots of options since you did not tell us what you want on the axis (or what you have tried). For example if you want more than 6 tick marks/labels, replace xlim=c(0, 3000) with xaxp=c(0, 3000, 12) to get labels every 250 meters instead of 500. Depending on the size of the graph window

Re: [R] Odd gridding pattern when plotting

2011-09-30 Thread David L Carlson
From ?image Images for large z on a regular grid are more efficient with useRaster enabled and can prevent rare anti-aliasing artifacts, but may not be supported by all graphics devices. Adding useRaster=TRUE to the two image() calls gets rid of the white grid lines. -Original

Re: [R] Mahalanobis Distance

2011-09-27 Thread David L Carlson
are all +/-1. -- 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 david.jes...@ubs.com

Re: [R] Mahalanobis Distance

2011-09-27 Thread David L Carlson
Since you are only looking at the distance between two points, they must fall on a line so no matter how many values you have for each point, their dimension is still 1. Mahalanobis distance is a way of measuring distance in multivariate space when the variables (columns) are correlated with one

Re: [R] Help writing basic loop

2011-09-20 Thread David L Carlson
345 6 0.0001994346 0.0002118383 0.0002729246 0.0002249865 0.0002323564 0.0002113820 -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r

Re: [R] split variable / create categories

2011-09-09 Thread David L Carlson
)/(length(x)/4)) [1] 2 2 3 3 4 4 1 1 -- 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

Re: [R] How do I get a weighted frequency table?

2011-08-29 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 Leandro Marino Sent: Sunday, August 28, 2011 12:15 PM To: Luca Meyer Cc: r

Re: [R] I have a problem with R!!

2011-08-22 Thread David L Carlson
When you read Excel data from the Windows clipboard, the delimiter is a tab, not a comma. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r

Re: [R] prcomp

2011-08-18 Thread David L Carlson
I think David's idea about NA's was correct. This works: prcomp(na.omit(Chlor1[,-(1:2)]), scale=TRUE) The number of cases drops from 288 to 250. There also three 0's in the dataset that probably should be NA's. -- David L Carlson Texas AM University

Re: [R] Loops to assign a unique ID to a column

2011-08-02 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 Chandra Salgado Kent Sent: Tuesday, August 02, 2011 2:12

Re: [R] Limited number of principal components in PCA

2011-08-01 Thread David L Carlson
. If the variables are highly correlated, you will get fewer components and that probably explains the reduction to 54. I would guess the variables are highly correlated and the first eigenvalue is very large. -- David L Carlson Associate Professor

Re: [R] Plotting problems directional or rose plots

2011-08-01 Thread David L Carlson
Searching R Graphical Manual (http://www.oga-lab.net/RGM2/, mirror http://www.oga-lab.net/RGM2/) shows possible candidates in packages circular (windrose), IDPmisc (plot.rose), climatol (rosavent), openair (windRose), and oce (as.windrose). -- David L

Re: [R] Inserting column in between

2011-08-01 Thread David L Carlson
1 11 21 31 41 2 2 12 22 32 42 3 3 13 23 33 43 4 4 14 24 34 44 5 5 15 25 35 45 6 6 16 26 36 46 7 7 17 27 37 47 8 8 18 28 38 48 9 9 19 29 39 49 10 10 20 30 40 50 -- David L Carlson Associate Professor of Anthropology Texas AM University

Re: [R] Inserting column in between -- better way?

2011-08-01 Thread David L Carlson
[,1:4], newcol, x[,ncol(x)]) A B C D newcol x[, ncol(x)] 1 1 1 1 1 41 2 2 2 2 2 52 3 3 3 3 3 63 Inserting drop=FALSE fixes them. -- David L Carlson Associate Professor of Anthropology Texas AM

Re: [R] Question about error message

2011-06-29 Thread David L Carlson
importing the data into R. str(filename) Will list the fields in the filename and their type. For norm they must all be numeric. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original

Re: [R] Model II regression

2011-06-27 Thread David L Carlson
Look at package smatr. It fits RMA (called here standardized major axis) regression, plots the line, and provides confidence limits. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Kernel Density Estimation at manually specified points

2011-06-27 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 Carsten Harlaß Sent: Sunday, June 26, 2011

Re: [R] change plot area in barplot2

2011-06-24 Thread David L Carlson
plotting window with the par(mar= or mai=) command (help(par). -- 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] combining strings

2011-06-17 Thread David L Carlson
You don't say what happens if both arrays have non-missing entries, but assuming that doesn't happen: ifelse(is.na(xf),xg,xf) [1] W k h NA g r j NA v d NA v NA z r r i -- David L Carlson Associate Professor of Anthropology Texas AM University

Re: [R] Specify ID variable in daisy{cluster}

2011-06-17 Thread David L Carlson
You need to use hhid as the rownames for housing.cluster rather than including it as a variable in the data.frame: housing.cluster -data.frame(htypec1, afforcr1, resyrc1, crowdcc1, chprbos1) rownames(housing.cluster) - hhid Then it will not be included in the cluster analysis but will be used to

Re: [R] teaching R

2009-08-27 Thread David L Carlson
you can access functions that are not included in the menu structure. Think of it as training wheels (and more) for beginners. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

<    5   6   7   8   9   10