Re: [R] Simple Question About Exporting Back to Excel

2012-09-26 Thread David L Carlson
e this to reorder the data set before sending it back to Excel: xnew <- x[outp$order,] ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-bo

Re: [R] Drawing asymmetric error bars

2012-09-27 Thread David L Carlson
;Group 2")) > arrows(1.5, x1[2], 1.5, c(x1[1], x1[3]), angle=90, length=1/8) > arrows(2.5, x2[2], 2.5, c(x2[1], x2[3]), angle=90, length=1/8) -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX

Re: [R] modified Ward method

2012-10-01 Thread David L Carlson
e same way. ------ David L Carlson Associate Professor of Anthropology Texas A&M 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 eliza botto >

Re: [R] Presence/ absence data from matrix to single column

2012-10-06 Thread David L Carlson
;, "Sp3"), idvar="Point", timevar="Sp-name", direction="long") -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > Fr

Re: [R] Presence/ absence data from matrix to single column

2012-10-07 Thread David L Carlson
v.name="Sp-value", times=names(adat)[4:6], idvar="Point", timevar="Sp-name", direction="long") ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > Da

Re: [R] Removing header from a matrix

2012-10-07 Thread David L Carlson
] 20 25 40 [2,] 100 90 80 ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > proj

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread David L Carlson
Building on Jessica and Steve's use of embed: > X <- c(NA, 1, NA, 1, 1, 1, 1, 1, 1, NA, 1) > Z <- rowSums(embed(X, 3)) > Z[is.na(Z)] <- 1 > Z [1] 1 1 1 3 3 3 3 1 1 ---------- David L Carlson Associate Professor of Anthropology Te

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread David L Carlson
you that the function returns a matrix (in your case prd) so either of the following should work: library(plotrix) plotCI( x=1:15, y=prd$fit, ui=prd$upr, li=prd$lwr) or plotCI( x=1:15, y=prd[,1], ui=prd[,3], li=prd[,2]) This is very basic stuff. ------ Da

Re: [R] reading in a (very simple) list from a file

2012-10-10 Thread David L Carlson
3 3", header=TRUE, stringsAsFactors=FALSE) If you want to change the data.frame into a list, just use: > Listname <- as.list(Listname) -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4

Re: [R] histogram & corelation plots

2012-10-10 Thread David L Carlson
As for interactive plots, there is also aplpack (sliders for changing the width of histograms, and density plots; iPlots; and iWebPlots. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-

Re: [R] Converting factors to bounded random numerical data

2012-10-10 Thread David L Carlson
.269333 9 18.72558 15.64477 C 11.313985 10 17.33280 19.03034 B 7.820259 ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org

Re: [R] Converting factors to bounded random numerical data

2012-10-10 Thread David L Carlson
7 7 14.72275 18.38715 A3 8 26.09711 17.79988 C 10 9 18.72558 15.64477 C 11 ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-bo

Re: [R] Columns and rows

2012-10-12 Thread David L Carlson
me(t(dat2), stringsAsFactors=FALSE) > d4 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 Col1 A E H B F I C G J D K ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -

Re: [R] transforming a .csv file column names as per a particular column rows using R code

2012-10-14 Thread David L Carlson
ot;\\.", "_", colnames(dta2)) > dta2 Tool_1 Data1_1 Data2_1 Tool_2 Data1_2 Data2_2 Tool_3 Data1_3 Data2_3 1 A 0 1 A 3 2 A 2 3 2 B 3 2 B 1 2 B 3 2 -

Re: [R] weighting variables using Gower with DAISY

2012-10-15 Thread David L Carlson
That is the way I read the help file for function daisy() in package cluster, but you might want to contact the package maintainer with your question: Martin Maechler -- David L Carlson Associate Professor of Anthropology Texas A&M University Col

Re: [R] Referring to matrix elements by name, iteratively

2012-10-15 Thread David L Carlson
rownames(mat). -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Beh

Re: [R] List of Levels for all Factor variables

2012-10-17 Thread David L Carlson
t1) Lvls Names col1 92, 6, 7, 10, 15, 16, 17, 23, 24 col2 7b, c, d, e, g, h, j col3 51, 2, 3, 4, 5 It automatically extracts the columns that are factors so it should work on your original data.frame. -------

Re: [R] Downloading a html table

2012-10-22 Thread David L Carlson
, "", Area.mi)), PopDensity.mi=as.numeric(gsub(",", "", PopDensity.mi))) > Dta <- transform(Dta, Population=Area.km*PopDensity.km) The last line computes the Population from the Area and Population Density. -- D

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 A&M University College Station, TX 77840-4352 Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.

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

2014-05-12 Thread David L Carlson
tx[,-1], as.integer), stringsAsFactors=FALSE) ------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf O

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 A&a

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))) use

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

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 Sor

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

2014-05-16 Thread David L Carlson
er x.g4 1 2 3 4 1 10 0 1 0 2 0 12 2 0 3 0 2 10 0 4 0 0 0 3 --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-h

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 warns

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 A&M University College Station, TX 77840-4352

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: r-he

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?) t

Re: [R] How to draw a transparent polygon

2014-05-21 Thread David L Carlson
rgb("red", alpha=TRUE) [,1] 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 A&

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 A

Re: [R] Forst Plot: Multipage Output

2014-06-10 Thread David L Carlson
izontally. Now open Test.pdf in Acrobat Reader and print to CutePDF using the poster mode. ------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [

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 clipp

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 #

Re: [R] C: drive memory full

2014-06-18 Thread David L Carlson
ick 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 A&M University College Sta

Re: [R] apply diff type function to matrix

2014-06-19 Thread David L Carlson
[,1:3] [,1] [,2] [,3] [1,]54 1.5 [2,]58 1.5 --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-projec

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 A&M University College Station, TX 77840-4352 -Original Message

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

2014-06-24 Thread David L Carlson
] 8 0 1 8 ----- David L Carlson Department of Anthropology Texas A&M 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

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

2014-06-24 Thread David L Carlson
Sent: Tuesday, June 24, 2014 1:32 PM To: David L Carlson Cc: Gabor Grothendieck; Tahira Jamil; r-help@r-project.org Subject: Re: [R] Sample all possible contingency tables both margin fixed David gave a great solution. I think it is better to start from 0 to min(M) instead of from min(M[c(1,3)]) to

Re: [R] Simple permutation question

2014-06-25 Thread David L Carlson
1] "E D A B C" "E D B A C" "E D B C A" "E D A C B" "E D C A B" "E D C B A" This is not the only permutation function in R, but this one has the advantage of being symmetrical. The last permutation is the reverse of the first, the pen

Re: [R] Simple permutation question

2014-06-25 Thread David L Carlson
uot; > tail(perm.ltrs) [1] "E D A B C" "E D B A C" "E D B C A" "E D A C B" "E D C A B" "E D C B A" > David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David L Ca

Re: [R] graph

2014-06-26 Thread David L Carlson
$x, xy2$x, xy3$x, xy4$x) > matplot(x, Density, type="l") > legend("topright", c("mu1", "mu2", "mu3", "mu4"), col=1:4, lty=1:4) - David L Carlson Department of Anthropology Texas A&M University Co

Re: [R] subtracting degree minutes

2014-06-26 Thread David L Carlson
*60/100 So 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 A&M University College Stat

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 <- read.table(text="sym

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

2014-06-30 Thread David L Carlson
or points(sit.sc1, pch=as.numeric(gr)+20, bg=as.numeric(dune.env$Moisture)) # I'll skip the text labels The legend will be complicated since there are groups*ecosytems combinations. - David L Carlson Department of Anthropology Texas A&M University Colle

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] combining data from multiple read.delim() invocations.

2014-07-01 Thread David L Carlson
t;character","POSIXct","POSIXct")) df.all <- do.call(rbind, df.list) > str(df.all) 'data.frame': 15 obs. of 3 variables: $ lpar : chr "A" "A" "A" "A" ... $ started: POSIXct, format: "2014-07-01 11:25:05&quo

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

2014-07-01 Thread David L Carlson
;,"POSIXct","POSIXct")) David C -Original Message- From: Bert Gunter [mailto:gunter.ber...@gene.com] 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, Davi

Re: [R] Help with tables in R

2014-07-03 Thread David L Carlson
els concatenated so that the table appears to be a flat (2 way) 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

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 # Vo

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

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

2014-07-09 Thread David L Carlson
hts)." Use a different method (but not median). --------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

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 A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [m

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

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 for the

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 colClass

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

2014-07-15 Thread David L Carlson
-Original Message- From: jlh.membership [mailto:jlh.members...@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 cutr

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.Rd&d=R_CC David Carlson -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] Strange behaviour of setwd/getwd

2012-11-02 Thread David L Carlson
Aren't you just looking for this? > default.wd <- setwd(tmp.wd <- choose.dir()) ------ David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- >

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread David L Carlson
Logic is irrelevant. You must simply embrace the FoRce. -- Obi Wan David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mai

Re: [R] Plot 3 lines in one graph

2012-11-05 Thread David L Carlson
to compute a slopes and intercepts for lines and then plot those lines? ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project

Re: [R] Plot 3 lines in one graph

2012-11-06 Thread David L Carlson
100) matplot(x[,1], x[,2:4], type="b") ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 From: Ignacio Martinez [mailto:ignaci...@gmail.com] Sent: Tuesday, November 06

Re: [R] a simple list question

2012-11-07 Thread David L Carlson
Combining your, Rolf, and Michael's suggestions makes it possible to eliminate the lappy(): mget(ls()[grep("^x\\.[[:digit:]]+$", ls())], .GlobalEnv) ------ David L Carlson Associate Professor of Anthropology Texas A&M University Colleg

Re: [R] how to generate a set of random numbers that sum to 1 with uniform distribution of elements

2012-11-07 Thread David L Carlson
t the results on a ternary plot: library(compositions) mat <- runif.rcomp(1000, 3) plot(mat) ------ David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 From: Heramb heramb.gadgil at gmail.com Date:

Re: [R] multiple variable basic plot

2012-11-11 Thread David L Carlson
specified line thicknesses, or line types, or line colors so you get whatever the matplot() defaults are. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r

Re: [R] biasing conditional sample

2012-11-11 Thread David L Carlson
---- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Rui Barradas > Sent: Sunday, November 11, 2012 4:36

Re: [R] FW: Two-line title in R legend

2012-11-11 Thread David L Carlson
[1] 3 $text $text$x [1] 1.0625 $text$y [1] 2.578779 > xleft <- pos$rect[["left"]] > ytop <- pos$rect[["top"]] > ybottom <- ytop - pos$rect[["h"]] > xright <- xleft + pos$rect[["w"]] > rect(xleft, ybottom-.1, xright, ytop) -

Re: [R] Matrix to data frame conversion

2012-11-12 Thread David L Carlson
less than 90. -- David L Carlson Associate Professor of Anthropology Texas A&M 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 P

Re: [R] reversing distance matrix for original values

2012-11-14 Thread David L Carlson
t; out[,1] + 1-out[1,1] [1] 1 2 3 4 5 6 7 8 9 10 If the distance matrix is based on more than one variable, you would need to know at least as many of the original observations as variables. ------ David L Carlson Associate Professor of Anthrop

Re: [R] Winsorisation function

2012-11-14 Thread David L Carlson
equal to the maximum. ---------- David L Carlson Associate Professor of Anthropology Texas A&M 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

Re: [R] euclidean dist. between matrices

2012-11-17 Thread David L Carlson
y the distances you don't need: head(dist(rbind(B, A)), 15) ------ David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mai

Re: [R] Examining how cases are similar by cluster, in cluster analysis

2012-11-18 Thread David L Carlson
4 1. 0. 0.000 5 0. 1. 0.000 6 0. 0. 1.000 7 0. 0. 0.000 8 0. 0.0000 0.000 > -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Messa

Re: [R] Examining how cases are similar by cluster, in cluster analysis

2012-11-18 Thread David L Carlson
he variables for each > cluster and run such an analysis but thre must be a more efficient > way of doing this (especially as I experiment with different > clustering methods) > > Thanks again, > > Bob > > At 06:44 AM 19/11/2012, David L Carlson wrote: > >If you jus

Re: [R] Question about making histogram and x must be numeric

2012-11-18 Thread David L Carlson
You tried setting shorter variable names, but the two lines of your data set that you gave us still have the original names, eg. Telephone.lines..per.100.people. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Sta

Re: [R] Plot Area Dimensions

2012-11-19 Thread David L Carlson
uot;, xaxt="n", ylab="y") plot(y5~x, tmp, xlab="", xaxt="n", ylab="y") par(mar=c(4,5,0,5)) plot(y6~x, tmp, xlab="x", ylab="y") - David L Carlson Associate Professor of Anthropology

Re: [R] Joining two files

2012-11-23 Thread David L Carlson
2 NA 4 NA 2 # 8 3 NA 1 NA 2 ---------- David L Carlson Associate Professor of Anthropology Texas A&M 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: Fr

Re: [R] Add column index number to str() output

2012-11-23 Thread David L Carlson
4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ... 4 Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ... 5 Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ... -- David L Carlson Associate Pro

Re: [R] Help in splitting the records

2012-11-26 Thread David L Carlson
ors=FALSE) > x V1 V2 V3 1 qwer 12 qwre 2 ewrtr 7789 ewwe -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project

Re: [R] Speeding reading of large file

2012-11-28 Thread David L Carlson
Using your first approach, this should be faster raw <- readLines(con=filename) dta <- read.table(text=raw[!grepl("[A:DF:Z]" ,raw)], header=FALSE) ---------- David L Carlson Associate Professor of Anthropology Texas A&M University Colle

Re: [R] Plot 3d density

2012-11-28 Thread David L Carlson
ou the axes for the plot, but the z value must be computed from the y values that density returns. This example multiplies the two y values to get z. ------ David L Carlson Associate Professor of Anthropology Texas A&M University College Sta

Re: [R] Speeding reading of large file

2012-11-28 Thread David L Carlson
s in the full version with the correct > column names > > Dennis Fisher MD > P < (The "P Less Than" Company) > Phone: 1-866-PLessThan (1-866-753-7784) > Fax: 1-866-PLessThan (1-866-753-7784) > www.PLessThan.com > > On Nov 28, 2012, at 11:32 AM, David L Carlson

Re: [R] protentially serious R error

2012-12-01 Thread David L Carlson
Congratulations, you've reached the First Circle of the R Inferno. Only 8 more to go http://www.burns-stat.com/pages/Tutor/R_inferno.pdf -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 7

Re: [R] simple subset question

2012-12-02 Thread David L Carlson
IDWeek Total Fry Smolt FryEq Year 195 39 2115018 2083214 31805 2137281 2005 Change to > subset(winter, Year==2012 & Total==max(Total[Year==2012])) IDWeek Total Fry Smolt FryEq Year 21 47 303259 34008 269248 491733 2012 -------

Re: [R] Warning message: In scan(file, what, nmax...)

2012-12-02 Thread David L Carlson
t the first 10 lines. ---------- David L Carlson Associate Professor of Anthropology Texas A&M 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 F86 > Sent: Sunday, December 02, 201

Re: [R] Histogram plot help

2012-12-03 Thread David L Carlson
Does it work the way you want if you add prob=TRUE to the second and third hist() commands and run do.call() before abline()? -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -O

Re: [R] Chi-squared test when observed near expected

2012-12-04 Thread David L Carlson
agree is pretty close to 0. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.o

Re: [R] In factor analysis in the psych package, how can I work out which factors the columns in $scores relate to? How do I know what each of the scores is scoring?

2012-12-05 Thread David L Carlson
Date: 2012-08-08 Title: Procedures for Psychological, Psychometric, and Personality Research Author: William Revelle Maintainer: William Revelle -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station

Re: [R] Changing data frame column headings

2012-12-05 Thread David L Carlson
560 5.521039 2 4.854873 5.612902 5.235817 3 4.636218 5.116499 5.973769 4 5.430009 6.273394 3.511017 5 5.714755 6.876349 4.035907 ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -

Re: [R] In factor analysis in the psych package, how can I work out which factors the columns in $scores relate to? How do I know what each of the scores is scoring?

2012-12-05 Thread David L Carlson
1MR8MR10 MR9MR11 > Thank you, I've taken your advice and cc'd this to Prof William Revelle > Thank you > Best wishes > Brent > > -Original Message- > From: David L Carlson [mailto:dcarl...@tamu.edu] > Sent: Thursday, 6 December 2012 10:33 a.m. >

Re: [R] tool for cluster analysis

2012-12-06 Thread David L Carlson
cluster assignments at that stage (?cutree to get the help page). -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org

Re: [R] Vectorizing integrate()

2012-12-06 Thread David L Carlson
tside the loop should speed things up. ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Be

Re: [R] Can somebody help me with following data manipulation?

2012-12-06 Thread David L Carlson
NA 5 I 0 0.333 6 I 1 0.4285714 7 O 0 1.000 8 O 1 0.000 9 R 0 0.000 10 R 1 0.667 11 T 0 0.833 12 T 1 0.500 But the OP's dat1 contains only 6 observations. ---------- David L Carlson Associate Professor of An

Re: [R] clustering of binary data

2012-12-06 Thread David L Carlson
Do not use html in r-help emails. Look below at what happens to your data. The error message is telling you that t(data) is not numeric. > str(data) That will tell you what kind of data you have. -- David L Carlson Associate Professor

Re: [R] Vectorizing integrate()

2012-12-07 Thread David L Carlson
[8] 0.6894951 0.6649838 0.2385417 ------ David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > pro

Re: [R] Vectorizing integrate()

2012-12-07 Thread David L Carlson
arun [mailto:smartpink...@yahoo.com] > Sent: Friday, December 07, 2012 10:36 AM > To: Doran, Harold > Cc: R help; David L Carlson; David Winsemius > Subject: Re: [R] Vectorizing integrate() > > > > Hi, > Using David's function: > fun <- function(u, m, s) 1/ (1

Re: [R] imputation in mice

2012-12-08 Thread David L Carlson
ou try to compute your propensity scores is not what you think it is. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.o

Re: [R] read.table()

2012-12-08 Thread David L Carlson
ion you sent us. With an text editor, you can line up the columns and then use read.fwf() instead of read.table(), but you will have to ensure that the columns line up and that you insert a delimiter (e.g. a tab between the field names on the first line). ------------

Re: [R] read. table()

2012-12-08 Thread David L Carlson
any > #3  Cuban 12-17  3.7977   1.00487  any > #4    C-SAmerican 12-17  4.3665   0.55329  any > #5  Dominican 12-17  1.8149   0.46677      any > #6 Spanish(Spain) 12-17  6.1971   0.98386  any > > > >  str(dat1) > 'data.frame':    195 ob

<    2   3   4   5   6   7   8   9   10   >