Re: [R] Adjusted R2 for Multivariate Regression Trees (MRT) (ignore the previous message)

2014-09-02 Thread David L Carlson
probably take the mean of the 100 runs as a reasonable estimate. If the estimates are quite variable, you should probably use more than 40 runs by setting T=100 or an even larger number. Multiple runs should then be more similar to one another. - David L Carlson

Re: [R] Correlation Matrix with a Covariate

2014-09-02 Thread David L Carlson
is perfectly correlated with col 2 col 3 is perfectly correlated with col 4 col 5 is perfectly correlated with col 6 David C From: Patzelt, Edward [mailto:patz...@g.harvard.edu] Sent: Tuesday, September 2, 2014 9:21 AM To: David L Carlson Cc: R-help@r-project.org Subject: Re: [R] Correlation Matrix

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread David L Carlson
Another approach using barplot: barplot(table(cut(art, breaks= -1:19, labels=0:19))) - 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] depth of labels of axis

2014-09-02 Thread David L Carlson
(expression(E[g]), E, expression(E[j]), E, expression(E[t])), padj=1, mgp=c(3, .1, 0)) # Check alignment abline(h=.7, xpd=TRUE, lty=3) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r

Re: [R] Correlation Matrix with a Covariate

2014-09-01 Thread David L Carlson
of observations or one of your columns is a linear combination of (can be predicted exactly from) the others. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r

Re: [R] Linear regression of 0/1 response ElemStatLearn (Fig. 2.1 the elements of statistical learning)

2014-09-01 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 Denis Kazakiewicz Sent: Monday, September 1, 2014 5:27 AM To: r-help@r

Re: [R] posterior probabilities from lda.predict

2014-08-30 Thread David L Carlson
. I am not aware of a package that has a function to produce either of these. Huberty, Carl J. and Stephen Olejink. 2006. Applied Manova and Discriminant Analysis. Second Edition. Wiley-Interscience. David L. Carlson Department of Anthropology Texas AM University -Original Message- From

Re: [R] distance matrix from metaMDS

2014-08-28 Thread David L Carlson
Don't the functions metaMDSdist() and metaMDSredist() that are documented on the metaMDS manual page give you the distance matrix? If you want to compute the distances based on a single axis, you could use vegdist(). David C -Original Message- From: r-help-boun...@r-project.org

Re: [R] scatterplot using plot() function with factorial data

2014-08-27 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 Luigi Marongiu Sent: Wednesday, August 27, 2014 8:42 AM To: r-help@r

Re: [R] VennDiagram

2014-08-26 Thread David L Carlson
Assuming your sample data is called dta: table(dta$Results, dta$Analysis) A B C 1-5 1 1 0 20-50 1 0 0 4-7 0 0 1 8-9 0 1 1 David L. Carlson Department of Anthropology Texas AM University -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] How to plot multiple density plot and scatter plot together

2014-08-25 Thread David L Carlson
=twoord.plotdata_source=R_CCinit=true - 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 kunjaai Sent: Monday

Re: [R] Subsetting data for split-sample validation, then repeating 1000x

2014-08-22 Thread David L Carlson
- cor(Atest$nat.r, predict(A.model, newdata = A[test,], type = response)) - 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] Subsetting data for split-sample validation, then repeating 1000x

2014-08-22 Thread David L Carlson
of the correlation values David C From: Angela Boag [mailto:angela.b...@colorado.edu] Sent: Friday, August 22, 2014 4:01 PM To: David L Carlson Subject: Re: [R] Subsetting data for split-sample validation, then repeating 1000x Hi David, Thanks for the feedback. I actually sampled without replacement

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-21 Thread David L Carlson
]) - 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] On Behalf Of Don McKenzie Sent: Thursday, August 21, 2014 1:44 PM To: Patzelt, Edward Cc: R-help@r-project.org Subject: Re: [R

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-21 Thread David L Carlson
the matrices in each list to get what you want. David C From: Patzelt, Edward [mailto:patz...@g.harvard.edu] Sent: Thursday, August 21, 2014 2:58 PM To: David L Carlson Cc: Don McKenzie; R-help@r-project.org Subject: Re: [R] Euclidean Distance in 3 Dimensions Your first description is correct

Re: [R] principle component values on PCA plots do not match

2014-08-19 Thread David L Carlson
Try using scale=0 with the biplot function). David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jinsong Zhao Sent: Monday, August 18, 2014 7:42 PM To: r-help@r-project.org Subject: Re: [R] principle component values on PCA

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

2014-08-18 Thread David L Carlson
4 0 3 1 5 53 4 2 0 1 6 64 3 2 0 1 David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David L Carlson Sent: Sunday, August 17, 2014 6:32 PM To: Simon Kiss; r-help@r-project.org

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

2014-08-17 Thread David L Carlson
it in the original problem definition. Yours, Simon On Jul 25, 2014, at 4:58 PM, David L Carlson dcarl...@tamu.edu wrote: I think this gets what you want. But your data are not reproducible since they are randomly drawn without setting a seed and the two data sets have no relationship to one another

Re: [R] Obtaining predicted values for glm() function

2014-08-15 Thread David L Carlson
You don't show us your function call, so it is hard to be certain what the problem is. Have you read the manual page? ?predict.glm Have you used the newdata= argument? If not, you should know that R's ability to read your mind will not be available until the 4.0 release. David Carlson

Re: [R] color palettes

2014-08-08 Thread David L Carlson
: Friday, August 8, 2014 9:03 AM To: David L Carlson Subject: Re: [R] color palettes Well I'm using 1000 colors in a pie chart and get the same color but different intensity. I can't fix myself as the number of colors are high. So what would you suggest? Thanks carol On Friday, August 8, 2014 3:58 PM

[R] FW: color palettes

2014-08-08 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 carol white Sent: Friday, August 8, 2014 8:27 AM To: r-help

Re: [R] How to avoid the three loops in R?

2014-08-01 Thread David L Carlson
328 201204 28 - 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

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread David L Carlson
','VALUE')], type='b', main = ind[[i]][1, NAME], . . . other commands . . . ) dev.off() } - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message

Re: [R] Post hoc comparissons

2014-07-29 Thread David L Carlson
Look at package multcomp, particularly function cld(). - 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] outputting R loop to a csv file

2014-07-28 Thread David L Carlson
have enough data to test alternate approaches. The function dput() will convert a sample of your data to text format so that you can paste it into your email or provide it as a .txt file. David L. Carlson Department of Anthropology Texas AM University -Original Message- From: r-help-boun

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

2014-07-25 Thread David L Carlson
yellowred blue green head(mydf2) blue green red yellow 14 2 3 1 22 1 4 3 34 1 3 2 44 3 2 1 54 3 2 1 63 4 2 1 - David L Carlson Department of Anthropology Texas AM

Re: [R] Creating Functions in R

2014-07-24 Thread David L Carlson
the value of deviation so you only get the last value recycled (page 20, The recycling rule). - 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] Area Graphs

2014-07-16 Thread David L Carlson
Also look at stackpoly() in the plotrix package. The R Graphical Manual shows the example plots here http://rgm.ogalab.net/RGM/R_rdfile?f=plotrix/man/stackpoly.Rdd=R_CC David Carlson -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] Cutting hierarchical cluster tree at specific height fails

2014-07-15 Thread David L Carlson
...@gmail.com] Sent: Tuesday, July 15, 2014 10:14 AM To: 'Johannes Radinger'; David L Carlson Cc: 'R help' Subject: RE: [R] Cutting hierarchical cluster tree at specific height fails Hi Johannes, Looking at the code for cutree(...), if h is provided but not k, then cutree(...) calculates k from h

Re: [R] Cutting hierarchical cluster tree at specific height fails

2014-07-11 Thread David L Carlson
heights. plot(hc) abline(h=c(20, 40, 60, 80, 100, 120), lty=3) David C From: Johannes Radinger [mailto:johannesradin...@gmail.com] Sent: Friday, July 11, 2014 3:24 AM To: David L Carlson; R help Subject: Re: [R] Cutting hierarchical cluster tree at specific height fails Hi, @David: Thanks

Re: [R] Problems with read.table and data structure

2014-07-11 Thread David L Carlson
It is hard to diagnose without looking at the file. For example readLines(small.txt, n=5) would print out the first five lines that might show problems with wrapping the lines. What does dim(data) give you? Are you getting all 360 samples and 600 columns? You could also try using the

Re: [R] Cansisc: Error in eigen(eHe, symmetric = TRUE)

2014-07-10 Thread David L Carlson
In particular, look at the vegan Vignette, Introduction to Ordination in vegan, particularly section 4 on constrained ordination which describes three approaches that seem relevant to your problem. http://cran.r-project.org/web/packages/vegan/vignettes/intro-vegan.pdf David Carlson

Re: [R] Cutting hierarchical cluster tree at specific height fails

2014-07-09 Thread David L Carlson
(but not median). - 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 Johannes Radinger Sent: Wednesday, July 9

Re: [R] using match to obtain non-sorted index values from non-sorted vector

2014-07-09 Thread David L Carlson
There may be a faster way, but sapply(Tset, function(x) which(pop.df$pop==x)) [1] 5 4 2 - 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

Re: [R] getting numeric [0..6] day of week from POSIXct?

2014-07-07 Thread David L Carlson
?format.POSIXct Particularly %w x - Sys.time() as.numeric(format(x, %w)) [1] 1 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of John McKown Sent: Monday, July 7, 2014 10:54 AM To: r-help Subject: [R] getting numeric [0..6] day

Re: [R] Help with tables in R

2014-07-03 Thread David L Carlson
) table. That happens when converting the ftable object to a matrix since xtable handles a number of different object types, but not ftable. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message

Re: [R] Display a dataframe

2014-07-03 Thread David L Carlson
Not elegant, but it works: term - dimnames(dd)[[1]] dd1 - dd dimnames(dd1)[[1]] - rep(, 6) dd2 - capture.output(dd1) cat(paste(dd2,, c(Term, term)), fill=48) # Chisq DF Pr(Chisq) Term 153.0216306 1 7.578366e-35 # Sex 13.3696538 1 5.114571e-04 # Volume

Re: [R] combining data from multiple read.delim() invocations.

2014-07-01 Thread David L Carlson
:25:05 ... $ ended : POSIXct, format: 2014-07-01 11:25:05 2014-07-01 11:25:05 ... - 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

Re: [R] combining data from multiple read.delim() invocations.

2014-07-01 Thread David L Carlson
] Sent: Tuesday, July 1, 2014 12:33 PM To: David L Carlson Cc: John McKown; r-help@r-project.org Subject: Re: [R] combining data from multiple read.delim() invocations. Maybe, David, but this isn't really it. Your code just basically reproduces the explicit for() loop with the lapply. Maybe

Re: [R] A Question about read.table and Data Frames in R

2014-06-30 Thread David L Carlson
You are also missing the fact that loops are often not required in R. In this case print() has a method for printing data frames and that method is automatically used when you simply type the data.frame name or if you explicitly call it with print(stockList): stockList -

Re: [R] How to combine/join/merge etc PCA and Cluster?

2014-06-30 Thread David L Carlson
The legend will be complicated since there are groups*ecosytems combinations. - 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] How to combine/join/merge etc PCA and Cluster?

2014-06-30 Thread David L Carlson
Insert data(dune) data(dune.env) after library(vegan) David C. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David L Carlson Sent: Monday, June 30, 2014 4:47 PM To: Jackson Rodrigues; r-help@r-project.org Subject: Re: [R] How

Re: [R] graph

2014-06-26 Thread David L Carlson
=l) legend(topright, c(mu1, mu2, mu3, mu4), col=1:4, lty=1:4) - 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] subtracting degree minutes

2014-06-26 Thread David L Carlson
your problem would be dd2dm(dm2dd(44.1) - dm2dd(.2)) [1] 43.5 Of course you could wrap that into a function if you are planning to do it frequently. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original

Re: [R] Simple permutation question

2014-06-25 Thread David L Carlson
, but this one has the advantage of being symmetrical. The last permutation is the reverse of the first, the penultimate the reverse of the second, etc. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original

Re: [R] Simple permutation question

2014-06-25 Thread David L Carlson
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David L Carlson Sent: Wednesday, June 25, 2014 4:02 PM To: Cade, Brian; Robert Latest Cc: r-help@r-project.org Subject: Re: [R] Simple permutation question Assuming you want all

Re: [R] Sample all possible contingency tables both margin fixed

2014-06-24 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 Gabor Grothendieck Sent: Tuesday, June 24, 2014 12:07 PM To: Tahira Jamil Cc: r-help@r-project.org

Re: [R] Sample all possible contingency tables both margin fixed

2014-06-24 Thread David L Carlson
(lower:upper, function(i) c(a=i, b=M[1] - i, c=M[3] - i, + d=M[4] - M[1] + i))) all.2x2s a b c d [1,] 10 5 5 0 [2,] 11 4 4 1 [3,] 12 3 3 2 [4,] 13 2 2 3 [5,] 14 1 1 4 [6,] 15 0 0 5 David C From: Michael Peng [mailto:michael.gang.p...@gmail.com] Sent: Tuesday, June 24, 2014 1:32 PM To: David L Carlson

Re: [R] EOF error reading csv file

2014-06-22 Thread David L Carlson
The error message EOF within quoted string is telling you have an unbalanced or ' in the .csv file. - 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] apply diff type function to matrix

2014-06-19 Thread David L Carlson
4 1.5 [2,]58 1.5 - 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 message Sent

Re: [R] C: drive memory full

2014-06-18 Thread David L Carlson
on the Manage tab on the line just below the title bar. Click on Cleanup and that will let you select temporary files of various kinds for deletion if your drive is getting full. - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840

Re: [R] apply switch to a table

2014-06-17 Thread David L Carlson
If you are not determined to apply switch(), you can apply apply(): Data - data.frame(V1=c(1, 5), V2=c(3, 4)) Data ## V1 V2 ## 1 1 3 ## 2 5 4 label - data.frame(freq=c(1:5), lbl=c(One, Two, Three, Four, Five)) label ## freq lbl ## 11 One ## 22 Two ## 33 Three ## 44

Re: [R] abline; setting plot limits

2014-06-15 Thread David L Carlson
You can also use clip() before abline(): x - rnorm(25) y - rnorm(25) plot(y~x) clip(min(x), max(x), min(y), max(y)) abline(lm(y~x)) But the clipping region will affect anything else you add to the plot after the clip command. In package plotrix, ablineclip() sets and resets the clipping

Re: [R] Forst Plot: Multipage Output

2014-06-10 Thread David L Carlson
in Acrobat Reader and print to CutePDF using the poster mode. - 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] distance by sea

2014-06-05 Thread David L Carlson
Package geosphere has functions to compute the great circle distance between any two points given the latitude and longitude. It does not care if they are at sea, but does not take topography into account. - David L Carlson Department of Anthropology Texas AM

Re: [R] How to draw a transparent polygon

2014-05-21 Thread David L Carlson
] red255 green0 blue 0 alpha 255 redtrans - rgb(255, 0, 0, 127, maxColorValue=255) polygon(c(2, 5, 8), c(2, 10, 2), col=redtrans) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original

Re: [R] \ escape sequence and windows path

2014-05-20 Thread David L Carlson
Annoying but easy. Would this work for you? y - gsub(, /, readline()) C:\foo1\foo2\ y [1] C:/foo1/foo2/ - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r

Re: [R] \ escape sequence and windows path

2014-05-20 Thread David L Carlson
Now I understand. Not really a solution, but you can instruct students to use only forward slashes in their paths since R will convert to backslash on Windows systems automatically. After a couple of broken commands, they should get the hang of it. David C -Original Message- From:

Re: [R] \ escape sequence and windows path

2014-05-20 Thread David L Carlson
That's the solution I was working on. Design the function (the foo() in your example) to read the clipboard so you do not need to paste anything. That greatly reduces how generally the function can be used since it will fail if there is not a path in the clipboard, but it solves (ameliorates?)

Re: [R] dist like function but where you can configure the method

2014-05-17 Thread David L Carlson
Function designdist() in package vegan lets you define your own distance measure, but it does not let you simply provide a function as your original request indicated. Function distance() in package ecodist() indicates that it is written to make it simple to add new distance functions, but

Re: [R] create new rows with 0, if nessecary

2014-05-16 Thread David L Carlson
A bit simpler is to add the Hours column when creating the dd data.frame: dd - data.frame(Cat=min(aa[,1],bb[,1]):max(aa[,1],bb[,1]), Hours=0) Then just gg1 - merge(aa,dd,all=TRUE) gg2 - merge(bb,dd,all=TRUE) David Carlson -Original Message- From: r-help-boun...@r-project.org

Re: [R] Retrieving the matched data frame from Matching?

2014-05-16 Thread David L Carlson
The str() function will show you what is contained in m8. If you look at the manual page for Match: ?Match the section labeled Value gives more details on what results are returned by the Match() function. The print() and summary() functions usually show abbreviated results. In this case a

Re: [R] Second axis on bottom of graph

2014-05-16 Thread David L Carlson
?title Used for main titles, subtitles, and x/y labels. David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Hurr Sent: Friday, May 16, 2014 10:59 AM To: r-help@r-project.org Subject: Re: [R] Second axis on bottom of graph

Re: [R] Using centers of hierarchical clustering for k-means

2014-05-16 Thread David L Carlson
0 3 0 2 10 0 4 0 0 0 3 - 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 marioger Sent

Re: [R] matrix column division by vector

2014-05-14 Thread David L Carlson
You don't need do.call: t(t(m)/v) [,1] [,2] [,3] [1,]222 [2,]111 t(apply(m, 1, function(x) x/v)) [,1] [,2] [,3] [1,]222 [2,]111 - David L Carlson Department of Anthropology Texas AM University

Re: [R] matrix column division by vector

2014-05-14 Thread David L Carlson
Bert wins the race: system.time(replicate(1e5, m/rep(v,e=2))) user system elapsed 0.250.000.25 system.time(replicate(1e5, m/matrix( v, ncol=ncol(m), nrow=nrow(m), byrow=TRUE))) user system elapsed 0.420.000.42 system.time(replicate(1e5, t(t(m)/v))) user

Re: [R] data presentation -curve

2014-05-14 Thread David L Carlson
1. data.frame 2. yes Read the posting guide and work through a free tutorial or manual on R: http://cran.r-project.org/other-docs.html David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ragia Ibrahim Sent: Wednesday, May 14,

Re: [R] Convert to integers all entries of a table (for DESeq2)

2014-05-12 Thread David L Carlson
), stringsAsFactors=FALSE) - 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 Alicia R. PĂ©rez-Porro Sent

Re: [R] conversion error from numeric to factor in raster: Error in 1:ncol(r) : argument of length 0, r command: as.factor()

2014-05-06 Thread David L Carlson
Does values(r) - as.factor(1:ncell(r)) do what you want? - 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] Converting matrix to data frame without losing an assigned dimname

2013-04-10 Thread David L Carlson
3100 4862 2 Pennsylvania 126 11860 44966 3 Maryland 101 4122 9891 4 Virginia85 4981 39780 -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

Re: [R] Boxplot Labels

2013-04-09 Thread David L Carlson
the numbers from 1 to 26, num - 1:26 would be more compact. -- 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

Re: [R] Reshaping a table

2013-04-08 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 arun Sent: Monday, April 08, 2013 7:41 AM

Re: [R] a question about clustering

2013-04-04 Thread David L Carlson
groups within the known groups, you could cluster the groups separately. -- 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

Re: [R] help with kriging interpolation

2013-04-04 Thread David L Carlson
Take a look at package geoR. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf

Re: [R] scanning data in R

2013-04-03 Thread David L Carlson
You can certainly do it after scanning all the numbers in with b - scan(F:\\stop.txt, what=integer()) b - b[b!=21] -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message

Re: [R] changing y-axis intervals in a boxplot

2013-03-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-bounces@r- project.org] On Behalf Of Pascal Oettli Sent: Friday, March 29, 2013 6:33

Re: [R] barplot colors

2013-03-26 Thread David L Carlson
You will have to trick barplot into thinking you have four groups: wmod - cbind(c(w[,1], 0, 0), c(0, 0, w[,2])) barplot(wmod, main=2012, col=c(red, green, blue, pink)) -- David L Carlson Associate Professor of Anthropology Texas AM University College

Re: [R] contourplot

2013-03-22 Thread David L Carlson
data and compute y # from a linear regression of x1 and x2 on y lmmodel - lm(y~x1+x2, pr) prgrid - data.frame(x1=xygrid$Var1, x2=xygrid$Var2) prgrid$y - predict(lmmodel, prgrid) # Draw contour plot contourplot(y~x1+x2, prgrid) -- David L Carlson

Re: [R] boxplot

2013-03-21 Thread David L Carlson
Your variable loc_type combines information from two variables (loc and type). Since you are subsetting on loc, why not just plot by type? boxplot(var1~type, data[data$loc==nice,]) -- David L Carlson Associate Professor of Anthropology Texas AM

Re: [R] data.frame with NA

2013-03-19 Thread David L Carlson
). The first column (the Date variable) is treated as character. As a result, everything gets converted to character. This will skip the first column which does not have any missing values. -- David L Carlson Associate Professor of Anthropology Texas AM

Re: [R] data.frame with NA

2013-03-18 Thread David L Carlson
NA ... $ o : num 133 133 133 133 133 ... $ p : num 107 107 107 107 107 ... -- 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] data.frame with NA

2013-03-18 Thread David L Carlson
- project.org] On Behalf Of David L Carlson Sent: Monday, March 18, 2013 3:22 PM To: 'Pietro'; 'Berend Hasselman' Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] data.frame with NA Try this Open the spreadsheet in Excel. Select all of the data click Copy. Don't close Excel. Open R and type

Re: [R] help with PCA

2013-03-16 Thread David L Carlson
?predict.prcomp -- 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 David

Re: [R] Data manipulation

2013-03-15 Thread David L Carlson
Wouldn't this do the same thing? xtabs(Count~Class+X, D) -- 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

Re: [R] Data manipulation

2013-03-15 Thread David L Carlson
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 David L Carlson Sent: Friday, March 15, 2013 9:23 AM To: 'IOANNA'; 'John Kane

Re: [R] Reassign values based on multiple conditions

2013-03-15 Thread David L Carlson
an error message. -- 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

Re: [R] plotting

2013-03-14 Thread David L Carlson
=ID) -- 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 R. Michael Weylandt

Re: [R] different color indicates difference magnitude

2013-03-13 Thread David L Carlson
If you are just looking for a range of colors that communicate low to high values, try package RColorBrewer and look at the sequential palettes. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

Re: [R] Export R generated tables and figures to MS Word

2013-03-13 Thread David L Carlson
are making more than a few tables. There is also an R2wd package, but I haven't tried it. -- 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] extract values

2013-03-12 Thread David L Carlson
Look at your data. You do not want values greater than 1820. There are none. You want values with NAMES greater than 1820. x1 - x[as.numeric(names(x)) 1820] x1 -- David L Carlson Associate Professor of Anthropology Texas AM University College Station

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

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