Re: [R] Mantel test

2015-05-04 Thread David L Carlson
Assuming the 'matrix' format is a symmetrical distance 'matrix' stored as a data frame (which read.csv creates) rather a rectangular data 'matrix,' you can convert it to a dist object with as.dist(). ?dist - David L Carlson Department of Anthropology Texas

Re: [R] Missing axis labels

2015-05-01 Thread David L Carlson
driver redraws the plot. There is also a third option in addition to your two to getting all of the labels: plot(0:100, 0:100, xaxp=c(0, 100, 4)) will plot at 0, 25, 50, 75, 100 which leaves room for the last label. - David L Carlson Department of Anthropology

Re: [R] Results Differ in Ternary Plot Matrix of Compositional Response Variables

2015-05-01 Thread David L Carlson
) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rich Shepard Sent: Thursday, April 30, 2015 3:57 PM To: r-help@r-project.org Subject: [R] Results

Re: [R] Plot Title: Adjusting Position

2015-05-01 Thread David L Carlson
= for size. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rich Shepard Sent: Friday, May 1, 2015 10:00 AM To: r-help@r

Re: [R] Graphs for scientific publication ?

2015-04-30 Thread David L Carlson
us where you want to end up. People on the list are familiar with base graphics, lattice graphics, and ggplot2. If you list your requirements clearly, you might end up with three solutions. - David L Carlson Department of Anthropology Texas AM University

Re: [R] Editable plot

2015-04-30 Thread David L Carlson
to get a changed plot. You cannot edit the plot by selecting an element on the plot and changing its properties in some way. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help

Re: [R] Problem with predict.lm()

2015-04-29 Thread David L Carlson
2 3 4 5 6 0.75474817 0.06024122 -0.27221466 -0.20344713 0.20218135 -0.24045859 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help

Re: [R] cite publications in the package help file

2015-04-28 Thread David L Carlson
a Source entry and/or References for that function or data set. For a large package such as MASS with over 150 functions/data sets, it would be unwieldy to put them all on the web page. - David L Carlson Department of Anthropology Texas AM University College

Re: [R] Question about base::rank results

2015-04-27 Thread David L Carlson
with index 4 is 77 so it shows up in the second position. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of J Robertson-Burns

Re: [R] - Obtaining superscripts to affix to means that are not significantly different from each other with R

2015-04-23 Thread David L Carlson
The function cld() in package multcomp generates compact letter displays, but does not format them as exponents of the group names. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From

Re: [R] R studio installation

2015-04-14 Thread David L Carlson
it. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jeff Newmiller Sent: Tuesday, April 14, 2015 7:43 AM To: John Kane; Sojood Malkawi; r-help@r-project.org Subject

Re: [R] Sum of some months totals

2015-04-14 Thread David L Carlson
$Month] aggregate(Rain~Year+Group, rainfall, function(x) c(sum=sum(x), days=sum(x0))) } rainstats(rainfall) Year Group Rain.sum Rain.days 1 1979 10 0 - David L Carlson Department of Anthropology Texas AM University College

Re: [R] Extracting unique entries by a column

2015-04-14 Thread David L Carlson
by Kernighan and Plauger: 10.0 times 0.1 is hardly ever 1.0. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Vikram Chhatre

Re: [R] Vectorizing a task

2015-04-14 Thread David L Carlson
It is not vectorized, but it is simple: EXPANDED - unlist(mapply(:, START, END)) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org

Re: [R] Convert color hex code to color names

2015-04-13 Thread David L Carlson
): for (i in 1:6) cat(i, colors()[clrs$RGB==rain[i]], \n) 1 red red1 2 yellow yellow1 3 green green1 4 cyan cyan1 5 blue blue1 6 magenta magenta1 David C -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David L Carlson Sent: Monday, April 13, 2015 12:07

Re: [R] Convert color hex code to color names

2015-04-13 Thread David L Carlson
(6) sum(clrs$RGB %in% rain) [1] 0 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Boris Steipe Sent: Monday, April 13

Re: [R] how to Subset based on partial matching of columns?

2015-04-09 Thread David L Carlson
From Sarah's data frame you can get what you want directly with the table() function which will create a table object, mydf.tbl. If you want a data frame you need to convert the table using as.data.frame.matrix() to make mydf.df. Finally combine the two data frames if your x column consists of

Re: [R] sort adjacency matrix

2015-04-06 Thread David L Carlson
==1), decreasing=TRUE),] or dat[order(rowSums(dat), decreasing=TRUE),] or dat[order(rowSums(dat, na.rm=TRUE), decreasing=TRUE),] Note that the order is not unique since there are ties in the number of 1s. - David L Carlson Department of Anthropology Texas AM

Re: [R] Again: A problem someone should know about

2015-03-30 Thread David L Carlson
benefit from spending a little time learning about R using a free tutorial. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] textplot() in wordcloud package

2015-03-16 Thread David L Carlson
, it does a better job of avoiding labels being chopped at the plot margins. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] textplot() in wordcloud package

2015-03-16 Thread David L Carlson
)) will eliminate the warnings. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Fraser D. Neiman Sent: Friday, March 13, 2015 3:29 PM

Re: [R] Adding Column to a Data Frame

2015-03-12 Thread David L Carlson
The merge function combines 2, not 3 files at a time. Maybe rich.stats2 = merge(rich.stats, Month, by=X.SampleID) rich.stats3 = merge(rich.stats2, Location, by=X.SampleID) Reading the manual page will help: ?merge - David L Carlson Department of Anthropology

Re: [R] calculate value in dependence of target value

2015-03-09 Thread David L Carlson
, but to cumulative VALUE? - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Matthias Weber Sent: Monday, March 9, 2015 7:46 AM

Re: [R] calculate value in dependence of target value

2015-03-09 Thread David L Carlson
- length(diff(rng[a:b])) + dat$MARGE[idx] - sum(PCT[a:(a+ng-1)]* diff(rng[a:b])) + } dat ID VALUE CVALUE LVALUE MARGE 1 11 1 1 0 200 2 12 5 6 1 1200 3 13 3 9 6 1800 4 14 2 11 9 1800 - David L Carlson

Re: [R] subset a data frame by largest frequencies of factors

2015-03-05 Thread David L Carlson
and delete the unused factor levels: sample - merge(Dataset, g[,-3]) sample$ctry - factor(sample$ctry) sample$member - factor(sample$member) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message

Re: [R] sampling dataframe based upon number of record occurrences

2015-03-04 Thread David L Carlson
into a single data frame: sample - do.call(rbind, lapply(dta.list, smp)) sample - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] Using dates in R

2015-03-04 Thread David L Carlson
) strptime(d2, %m/%d/%y)) [1] 1 ?strptime for details - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Brian Hamel Sent

Re: [R] 2D Timeseries trace plot

2015-03-03 Thread David L Carlson
$y[i], pen$x[i+1], pen$y[i+1]) } - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of AjayT Sent: Tuesday, March 3, 2015 8:59

Re: [R] Summing certain values within columns that satisfy a certain condition

2015-02-27 Thread David L Carlson
0 0 0 0 0 7 0 0 0 0 0 8 0 0 0 0 0 9 0 0 1 5 0 10 0 5 1 5 0 11 0 4 1 5 0 12 0 8 4 7 3 13 0 0 3 0 0 14 0 0 3 4 0 15 0 0 3 4 0 16 0 0 0 5 0 17 0 2 0 6 0 18 0 0 4 0 1 19 0 0 4 0 1 20 0 0 4 0 1 - David L Carlson Department

Re: [R] How to Deploy a 'poLCA' Model?

2015-02-24 Thread David L Carlson
Looking at package poLCA I see functions poLCA.predcell() and poLCA.table(). If these do not do what you want, you will need to be clearer and provide a reproducible example. - David L Carlson Department of Anthropology Texas AM University College Station, TX

Re: [R] One column listing on wide monitors too

2015-02-24 Thread David L Carlson
String 2 . . . String 15 String 16 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of marekl Sent: Tuesday, February 24, 2015 2

Re: [R] Replacing 9999 and 999 values with NA

2015-02-23 Thread David L Carlson
. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Alexandra Catena Sent: Monday, February 23, 2015 11:50 AM To: Frederic Ntirenganya Cc: r

Re: [R] Extracting Factor Pattern Matrix Similar to Proc Factor

2015-02-23 Thread David L Carlson
Function principal() in psych takes a correlation matrix so use cov2cor() to convert: library(psych) iris.pca - principal(cov2cor(cov(iris[,-5])), nfactors=4, rotate=none) print(iris.pca$Structure, cutoff=0) David -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On

Re: [R] Extracting Factor Pattern Matrix Similar to Proc Factor

2015-02-23 Thread David L Carlson
to the eigenvalue. Alternatively, you can install the psych package which computes the pattern (structure) matrix directly: library(psych) iris.pca - principal(iris[,-5], nfactors=4, rotate=none) print(iris.pca$Structure, cutoff=0) - David L Carlson Department

Re: [R] Correlation question

2015-02-22 Thread David L Carlson
David L. Carlson Department of Anthropology Texas AM University -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Thayn Sent: Sunday, February 22, 2015 12:01 AM To: Kehl Dániel Cc: r-help@r-project.org Subject: Re: [R] Correlation question Of course

Re: [R] Chi-square test

2015-02-20 Thread David L Carlson
for given probabilities with simulated p-value (based on 2000 replicates) data: f X-squared = 7.6268, df = NA, p-value = 0.7996 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message

Re: [R] subsamples and regressions for 100 times

2015-02-17 Thread David L Carlson
1.357475 # [2,] 1.4754324 0.2658041 1.309208 # [3,] 0.9838589 0.2658041 1.408987 # [4,] 0.9993144 0.2658041 1.354297 # [5,] 1.0134187 0.2658041 1.397112 # [6,] 1.4922856 0.2658041 1.312531 - David L Carlson Department of Anthropology Texas AM University College

Re: [R] Loop over regression results

2015-02-16 Thread David L Carlson
==x)) names(mod) - taxon lapply(mod, summary) coeffs - do.call(rbind, lapply(mod, coef, [1)) coeffs # (Intercept) Petal.Width # setosa3.222051 0.8371922 # versicolor1.372863 1.0536478 # virginica 1.694773 0.6314052 - David L

Re: [R] Loop over regression results

2015-02-16 Thread David L Carlson
4.418702 5.647610e-05 David C -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David L Carlson Sent: Monday, February 16, 2015 8:52 AM To: Ronald Kölpin; r-help@r-project.org Subject: Re: [R] Loop over regression results In R you would want to combine

Re: [R] Picking Best Discriminant Function Variables

2015-02-16 Thread David L Carlson
Look at the function stepclass() in package klaR. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David Moskowitz Sent

Re: [R] Coordinate or top left corner + offset

2015-02-10 Thread David L Carlson
-project.org] On Behalf Of Ben Bolker Sent: Monday, February 9, 2015 5:43 PM To: r-h...@stat.math.ethz.ch Subject: Re: [R] Coordinate or top left corner + offset David L Carlson dcarlson at tamu.edu writes: This is more complicated, but it could be rolled up into a function. Replace your mtext() call

Re: [R] Coordinate or top left corner + offset

2015-02-09 Thread David L Carlson
units. 3) Draw a white rectangle the size of the character you are plotting (in this case cex=2.5). Shrink the left and top edge so that the box around the plot area is not obscured. 4) Plot your character in the center of the box. - David L Carlson Department

Re: [R] Variance is different in R vs. Excel?

2015-02-09 Thread David L Carlson
Time for a new version of Excel? I cannot duplicate your results in Excel 2013. R: apply(dat, 2, var) [1] 21290.80 24748.75 Excel 2013: =VAR.S(A2:A21) =VAR.S(B2:B21) 21290.8 24748.74737 - David L Carlson Department of Anthropology Texas AM

Re: [R] Still trying to avoid loops

2015-02-04 Thread David L Carlson
How about? ave(dat$D, dat$S, FUN=order) [1] 2 1 1 1 2 3 ave(dat_2$D, dat_2$S, FUN=order) [1] 2 2 1 1 1 3 Note, your answer for the second example is incorrect since row 2 (c, 3) and row 5 (c, 2) are both assigned 2. - David L Carlson Department

Re: [R] naming rows/columns in 'array of matrices' | solved

2015-01-31 Thread David L Carlson
David L. Carlson Department of Anthropology Texas AM University -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of peter dalgaard Sent: Saturday, January 31, 2015 2:19 AM To: Evan Cooch Cc: r-help@r-project.org Subject: Re: [R] naming rows/columns in 'array

Re: [R] Passing a Data Frame Name as a Variable in a Function

2015-01-29 Thread David L Carlson
That's fine, but I'm here in town if you want me to pick her up at the airport. David -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Chel Hee Lee Sent: Thursday, January 29, 2015 9:18 AM To: Jeff Newmiller; Alan Yong; r-help@r-project.org Subject: Re:

Re: [R] Your personal email on the R-help mail list

2015-01-29 Thread David L Carlson
Yes. I thought I was replying to a different message. Sorry. David -Original Message- From: Chel Hee Lee [mailto:chl...@mail.usask.ca] Sent: Thursday, January 29, 2015 11:33 AM To: David L Carlson Subject: Your personal email on the R-help mail list Hi David, I am not sure if you

Re: [R] Working with and is data sets

2015-01-26 Thread David L Carlson
- David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sam Albers Sent: Monday, January 26, 2015 12:41 PM To: r-help@r

Re: [R] Complex merging problems

2015-01-13 Thread David L Carlson
I think the OP does not want to list duplicate records. Perhaps merge(unique(df1), df2, all.y=TRUE) v1 v2 ind 1 1 83 1 2 1 84 1 3 2 83 NA 4 2 84 NA 5 3 83 NA 6 3 84 NA 7 4 83 NA 8 4 84 NA - David L Carlson Department of Anthropology Texas

Re: [R] number of individuals where X=0 during all periods (longitudinal data)

2014-12-22 Thread David L Carlson
Spend a little time with aggregate() ?aggregate - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of najuzz Sent: Monday

Re: [R] combinations between two vectors

2014-12-18 Thread David L Carlson
pairs2 - pairs1[pairs1[,1] = pairs1[,2],] nrow(pairs2) [1] 21 # Same as pairs2 but (1, 1), etc are not included pairs3 - pairs1[pairs1[,1] pairs1[,2],] nrow(pairs3) [1] 15 - David L Carlson Department of Anthropology Texas AM University College Station, TX

Re: [R] Extract values from multiple lists

2014-12-16 Thread David L Carlson
Something like scens - paste0(scen, 1:N) new.df - data.frame(sapply(scens, function(x) get(x)[[pop.inf.r]])) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help

Re: [R] create matrices with constraint

2014-12-15 Thread David L Carlson
number of matrices possible. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of John McKown Sent: Monday, December 15, 2014 9:23

Re: [R] dotplot axes labelling

2014-12-15 Thread David L Carlson
You are very close. The argument scales(list(y=list())) supports multiple arguments for the y axis so you need to tell lattice how to use testylabels: dotplot(testmatrix, scales=list(y=list(labels=testylabels), xlab=NULL)) - David L Carlson Department

Re: [R] if else for cumulative sum error

2014-12-02 Thread David L Carlson
(sums = 45, 1, 0) But it won't be as fast if you have a large data set. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] Creating submatrices from a dataframe, depending on factors in sample names

2014-12-01 Thread David L Carlson
95.9 EU491340_2 96.5 97.7 96.0 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter Sent: Monday

Re: [R] Converting list to character

2014-11-25 Thread David L Carlson
.3.8 16 1801 2011 GR.3.8 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Lee, Chel Hee Sent

Re: [R] Rose Diagrams for Geology

2014-11-21 Thread David L Carlson
No. Just use the circular() function to specify that your data are in degrees and clockwise and the graph will be labeled that way. David C (I was beginning to think that this thread was only for Davids). -Original Message- From: r-help-boun...@r-project.org

Re: [R] Help for x axis

2014-11-18 Thread David L Carlson
PM To: David L Carlson Subject: Re: [R] Help for x axis Thank you very much, it is all I want to do. Is it possible with showing the error-bars or in a boxplot? Best regards, Olivier Le Rouzic On 2014-11-17, 4:07 PM, David L Carlson wrote: This should get you started: aggData - aggregate(age

Re: [R] Help for x axis

2014-11-18 Thread David L Carlson
more space at the bottom of the plot if you want to add more lines. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

Re: [R] Rose Diagrams for Geology

2014-11-18 Thread David L Carlson
Look at circular more carefully. It accepts both degrees and radians, but you have to create a circular object with circular() to specify what kind of circular data you have. Then you can plot and get circular statistics on your data. - David L Carlson

Re: [R] Help with ddply/summarize

2014-11-14 Thread David L Carlson
L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of John Posner Sent: Thursday, November 13, 2014 5:32 PM To: 'r-help@r-project.org' Subject: [R

Re: [R] factor levels numeric values

2014-11-12 Thread David L Carlson
). - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gerrit Eichner Sent: Wednesday, November 12, 2014 8:06 AM To: David Studer Cc: r

Re: [R] Counting within groups / means by groups

2014-11-10 Thread David L Carlson
L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jeff Newmiller Sent: Monday, November 10, 2014 9:19 AM To: stude...@gmail.com; r-help@r

Re: [R] limit of cmdscale function

2014-11-06 Thread David L Carlson
You avoid the call to cmdscale() by supplying your own starting configuration (see the manual page for the y= argument). You could still hit other barriers within isoMDS() or insufficient memory on your computer. - David L Carlson Department of Anthropology

Re: [R] reading data from a web

2014-10-29 Thread David L Carlson
NA ... $ V24: num NA NA NA NA NA NA NA NA NA NA ... $ V25: num NA NA NA NA NA NA NA NA NA NA ... $ V26: num 6 2302 1036 2209 500 ... - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message

Re: [R] inahull? from package alphahull not working when used with lapply

2014-10-27 Thread David L Carlson
Why not just library (alphahull) DT=data.frame(x=c(0.25,0.25,0.75,0.75),y=c(0.25,0.75,0.75,0.25)) Hull - ahull(DT, alpha = 0.5) TEST- data.frame(x=c(0.25,0.5),y=c(0.5,0.5)) apply(TEST, 1, function(x) inahull(Hull, x)) [1] FALSE TRUE - David L Carlson

Re: [R] Selecting rows/columns of a matrix

2014-10-26 Thread David L Carlson
Note that you do not have to create the vector of 1's (TRUE) and 0's (FALSE) if you know the index values: j - c(2, 4, 6) a[j, j] [,1] [,2] [,3] [1,]8 20 32 [2,] 10 22 34 [3,] 12 24 36 == David L. Carlson Department of Anthropology Texas AM

Re: [R] how to calculate a numeric's digits count?

2014-10-24 Thread David L Carlson
as character strings. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of PO SU Sent: Thursday, October 23, 2014

Re: [R] assigning letter to a column

2014-10-17 Thread David L Carlson
, I2, F), right=FALSE) No loops, no ifelse's. Anything below 3 will - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r

Re: [R] assigning letter to a column

2014-10-17 Thread David L Carlson
] On Behalf Of David L Carlson Sent: Friday, October 17, 2014 9:15 AM To: Monaly Mistry; r-help@r-project.org Subject: Re: [R] assigning letter to a column I think it is doing exactly what you have told it to do, but that is probably not what you want it to do. First, you do not need a loop since

Re: [R] Ternary Plots Do Not Display Ellipses in PDF

2014-10-15 Thread David L Carlson
=72, thinRatio=NULL, aspanel=FALSE, + col='red', lwd=2) dev.off() - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r

Re: [R] Storing vectors as vectors in a list without losing each individual vector

2014-10-14 Thread David L Carlson
- David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Patricia Seo Sent: Monday, October 13, 2014 6:28 PM To: r-help@r-project.org Subject: [R

Re: [R] cbind in a loop...better way? | summary

2014-10-09 Thread David L Carlson
Actually Jeff Laake's can be made even shorter with sapply(mat_list, as.vector) David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Evan Cooch Sent: Thursday, October 9, 2014 7:37 AM To: Evan Cooch; r-help@r-project.org

Re: [R] cbind in a loop...better way?

2014-10-08 Thread David L Carlson
How about do.call(cbind, lapply(env, as.vector)) [,1] [,2] [1,] 0.00 0.00 [2,] 0.05 0.15 [3,] 0.00 0.00 [4,] 20.00 15.00 [5,] 0.00 0.00 [6,] 0.10 0.20 [7,] 50.00 45.00 [8,] 0.00 0.00 [9,] 0.00 0.00 - David L Carlson Department

Re: [R] How to extract table results from survival summary object

2014-10-07 Thread David L Carlson
want plus other information, we need to extract the needed columns from res and then combine those columns into a data.frame. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help

Re: [R] Conditional Data Manipulation -Cumulative Product

2014-10-07 Thread David L Carlson
You need to use plain text, not html in your email. Your data are scrambled (see below). It is better to send your data using the R dput() function: dput(StartSignals) dput(MainData) dput(StopSignals) - David L Carlson Department of Anthropology Texas AM

Re: [R] Conditional Data Manipulation -Cumulative Product

2014-10-07 Thread David L Carlson
-13 (values .43, 1.51, .26). What do you mean by compounding? David C -Original Message- From: Pooya Lalehzari [mailto:plalehz...@platinumlp.com] Sent: Tuesday, October 7, 2014 2:59 PM To: David L Carlson Subject: RE: [R] Conditional Data Manipulation -Cumulative Product Dear David

Re: [R] Conditional Data Manipulation -Cumulative Product

2014-10-07 Thread David L Carlson
0.00 11 2014-01-11 0.43 0.00 1.98 1.46 0.00 12 2014-01-12 1.51 0.78 1.63 0.46 1.84 13 2014-01-13 0.26 0.34 0.34 0.97 1.13 David C -Original Message- From: Pooya Lalehzari [mailto:plalehz...@platinumlp.com] Sent: Tuesday, October 7, 2014 8:06 PM To: David L Carlson Subject: RE: [R

Re: [R] Using PCA to filter a series

2014-10-03 Thread David L Carlson
four, you could scale new to the mean: newd - new*mean(d.svd$v[,1]) head(newd) [1] 130.9300 114.3972 120.3884 119.9340 116.1588 122.3983 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message

Re: [R] Using PCA to filter a series

2014-10-02 Thread David L Carlson
- predict(lm(rowMeans(cbind(d1, d2, d3, d4))~pca$scores[,1])) lines(new2, col=red) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

Re: [R] Converting factor data into Date-time format

2014-09-30 Thread David L Carlson
First, use stringsAsFactors=FALSE with the read.csv() function. That will prevent the conversion to factors. Then try to convert date and time to datetime objects. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840

Re: [R] adding rows

2014-09-25 Thread David L Carlson
Another approach fun - function(i, dat=x) { grp - rep(1:(nrow(dat)/i), each=i) aggregate(dat[1:length(grp),]~grp, FUN=sum) } lapply(2:6, fun, dat=TT) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352

Re: [R] Cluster -- Agnes function

2014-09-24 Thread David L Carlson
Read the documentation for cutree(). You will have to decide how many clusters you want to use since agnes() provides results for everything from n clusters (where n is the number of observations) to 1 cluster. ?cutree - David L Carlson Department

Re: [R] Copying tables from R to Excel

2014-09-23 Thread David L Carlson
(clipboard, w), append=F ) Which will work just fine as long as you are using the Windows operating system. More technically, HTML() is a generic function with methods (156 in this case) for many different data types including matrices and tables. - David L

Re: [R] Pseudo R squared for quantile regression with replicates

2014-09-18 Thread David L Carlson
are using. There is nothing called resid inside fit. It is likely that the post you are looking at refers to the output from rq(...) or perhaps predict(rq(...)), but not the output from withReplicates(..., quote(coef(rq(... which is what fit is. - David L

Re: [R] column names to row names

2014-09-17 Thread David L Carlson
would be factors and station would be character. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jim

Re: [R] apply block of if statements with menu function

2014-09-15 Thread David L Carlson
just index the return value: let - letters[1:4] let[menu(let)] 1: a 2: b 3: c 4: d Selection: 3 [1] c Or a bit more polished: cat(Choice: , let[menu(let)], \n) 1: a 2: b 3: c 4: d Selection: 4 Choice: d - David L Carlson Department of Anthropology Texas

Re: [R] chi-square test

2014-09-15 Thread David L Carlson
-value (based on 2000 replicates) data: TT X-squared = 7919.632, df = NA, p-value = 0.0004998 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org

Re: [R] mice - undefined columns selected

2014-09-12 Thread David L Carlson
methods. Package VIM has a number of options of which nearest neighbor and hot deck might work well with your data. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r

Re: [R] create new column by replacing multiple unique values in existing column

2014-09-11 Thread David L Carlson
table(dat1$b) A1 A2 B1 5 5 5 If b is not a factor in your table, make it one ?factor - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] incorrect number of dimensions

2014-09-11 Thread David L Carlson
) with at least 4 columns. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Marie-Eve St-Onge Sent: Thursday

Re: [R] Margins to fill matrix

2014-09-11 Thread David L Carlson
42 46 [10,] 19220 17550 50 [11,] 107 23 24 19 112 19 25 20 349 - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r

Re: [R] KDE routines for data that is aggregated

2014-09-09 Thread David L Carlson
with contour, etc. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Saptarshi Guha Sent: Monday, September

Re: [R] calculate Euclidean distances between populations in R with this data structure

2014-09-05 Thread David L Carlson
There may be a specialized package for this in bioconductor, but it seems that you could just use aggregate() to calculate the means for each population and then use the results of that in dist(). ?aggregate - David L Carlson Department of Anthropology Texas

Re: [R] Turn Rank Ordering Into Numerical Scores By Transposing A Data Frame

2014-09-05 Thread David L Carlson
: Friday, September 5, 2014 10:22 AM To: David L Carlson Cc: r-help@r-project.org Subject: Re: [R] Turn Rank Ordering Into Numerical Scores By Transposing A Data Frame HI, of course. The a mini-version of my data-set is below, stored in d2. Then the code I'm working follows. library(reshape2

Re: [R] Turn Rank Ordering Into Numerical Scores By Transposing A Data Frame

2014-09-04 Thread David L Carlson
is not working properly with mine. Any other thoughts? Simon On Aug 18, 2014, at 10:44 AM, David L Carlson dcarl...@tamu.edu wrote: Another approach using reshape2: library(reshape2) # Construct data/ add column of row numbers set.seed(42) mydf - data.frame(t(replicate(100, sample(c(red, blue

Re: [R] depth of labels of axis

2014-09-04 Thread David L Carlson
: Re: [R] depth of labels of axis On Sep 3, 2014, at 10:05 PM, Jinsong Zhao wrote: On 2014/9/3 21:33, Jinsong Zhao wrote: On 2014/9/2 11:50, David L Carlson wrote: The bottom of the expression is set by the lowest character (which can even change for subscripted letters with descenders

Re: [R] wilcox.test - difference between p-values of R and online calculators

2014-09-03 Thread David L Carlson
. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tal Galili Sent: Wednesday, September 3, 2014 5:24 AM To: W Bradley Knox

Re: [R] wilcox.test - difference between p-values of R and online calculators

2014-09-03 Thread David L Carlson
/questions/6127/which-permutation-test-implementation-in-r-to-use-instead-of-t-tests-paired-and David C From: wbradleyk...@gmail.com [mailto:wbradleyk...@gmail.com] On Behalf Of W Bradley Knox Sent: Wednesday, September 3, 2014 9:20 AM To: David L Carlson Cc: Tal Galili; r-help@r-project.org Subject: Re

<    1   2   3   4   5   6   7   8   9   10   >