Re: [R] Strange result when subsetting a data frame based on a character variable

2015-11-17 Thread David L Carlson
ot;100" > as.character(1000) [1] "1000" - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of peter dalgaard Sent: Tuesd

Re: [R] knn - random result although use.all=TRUE

2015-11-20 Thread David L Carlson
tied values so the algorithm probably uses a random method of selecting which 3 to use. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project

Re: [R] Conditional Random selection

2015-11-21 Thread David L Carlson
ames = c(NA, -8L)) You can just remove the lines with X1 = 0 since you don't want to use them. > tab.sub <- tab[tab$X1>0, ] Then the following gives you a sample: > tab.sub[cumsum(sample(tab.sub$X2))<=500, ] Note, that your "solution" of times 6, 7, and 8 wi

Re: [R] PCA plot of variable names only

2015-11-30 Thread David L Carlson
#x27;t want the symbols just the names, change the last two lines: > plot(dat.pca$rotation[, 1:2], type="n") > text(dat.pca$rotation[, 1:2], colnames(dat)) --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX

Re: [R] fill the area outside a polygon

2015-12-02 Thread David L Carlson
lue", border=NA) --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Adrian Du?a Sent: Wednesday, December 2, 2

Re: [R] dataframe rbind

2015-12-04 Thread David L Carlson
um -1.91926 0.00791 0.65523 0.95019 1.23822 ... $ b : num 0.344 1.281 2.057 -1.69 -0.268 ... $ ID: int 0 0 0 0 0 0 0 0 0 0 ... ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- F

Re: [R] column means dropping column minimum

2015-12-08 Thread David L Carlson
333 ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Giorgio Garziano Sent: Tuesday, December 8, 2015 12:58 PM To: r-help@r-project.org Subj

Re: [R] applying wilcox.test to every combination of rows in a matrix (pairwise)

2015-12-09 Thread David L Carlson
0.6572552 1.000 [25] 0.6572552 0.6572552 1.000 0.6572552 0.3005223 1.000 [31] 0.6572552 1.000 0.3005223 0.6572552 0.6572552 1.000 - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Origin

Re: [R] applying wilcox.test to every combination of rows in a matrix (pairwise)

2015-12-09 Thread David L Carlson
t the errors Error in wilcox.test.formula(pc1.eigv ~ p[i, ]) : grouping factor must have exactly 2 levels AND Error in wilcox.test.formula(vals ~ tf[i, ]) : grouping factor must have exactly 2 levels On Wednesday, December 9, 2015 12:28 PM, David L Carlson wrote: If I understand correctly,

Re: [R] Random selection of a fixed number of values by interval

2015-12-14 Thread David L Carlson
seed(42) > samples <- lapply(1:5, function(x) sample(data$id[groups==grp[x]], + size[x])) > names(samples) <- grp > samples $`[0,1)` [1] 69 68 33 63 56 46 65 12 50 58 $`[1,2)` [1] 20 34 43 8 15 52 19 $`[2,3)` [1] 7 22 62 28 2 $`[3,4)` [1] 61 53 5 25 21 $`[4,5)` [1] 59 35

Re: [R] Hexbin: Counting Bins That Meet Certain Criteria

2015-12-15 Thread David L Carlson
Something like > library(hexbin) > set.seed(42) > xy <- matrix(rnorm(1000), 500) > xy.hex <- hexbin(xy) > table(xy.hex@count) 1 2 3 4 5 6 7 8 159 60 33 16 6 1 2 1 > sum(xy.hex@count >= 3) [1] 59 ------------- Da

Re: [R] adding vector values to corresponding components of a list

2015-12-15 Thread David L Carlson
E FALSE As you can see, it makes a difference. --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of debra ragland via R

Re: [R] how to plot two variables in a figure using ggplot2

2015-12-16 Thread David L Carlson
;, "8", "9")) > matplot(dat$XX, dat[, 2:3], type="l", xlab="XX", ylab="OA & KA") > legend("topleft", c("OA", "KA"), col=1:2, lty=1:2) - David L Carlson Department of Anthropo

Re: [R] Applying a function to a matrix using indexes as arguments

2015-12-17 Thread David L Carlson
1-column matrix" > as.matrix(A) [,1] [1,] 100 [2,] 200 ------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jef

Re: [R] Gather columns based on multiple columns using tidyr

2015-12-17 Thread David L Carlson
cotland.df) Year month rainfall_mm 67 2013 Dec 300.7 68 1986 Dec 268.5 69 1929 Dec 267.2 70 2011 Dec 265.4 71 2006 Dec 264.0 72 1912 Dec 261.0 --------- David L Carlson Department of Anthropology Texas A&M University Co

Re: [R] Converting from Continuous 2D Points to Continuous 2D Vectors

2015-12-18 Thread David L Carlson
Look at the CRAN Task View: "Handling and Analyzing Spatio-Temporal Data," particularly the section on "Moving objects, trajectories." The tools you need are probably already available. https://cran.r-project.org/web/views/SpatioTemporal.html -----

Re: [R] geomorph: adding confidence ellipses

2015-12-22 Thread David L Carlson
Look at scatter3d() in the car package. It has an option to add a confidence ellipsoid to an interactive 3d plot. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-

Re: [R] need for help for solving operations in a vector

2015-12-23 Thread David L Carlson
. Or try combining the results of diff(x, 1) and diff(x, 2). You should not try to program in R until you have read more about the R language. ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Me

Re: [R] Subsetting a square marix

2016-01-05 Thread David L Carlson
. But none of these are labels in your data set since R is case sensitive. Try for example: > sub <- c("Sp1", "Sp3", "Sp5") > dta[sub, sub] Sp1 Sp3 Sp5 Sp1 0 0 0 Sp3 1 0 1 Sp5 0 0 0 And definitely spend some time with the available free R

Re: [R] LSD value

2016-01-18 Thread David L Carlson
[4] LSD 13.4704 > out[[1]][4] LSD 13.4704 - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jianling Fan Sent: Monday, January 18, 2016 10

Re: [R] Fwd:

2016-01-21 Thread David L Carlson
Assuming Michael is correct, you can use setdiff(): > set.seed(42) > current <- sample.int(4500, 4495) # All but 5 numbers used > setdiff(1:4500, current) # Find which numbers are left [1] 905 1252 2508 3192 4484 --------- David L Carlson Department of

Re: [R] probability or a quantile from various distributions for multiple comparisons of means

2016-01-26 Thread David L Carlson
-project.org/web/packages/multcomp/vignettes/multcomp-examples.pdf There is also a function, p.adjust(), that adjusts p-values for multiple comparisons that is included in the stats package in R. ?p.adjust - David L Carlson Department of Anthropology Texas A&a

Re: [R] organizing my data before doing a cluster analysis

2016-01-26 Thread David L Carlson
ct.org/other-docs.html If you have trouble deciding which one(s), here are some suggestions: https://cran.r-project.org/doc/contrib/usingR.pdf https://cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf https://cran.r-project.org/doc/contrib/Owen-TheRGuide.pdf --

Re: [R] Confidence Interval for R-squared

2016-01-26 Thread David L Carlson
www.inside-r.org/packages/cran/MBESS/docs/ci.R2 Functions CI.Rsq() and CI.Rsqlm() in package psychometric http://finzi.psych.upenn.edu/library/psychometric/html/CI.Rsq.html ----- David L Carlson Department of Anthropology Texas A&M University College Station,

Re: [R] [FORGED] find numbers that fall in a region or the next available.

2016-02-03 Thread David L Carlson
Look at the point.in.polygon() and over() functions in package sp. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behal

Re: [R] [FORGED] find numbers that fall in a region or the next available.

2016-02-04 Thread David L Carlson
Assuming your map area can be described as a closed polygon, these functions would tell you which points lie within the boundaries of the polygon. David C From: Alaios [mailto:ala...@yahoo.com] Sent: Thursday, February 4, 2016 1:34 AM To: David L Carlson; r-help@r-project.org Subject: Re: [R

Re: [R] pearson correlation matrix

2016-02-05 Thread David L Carlson
Assuming your data is called BIG and has 12 rows and thousands of columns: cor(t(BIG)) - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun.

Re: [R] middle of interval

2016-02-08 Thread David L Carlson
Here is another approach: > interval <- c("1902-1931", "1912-1930", "1902-1951") > sapply(strsplit(interval, "-"), function(x) mean(as.numeric(x))) [1] 1916.5 1921.0 1926.5 - David L Carlson Department of Anth

Re: [R] How a clustering algorithm in R can end up with negative silhouette values?

2016-02-21 Thread David L Carlson
slightly (very slightly if there are lots of observations in those two clusters). - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Be

Re: [R] Why CLARA clustering method does not give the same classes as when I do clustering manually?

2016-02-21 Thread David L Carlson
observations taken along a line in time or space). That is why kmeans includes an argument to run the algorithm multiple times and pick the best result. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Orig

Re: [R] KNN

2016-02-24 Thread David L Carlson
ng in R for beginners (https://www.datacamp.com/community/tutorials/machine-learning-in-r) * Best way to learn kNN Algorithm using R Programming (http://www.analyticsvidhya.com/blog/2015/08/learning-concept-knn-algorithms-programming/) --------- David L Carlson Department of Ant

Re: [R] Order output list od TukeyHSD function by "p adj"

2016-02-24 Thread David L Carlson
9.52854 0.9626540845 B:M-A:H 4.222 -11.084100 19.52854 0.9626540845 B:L-A:H 3.667 -11.639655 18.97299 0.9797122861 A:H-A:M 0.556 -14.750766 15.86188 0.978240 B:M-B:L 0.556 -14.750766 15.86188 0.978240 --------- David L Carlson Department of Anthropolo

Re: [R] KNN

2016-02-25 Thread David L Carlson
even run kNN. ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon Sent: Thursday, February 25, 2016 4:15 AM To: Alnazer Elbedairy Cc: r-help mailing

Re: [R] Color of points in legend() ignored if plotting to PNG

2016-02-29 Thread David L Carlson
bg = "white", pch = 21, pt.cex = 1.5, col = "black", pt.bg = "lightgrey") dev.off() I'm not having any problem getting the grey on Win 8. - David L Carlson Department of Anthropology Texas A&M University College Stati

Re: [R] Fw: removing factor values in the main data frame

2016-03-01 Thread David L Carlson
the manual page for subset(): "Factors may have empty levels after subsetting; unused levels are not automatically removed. See droplevels for a way to drop all unused levels from a data frame." -------- David L Carlson Department of Anthropology Texas A&am

Re: [R] Plot multiple similar equations in r

2016-03-02 Thread David L Carlson
ype="l", col="black", lty=1) ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Dalthorp, Daniel Sent: Wednesday, March 2, 2016

Re: [R] discriminant analysis lda under MASS

2016-03-03 Thread David L Carlson
If the textbook provides the equations, you can work through them directly. But without knowing more, it is hard to say. You could also contact the author of the textbook. - David L Carlson Department of Anthropology Texas A&M University College Station

Re: [R] splAw: RE: discriminant analysis lda under MASS

2016-03-03 Thread David L Carlson
r PCA, this is solved by taking a to be the eigenvector of B corresponding to the largest eigenvalue." Where B is the Between-classes covariance matrix. ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352

Re: [R] specify size of box around legend

2016-03-14 Thread David L Carlson
ange the box size plot(1, 1) legend(x=c(a$rect$left, a$rect$left+b$rect$w), y=c(a$rect$top, a$rect$top-a$rect$h), legend = x, title = "L 1") legend(x="bottomleft", legend = y, title = "L 2") - David L Carlson Department of Ant

Re: [R] specify size of box around legend

2016-03-14 Thread David L Carlson
uot;L 1") legend(x="bottomleft", legend = y, title = "L 2") - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] Circular Statistic in R

2016-03-19 Thread David L Carlson
e circular. ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jeff Reichman Sent: Tuesday, March 15, 2016 6:14 P

Re: [R] Circular Statistic in R

2016-03-19 Thread David L Carlson
ou get all three attributes set correctly, things can get strange. ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: Jeff Reichman [mailto:reichm...@sbcglobal.net] Sent: Wedne

Re: [R] apply mean function to a subset of data

2016-04-03 Thread David L Carlson
toy$group), y=nsel) > smean 12 0.271489 1.117015 ------ David L. Carlson Department of Anthropology Texas A&M University -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon Sent: Saturday, April 2,

Re: [R] multiple bar plot annotation text labelling

2016-04-04 Thread David L Carlson
mes = c(NA, -8L)) I think this will get you what you want: > barplot(testbarplot[,2], axes=FALSE, ann=FALSE, horiz=TRUE, ylab= 'group', + xlab= '(x values)', space=c(1,0,0,0, 1,0,0,0), names.arg=testbarplot[, 3], + las=1) - David L Ca

Re: [R] HTML help -- as a single document for the entire package

2016-04-06 Thread David L Carlson
It is not quite what you are asking for, but there are several online pdf to html conversion websites. I tried a simple package pdf file and it converted fine. The page numbers are still there, but it is a single continuous page. - David L Carlson Department

Re: [R] Descriptive Statistics of time series data

2016-04-06 Thread David L Carlson
.367 0.185 0.582 1.4 -0.727 ... $ X5: num 1.5127 0.2579 0.0884 -0.1209 -1.1943 ... > mean(as.matrix(x)) [1] 0.03251482 > sd(as.matrix(x)) [1] 1.041357 > min(x) [1] -2.99309 > max(x) [1] 2.286645 --------- David L Carlson Department of Anthropology Texas A&

Re: [R] Generating Hotelling's T squared statistic with hclust

2016-04-08 Thread David L Carlson
ates clusters. It does not question the data you provide and it does not stop and refuse to continue if there are no clusters in the data. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Mes

Re: [R] Finding Highest value in groups

2016-04-22 Thread David L Carlson
0L)) Then you just need the aggregate() function: > aggregate(Value~ID, dta, max, na.rm=TRUE) ID Value 1 1 0.69 2 2 0.99 3 3 1.00 4 4 1.00 5 5 0.50 See ?aggregate for the help page. - David L Carlson Department of Anthropology Texas A&M Universit

Re: [R] simulation in R

2016-04-22 Thread David L Carlson
f the growthrate (0 to 1 for condition 3 and 0 to .5 for condition 1). In your example of no constraints on food (condition 2), if the growthrate is always 1, the range will always be 1 and 1. - David L Carlson Department of Anthropology Texas A&M Universit

Re: [R] clock24.plot/radial plot

2016-04-22 Thread David L Carlson
Looks like you forgot to load the lubridate package library(lubridate) You are calling functions days(), hours(), minutes(), seconds(), and hour() which all come from that package. - David L Carlson Department of Anthropology Texas A&M University Col

Re: [R] Inserting a blank row to every other row

2016-04-25 Thread David L Carlson
b 2.1 NA 33c 3.1 NA --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter Sent: Sunday, April 24, 2016 11:13 AM To: Ulrik Stervbo Cc:

Re: [R] Using read.csv() to import data

2016-04-25 Thread David L Carlson
bably called "My Documents"). Whenever you start R run setwd("LearnR") first so that anything you save goes in that folder. If you create .csv files, put them in that folder and R will find them easily. Also all of your R files will be in one place making them easier to find. -

Re: [R] use switch or function in connecting different cases.

2016-04-25 Thread David L Carlson
What do you mean by "it didnt update itself?" You will get the same results on each run since you set the random seed to 1 when you call the function. As a result, each time you will get the same results. ----- David L Carlson Department of Anthropolo

Re: [R] ylim in barplot()

2016-04-25 Thread David L Carlson
b=colnames(mydata), legend.pos="topright") dev.off() - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of EYSSAUTIER Stéphanie Sent: Monday, April 25, 20

Re: [R] Create a new variable and concatenation inside a "for" loop

2016-04-27 Thread David L Carlson
67737 [5,] -0.286552020 0.02494653 [6,] 0.342416179 0.12555319 [7,] 0.374780442 -0.14720941 [8,] -0.003385802 0.58530576 [9,] -0.782871221 -0.39320949 --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4

Re: [R] Determine if a set of x and y-latitude points are inside of a polygon using R

2016-04-28 Thread David L Carlson
ince you execute Bounds$T[i] = M either way? ------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shawn Adderly Sent: Wednes

Re: [R] polygon angle option perpendicular to axis

2016-04-28 Thread David L Carlson
n adding asp=1 to the plot() function and now the lines are parallel. --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of G

Re: [R] Changing transformations in mi package

2016-05-04 Thread David L Carlson
sformed data - square roots, not > logs [1] 2.049390 2.810694 NA 4.012481 4.460942 4.795832 ------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-h

Re: [R] find high correlated variables in a big matrix

2016-05-10 Thread David L Carlson
Look at varclus() in package Hmisc or package ClustOfVar. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Lida Zeig

Re: [R] apply formula over columns by subset of rows in a dataframe (to get a new dataframe)

2016-05-13 Thread David L Carlson
ocks) > str(mydf2) 'data.frame': 15 obs. of 4 variables: $ blocks: Factor w/ 3 levels "a","b","c": 1 1 1 1 1 2 2 2 2 2 ... $ v1: num 19 15 17 22 16 12 24 25 22 18 ... $ v2: num 35 31 35 31 39 31 19 35 32 38 ... $ v1mod : num 0.571 0 0.286 1 0.143 ... -

Re: [R] What is the easiest way to turn a dataframe into a barplot?

2016-05-13 Thread David L Carlson
by the plot device # Note that if you drag the plot window to be wider, the labels will eventually appear > with(z, barp(Count, names=Name, staxx=TRUE)) # Stagger the labels > with(z, barp(Count, names=Name, staxx=TRUE, srt=60)) # Slant the labels - Da

Re: [R] mean for every quartile

2016-05-16 Thread David L Carlson
TRUE) > tapply(df$BR, df$quant, mean) 1 2 3 4 12.48 41.24 67.24 90.64 --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-proj

Re: [R] Recoding lists of categories of a variable

2016-10-10 Thread David L Carlson
ic 19" "topic 20" > mydata$newvar <- mydata$oldvar > levels(mydata$newvar)[c(1, 9, 14)] <- "parenttopic" > table(mydata$newvar) parenttopic topic 2 topic 3 topic 4 topic 5 topic 6 topic 7 topic 8 26 6 14

Re: [R] Hclust

2016-10-11 Thread David L Carlson
centers of the clusters and assign the new point to the closest center. These two approaches will not necessarily agree with one another. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Mes

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread David L Carlson
0, 1, 2)) > mtext("GN", 2, 2) > mtext("CN", 4, 2, at=0) > par(oldp) ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-hel

Re: [R] MDS, line of best fit, and id of variables

2016-10-18 Thread David L Carlson
ke that. If they are all factors, something like mortdata1 <- sapply(mortdata, as.numeric)-1 would convert factor levels of 1 and 2 to 0 and 1. ------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Origina

Re: [R] MDS, line of best fit, and id of variables

2016-10-18 Thread David L Carlson
er" "integer" "integer" "integer" "integer" "integer" > mortdata.mds <- metaMDS(mortdata) . . . Many messages ... New best solution ... Procrustes: rmse 0.07861438 max resid 0.2210256 Run 18 stress 0.277969 Run 19 stress 0.2633298 Run 2

Re: [R] How to use predict() so that one retains the rows that they're associated with?

2016-10-20 Thread David L Carlson
not always the best). There are a number of tutorials on the web that discuss logistic regression. You should look at one of them. ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message

Re: [R] need help in customising function in stat_summary function ggplot2

2016-10-20 Thread David L Carlson
))/length(x)*100 # Compute the % greater than the median [1] 50 ------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Indhira

Re: [R] using nested ifelse when i want to process values from more than 3 columns of data frame

2016-10-24 Thread David L Carlson
like this > cols <- c("H1", "H2", "H3", "H8") > RS <- rowSums(kdata[, cols]) > kdata$target <- ifelse(RS == length(cols), "all-true", + ifelse(RS == 0, "all-false", "other")) David L. Carlson Department

Re: [R] PROBLEM: correspondence analysis with vegan

2016-10-26 Thread David L Carlson
ay the data sets so that you know how they are organized using the str() function to study the structure of the data and View() to display it. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Me

Re: [R] Simple loop problem

2016-10-31 Thread David L Carlson
c introductions to R. --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Yahya Laraki Sent: Monday, October 31, 2016 9:45 AM

Re: [R] prcomp() on correlation matrix

2016-11-09 Thread David L Carlson
Have you read the manual page for prcomp()? ?prcomp Look at the examples, particularly the use of the scale.= argument. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-

Re: [R] prcomp() on correlation matrix

2016-11-09 Thread David L Carlson
[5,] -0.579 0.472 0.281 -0.602 Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 SS loadings 1.01.01.01.01.0 Proportion Var0.20.20.20.20.2 Cumulative Var0.20.40.60.81.0 --------- David L Carlson Department of An

Re: [R] Principle Component Analysis: Ranking Animal Size Based On Combined Metrics

2016-11-14 Thread David L Carlson
t(pc1, gm) > cor(cbind(pc1, gm, wgt=df$weight)) pc1 gmwgt pc1 1.000 -0.9716317 -0.5943594 gm -0.9716317 1.000 0.3967369 wgt -0.5943594 0.3967369 1.000 - David L Carlson Department of Anthropology Texas A&M Univ

Re: [R] Principle Component Analysis: Ranking Animal Size Based On Combined Metrics

2016-11-14 Thread David L Carlson
102 0.9984574 1.000 David C -Original Message- From: Sidoti, Salvatore A. [mailto:sidoti...@buckeyemail.osu.edu] Sent: Monday, November 14, 2016 11:41 AM To: David L Carlson; Jim Lemon; r-help mailing list Subject: RE: [R] Principle Component Analysis: Ranking Animal Size Bas

Re: [R] Issues with the way Apply handled NA's

2016-11-14 Thread David L Carlson
;- apply(plabor[c("colA","colB","colC")],1,function(x) length(na.omit(x))) vals # [1] 3 0 3 2 plabor$colD <- ifelse(vals>0, plabor$colD, NA) plabor # colA colB colC colD # 16 253 450 # 2 NA NA NA NA # 332 19 114 # 447 NA

Re: [R] R help

2016-11-17 Thread David L Carlson
:12], > paired=TRUE)[[1]])) > str(result) num [1:255] -0.195 0.307 1.214 2.221 0.633 ... > quantile(result) 0% 25% 50% 75%100% -3.39194814 -0.80146023 0.02383907 0.71836716 5.88806695 --------- David L Carlson De

Re: [R] summing up a matrix

2016-11-18 Thread David L Carlson
the manual pages for these functions. --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Matthias Weber Sent: Friday, November 18

Re: [R] reshaping a large dataframe in R

2016-11-28 Thread David L Carlson
4 3 1 2 3 4 4 1 2 3 4 5 1 2 3 4 6 1 2 3 4 > tail(dat3) V1 V2 V3 V4 500495 4001 4002 4003 4004 500496 4001 4002 4003 4004 500497 4001 4002 4003 4004 500498 4001 4002 4003 4004 500499 4001 4002 4003 4004 500500 4001 4002 4003 4004 --------

Re: [R] Ajdustment of data symbols

2016-12-01 Thread David L Carlson
Try this. The par("cxy") gets a vector of character width and height in user coordinates. points(0.25, par("usr")[3]-par("cxy")[2]/2, pch = 17, col = "red", cex = 2, xpd = TRUE) --------- David L Carlson Department of A

Re: [R] creating possible cominations of a vector's elements

2016-12-08 Thread David L Carlson
my vector" "is""is my" [7] "is my vector" "my""my vector" [10] "vector" This makes a vector of strings but if you want a list use as.list(mapply()) David L. Carlson Departm

Re: [R] creating possible cominations of a vector's elements

2016-12-08 Thread David L Carlson
collapse=" "), x=idx[, 1], y=idx[, 2]) } David C -----Original Message- From: David L Carlson Sent: Thursday, December 8, 2016 5:51 PM To: 'Dimitri Liakhovitski' ; r-help Subject: RE: [R] creating possible cominations of a vector's elements You can use

Re: [R] creating possible cominations of a vector's elements

2016-12-08 Thread David L Carlson
x=idx[, 1], y=idx[, 2]) } David C -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David L Carlson Sent: Thursday, December 8, 2016 7:12 PM To: Dimitri Liakhovitski ; r-help Subject: Re: [R] creating possible cominations of a vector's eleme

Re: [R] vegan NMDS labels

2016-12-09 Thread David L Carlson
per left corner) # of the window. text(grp.lbls, grps) Or just eyeball the coordinates. Once you have them where you want them, save them with dput() and include them in your script file (assuming you are planning to plot to a print device later). - David L Carlson Dep

Re: [R] Log plus one transformation in R

2016-12-12 Thread David L Carlson
01)/log(0.01+1)) 0.99917259636 > dput(log1p(0.0001)/log(0.0001+1)) 0.1110732027 > dput(log1p(0.01)/log(0.01+1)) 1.00079991719344 --------- David L Carlson Department of Anthropology Texas A&M Unive

Re: [R] K-modes clustering : how to choose the number of clusters?

2016-12-13 Thread David L Carlson
Function NbClust() in package NbClust computes 30 different indices for determining the number of clusters. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-

Re: [R] Reshape to wide format

2016-12-13 Thread David L Carlson
0 7 7 0.0000.0 8 8 0.0000.000836129 9 9 0.000 NA 1010 0.000 NA 1111 0.1215360 NA 1212 0.3886606 NA - David L Carlson Depar

Re: [R] data manipulation

2016-12-14 Thread David L Carlson
. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rui Barradas Sent: Wednesday, December 14, 2016 6:12 AM To: John Kane; Farshad Fathian;

Re: [R] Reshape to wide format

2016-12-28 Thread David L Carlson
;year", "month")? ----------- David L. Carlson Department of Anthropology Texas A&M University From: Miluji Sb [mailto:miluj...@gmail.com] Sent: Thursday, December 22, 2016 8:19 AM To: David L Carlson Cc: Jim Lemon ; r-help mailing list

Re: [R] Generating a Special Histogram

2017-01-05 Thread David L Carlson
apply(mat, 1, max) text(xval-.5, yval-.5, x) } boxhist(wgt) - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch Sent: Thursday, January

Re: [R] testing whether clusters in a PCA plot are significantly different from one another

2017-01-06 Thread David L Carlson
: Marchesi, Julian [mailto:j.march...@imperial.ac.uk] Sent: Friday, January 6, 2017 9:02 AM To: David L Carlson Subject: Re: [R] testing whether clusters in a PCA plot are significantly different from one another Dear David The clusters are defined by the metadata which tells R where to draw the lines

Re: [R] how to proof the trend of two columns of data?

2017-01-09 Thread David L Carlson
try the following R command: > ?kruskal.test ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rui Barradas Sent:

Re: [R] how to proof the trend of two columns of data?

2017-01-10 Thread David L Carlson
package DescTools. David C From: vod vos [mailto:vod...@zoho.com] Sent: Tuesday, January 10, 2017 6:03 AM To: David L Carlson Cc: Rui Barradas; r-help Subject: Re: [R] how to proof the trend of two columns of data? as far as I know, ?kruskal.test will show us the differences between three or more

Re: [R] Running Omega in R

2017-01-16 Thread David L Carlson
liquely, do a Schmid Leiman transformation, and then find omega. " You cannot rotate a single factor so you cannot compute omega. --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message

Re: [R] Receiving NaN message

2017-01-17 Thread David L Carlson
And (re: "dat[,ID]"), the page on "Extract or Replace Parts of an Object": ? Extract --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-he

Re: [R] Current Terminal (console) width

2017-01-20 Thread David L Carlson
I cannot replicate that on Windows 8 (64 bit or 32 bit): > options('width') $width [1] 90 # Drag the window to resize, then: > options('width') $width [1] 124 --------- David L Carlson Department of Anthropology Texas A&M University

Re: [R] How to output "0" after paste() ?

2017-02-13 Thread David L Carlson
",sep="") ?sprintf for details ----- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of vod vos Sent: Monday, February 13, 2017

Re: [R] Circular plot

2017-02-13 Thread David L Carlson
5, theta.1=begin, theta.2=stop, border=col, lwd=4)) text(5.2, .4, "1", pos=4) text(5.2, -.4, "1500", pos=4) --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message---

Re: [R] Circular plot

2017-02-14 Thread David L Carlson
os=4) text(-.1, 5.5, "1500", pos=2) David C From: swaraj basu [mailto:projectb...@gmail.com] Sent: Monday, February 13, 2017 3:58 PM To: David L Carlson ; r-help@r-project.org Subject: Re: [R] Circular plot Thank you David, I could get the circle at 12 and clockwise however I believ

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