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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] Titles - main and subtitle won't plot with errbar

2013-01-10 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 masepot Sent: Thursday, January 10

Re: [R] locating element in distance matrix

2013-01-11 Thread David L Carlson
If you have a dist object (created by dist()) or if you used lower.tri(x) to extract the lower triangle of the matrix, which() will not work since the matrix is now stored as a numeric vector with n(n-1)/2 elements where n is the number of rows/columns. In that case you must compute the original

Re: [R] locating element in distance matrix

2013-01-11 Thread David L Carlson
-- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Friday, January 11, 2013 4:21 PM To: dcarl...@tamu.edu Cc: 'eliza botto'; r-help@r

Re: [R] Drawing a dotted circle.

2013-01-12 Thread David L Carlson
=gray, center.pch=) -- 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 Rui

Re: [R] I'm trying to parse 1 column of a dataframe into 3 seperate columns

2013-01-14 Thread David L Carlson
How about a - sapply(test, function(x) x[1]) s - sapply(test, function(x) x[2]) e - sapply(test, function(x) x[3]) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

Re: [R] calculating mean matrix

2013-01-19 Thread David L Carlson
,] 0.189669255 0.3368646 0.34261301 [2,] -0.009700353 -0.4676745 0.01974906 The result is a matrix, not a data frame, and certainly not resulting data frames. What are you trying to cbind? -- David L Carlson Associate Professor of Anthropology Texas AM

Re: [R] compare and count data

2013-01-21 Thread David L Carlson
Another approach critical- c(1.61,75.89, 1.61, 75.89) colSums(sweep(mydata, 2, critical, )) V1 V2 V3 V4 0 19 0 0 -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

Re: [R] Ellipse in PCA with parameters a and bdefined.

2013-01-22 Thread David L Carlson
Try x - mean(PCA$scores[,1]) and y - mean(PCA$scores[,2]) which should be the same as x - 0, y - 0 within rounding error. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

Re: [R] How to remove the vertical space between two graps

2013-01-22 Thread David L Carlson
in base graphics before your plotting commands. Alternatively you can set up a plot and then use the polygon() function to place the rectangles where you want them. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX

Re: [R] change confidence interval line length in barplot2 (plotrix package)

2013-01-22 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 Martin Batholdy Sent: Tuesday, January 22, 2013 2:42 PM To: r

Re: [R] summarise subsets of a vector

2013-01-23 Thread David L Carlson
10 0.194500 11 11 100.00 -- 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] Question on matrix calculation

2013-01-24 Thread David L Carlson
: as.matrix(aggregate(mat, list(match_df$criteria), sum)[,2:4]) V1 V2 V3 [1,] 8 23 38 [2,] 5 10 15 [3,] 2 7 12 -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

Re: [R] adjacency list to non-symmetric matrix

2013-02-05 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 William Dunlap Sent: Tuesday, February 05, 2013 10:47

Re: [R] Count of Histogram Bins using Shingles with lattice

2013-02-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-bounces@r- project.org] On Behalf Of Burns, Jonathan (NONUS) Sent: Friday

Re: [R] Count of Histogram Bins using Shingles with lattice

2013-02-11 Thread David L Carlson
-- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: David L Carlson [mailto:dcarl...@tamu.edu] Sent: Monday, February 11, 2013 10:05 AM To: 'Burns, Jonathan (NONUS)'; 'r-help@r-project.org' Subject: RE

Re: [R] Clean up biplot resulting from princomp()

2013-02-11 Thread David L Carlson
?biplot set.seed(42) pcout - princomp(matrix(rnorm(1000), 100, 10)) biplot(pcout) biplot(pcout, xlabs=rep(., dim(pcout$scores)[1])) # small symbol biplot(pcout, xlabs=rep(, dim(pcout$scores)[1])) # no symbol -- David L Carlson Associate Professor

Re: [R] Correlation with p value

2013-02-13 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 Jorge I Velez Sent: Wednesday

Re: [R] Correlation with p value

2013-02-13 Thread David L Carlson
Minor edit dta2 - unstack(dta, score~Name) is simpler. --- David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of David L Carlson Sent: Wednesday, February 13, 2013 9:40 AM To: 'Jorge I Velez'; 'Nico Met' Cc: 'R

Re: [R] help with population matrix

2013-02-18 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: Monday, February 18, 2013 10:50 AM To: Sam

Re: [R] cut a vector in equal parts

2013-02-26 Thread David L Carlson
Insert include.lowest=TRUE or the lowest value will get dropped (assigned NA): split(x, cut(x, quantile(x, probs = seq(0, 1, by = 0.2)), include.lowest=TRUE)) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread David L Carlson
Clumsy but it doesn't require any packages: merge2 - function(x, y) { if(all(union(names(x), names(y)) == intersect(names(x), names(y{ rbind(x, y) } else merge(x, y, all=TRUE) } merge2(df1, df2) df3 - df1 merge2(df1, df3) -- David L Carlson

Re: [R] best ordination method for binary variables

2013-02-28 Thread David L Carlson
,]10 [6,]11 [7,]11 [8,]00 [9,]10 [10,]11 unique(x) [,1] [,2] [1,]10 [2,]11 [3,]01 [4,]00 -- David L Carlson Associate Professor of Anthropology Texas AM University

Re: [R] PCA with spearman and kendall correlations

2013-02-28 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 BOURGADE Eric Sent: Thursday, February 28, 2013 3:50 AM

Re: [R] Hidden information in an object

2013-02-28 Thread David L Carlson
8.5 ... $ ratio: num 3.5 3.7 4.75 3.43 3.48 ... -- 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] chi square exact test

2013-03-06 Thread David L Carlson
stats, the dmultinom() function can be used to accomplish this. The last example on the help page shows the steps. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

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] 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] 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] 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] 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] 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] 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] 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] 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] 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

  1   2   3   4   5   6   7   8   9   10   >