Re: [R] Simple question on finding duplicates

2012-07-25 Thread David L Carlson
Minor correction: duplicate <- ifelse(c(0, a$col[-length(a$col)])==a$col, 1, 0) --- David > -Original Message- > From: David L Carlson [mailto:dcarl...@tamu.edu] > Sent: Wednesday, July 25, 2012 3:23 PM > To: 'Jeff'; 'r-help@r-project.org' &g

Re: [R] density

2012-07-26 Thread David L Carlson
rather fit, see also V&R (2002)." Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. New York: Springer. ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 >

Re: [R] Plotting LDA results

2012-07-26 Thread David L Carlson
between the groups in a plot of the original variables. Time to provide "provide commented, minimal, self-contained, reproducible code" [including data] as called for at the bottom of your message. ------ David L Carlson Associate Professor of Anthropolo

Re: [R] Query

2012-07-26 Thread David L Carlson
Actually you probably want the full manual. It is here http://cran.r-project.org/doc/manuals/fullrefman.pdf -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message-

Re: [R] Counting frequency within each range

2012-07-26 Thread David L Carlson
table(cut(numbers, c(0, 10, 20, 30, . . .), include.lowest=TRUE)) -- 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] How can I use IPF function correctly?

2012-07-27 Thread David L Carlson
nts. Note that the number of iterations is 0 because in a 2 way model the values are directly computed. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From

Re: [R] puzzling classical Mahalanobis distances from covMcd() {robustbase}

2012-07-28 Thread David L Carlson
7387 -0.23956925 <== This matches D2rb$raw.center So the "raw" values are taken for a subset, h, which includes observations 2, 3, 4, 5, 6, 8, and 10. Given that the raw.center and raw.cov are based on a subset of the original data, the mahalanobis distances will not be the s

Re: [R] Nearest Neighbors

2012-07-29 Thread David L Carlson
7 [8,] 40 8 40 8 [9,] 25 9 25 9 [10,] 6 10 6 10 -- 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] Reverse order of x-axis

2012-07-29 Thread David L Carlson
dn't have used xlim=c(100, 0) and then specified a log axis would you? Since log(0) is -Inf, that could create problems. ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -O

Re: [R] distance matrix and hclustering

2012-07-30 Thread David L Carlson
try several group sizes to see what makes the most sense for your data. -- 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] How can I use IPF function correctly?

2012-07-30 Thread David L Carlson
,17,17) targ.gen<-c(24,26) targ.reg<-c(13,13,12)   f2<-ipf(mytable, margins=c(1,2,0,1,3,0,2,3), eps = 1e-04, maxits = 50, showits = TRUE) #no 3 way interaction Where and how should I input/set my target value here? Any sugguestions? or I have to write my own function?   Manythanks,   Mandy   O

Re: [R] Appending the column names

2012-07-30 Thread David L Carlson
11 12 5 Y Bcc 13 12 11 6 Y Ccc 11 16 20 You just might find that one of these is what you need. ------ David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Messa

Re: [R] Thinning Lattice Plot

2012-07-30 Thread David L Carlson
You might also check ?pdf on your system. On Windows the default is for compression. Your code creates a 186K file although it is slow to load reflecting the overhead from decompressing the file. -- David L Carlson Associate Professor of Anthropology

Re: [R] Different results between lda(mass) and spss discriminant analysis

2012-08-01 Thread David L Carlson
I don't see anything obviously wrong, but I seem to remember that SPSS uses equal prior probabilities as the default whereas lda() uses "the class proportions for the training set." That might explain the difference. ------ David L Ca

Re: [R] sub setting a data frame with binomial responses

2012-08-01 Thread David L Carlson
x1 1 5 2 2 5 3 3 5 1 4 5 3 -- 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- >

Re: [R] Density plots

2012-08-03 Thread David L Carlson
s not seem to exist - sm.densityplot.compare - plus you copy the error message but not your function call. How can we possibly tell you what you did wrong? Is this really function sm.density.compare() in package sm? ------ David L Carlson Associate Pr

Re: [R] Multiple Comparisons-Kruskal-Wallis-Test: kruskal{agricolae} and kruskalmc{pgirmess} don't yield the same results although they should do (?)

2012-08-03 Thread David L Carlson
no significant differences between the groups, so there is no reason to use a multiple comparison test. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- >

Re: [R] issue with nzchar() ?

2012-08-06 Thread David L Carlson
RUE TRUE TRUE TRUE [25] TRUE TRUENA FALSE -- 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-h

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread David L Carlson
FALSE TRUE FALSE FALSE FALSE TRUE [13] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [49] FALSE FALSE FALSE FALSE >

Re: [R] Re-grouping data in R

2012-08-07 Thread David L Carlson
Your first command erases all the data in that column: dat$final_purchase_amount<- NA so when you refer to it later, it consists of only NAs. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 778

Re: [R] Adjusting coordinates in raster plots

2012-08-08 Thread David L Carlson
Like this? r <- raster(ncol=10, nrow=10, xmn=0, ymx=0) values(r) <- mat plot(r) -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From:

Re: [R] Density

2012-08-08 Thread David L Carlson
lue" which provides information about what values are returned by the function. str(den0) den0$x den0$y plot(den0$x, den0$y, typ="l") ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4

Re: [R] Density

2012-08-09 Thread David L Carlson
the density is estimated. y the estimated density values. These will be non-negative, but can be zero.   We can also check this using the code below.   X <- rnorm(100) density(X)-> den0 den0 X[1:10] (den0$x)[1:10] (den0$y)[1:10] round(dnorm((den0$x)[1:10]), 6) round(dnorm(X[1:10]), 6)   Thank

Re: [R] Fill pattern for Boxplots?

2012-08-09 Thread David L Carlson
[2,], (1:ngroups)+.4, outstat$stats[4,], density=dval, angle=aval)# draw the rectangles You can also play with lty= and lwd= but that will affect the box border as well. ---------- David L Carlson Associate Professor of Anthropology Texas A&

Re: [R] help hist some 'x' not counted; maybe 'breaks' do not span range of 'x'

2012-08-09 Thread David L Carlson
Use summary(dados[[1]]). The error message is telling you that the data include values outside the 0 to 20 range you have specified. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-

Re: [R] indexing in data frames

2012-08-09 Thread David L Carlson
, 1989), group = c("G1988", "G1989")) > b <- data.frame(group = c(rep("G1988", 3), rep("G1989", 2)), d = c(1985, 1982, 1984, 1988, 1980)) > ab <- merge(a, b) > ab <- data.frame(ab, diff=ab$year-ab$d) > new <- split(ab$diff, ab$grou

Re: [R] indexing in data frames

2012-08-09 Thread David L Carlson
> -Original Message- > From: David Winsemius [mailto:dwinsem...@comcast.net] > Sent: Thursday, August 09, 2012 5:17 PM > To: dcarl...@tamu.edu > Cc: 'jimi adams'; r-help@r-project.org > Subject: Re: [R] indexing in data frames > > > On Aug 9, 2012, at 2:43 PM, D

Re: [R] Fill pattern for Boxplots?

2012-08-10 Thread David L Carlson
ots? > > Thank you! This sounds good and easy to do (if I can as well make > stripes to the legend) > > Original Message-- > From: David L Carlson > To: , 'John Kane' > Date: 09.08.2012 22:10 > Subject: Re: [R] Fill pattern for Boxplots? >

Re: [R] help error histograma

2012-08-10 Thread David L Carlson
--Original Message- >> > From: aprendizprog...@hotmail.com >> > Sent: Fri, 10 Aug 2012 16:08:16 +0300 >> > To: kri...@ymail.com, r-help@r-project.org >> > Subject: Re: [R] help error histograma >> > >> > >> > Hi, >>

Re: [R] translating HTML character entities to accented characters

2012-08-10 Thread David L Carlson
Loire" [4] "Groß Särchen, Germany" > apropos("HTML") For a CSV file you would want to preserve the lines by adding to the end of each line first. -- David L Carlson Associate Professor of Anthropology Texas A&M Uni

Re: [R] Function definition: where is the error in the "for" loop?

2012-08-11 Thread David L Carlson
There is no command "For" in R. It is "for" and R is case sensitive. ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-b

Re: [R] How do I find the apparent magnitude of a galaxy from a FITS file?

2012-08-11 Thread David L Carlson
p://www.sdss.org/dr7/). ---------- 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 David Winsemius > Sent:

Re: [R] Trouble with Spatial Data Example Script

2012-08-11 Thread David L Carlson
LC_TELEPHONE=C > > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > > > attached base packages: > > [1] stats graphics grDevices utils datasets methods base > > > > other attached packages: > > [1] sp_0.9-99 > > > > loaded via a namespace

Re: [R] replace funcion

2012-08-11 Thread David L Carlson
Or if you want to use recode (which you forgot to mention is in package car): set.seed(1) df1<- c(sample(1:12, 50, replace=TRUE)) # sample data library(car) recode(df1, "c(1, 2, 3, 4, 11, 12)='invierno'; 5:10='verano'") -----------

Re: [R] translating HTML character entities to accented characters

2012-08-12 Thread David L Carlson
", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú",

Re: [R] named character question

2012-08-13 Thread David L Carlson
{5}", add1)) ------ 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 Erin Hodgess > S

Re: [R] merge counts from table()

2012-08-13 Thread David L Carlson
3 4 5 0 1 1 1 1 > table(c(x, y)) 1 2 3 4 5 1 2 2 2 1 > table(x) + table(y) x 1 2 3 4 5 1 2 2 2 1 ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Messag

Re: [R] to remove columns and rows

2012-08-14 Thread David L Carlson
0 There is a typo in your message. Columns 1, 2, 3, 4, 5, 7, and 10 have all elements duplicated and 6, 8, and 9 do not. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-pro

Re: [R] Reading one column .csv file

2012-08-15 Thread David L Carlson
On the Mac try pipe("pbpaste") instead of "clipboard." ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-proj

Re: [R] Column Extraction from matrix

2012-08-16 Thread David L Carlson
You could also use a 3d array instead of a list: > m <- matrix(1:400, ncol=100, byrow=TRUE) > a <- array(m, dim=c(2, 2, 100), dimnames=list(row=c(1, 2), col=c(1, 2), tbl=c(paste0("a", 1:100 > a[,,1] # First table by index col row 1 2 1 1 201 2 101 301 > a[,,"a1"] # First t

Re: [R] Apply a function according to factor levels.

2012-08-16 Thread David L Carlson
?tapply -- 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] question about A2R

2012-08-16 Thread David L Carlson
tions of Romain Francois collection License: GPL version 2 or newer Depends: R (>= 2.1.1), grid URL: http://addictedtor.free.fr/packages Built: R 2.2.1; ; 2006-01-04 23:25:37; unix ------ David L Carlson Associate Professor of Anthropology Texas A&

Re: [R] Plot multiple variables: label points

2012-08-17 Thread David L Carlson
, ...) points(x, y, pch=as.numeric(variable$group))) The first one plots the group instead of a point and the second one plots a symbol for each group. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station

Re: [R] Unequal splits from a column

2012-08-17 Thread David L Carlson
quot;[/()]") > tmp2 <- sapply(tmp, function(x) as.numeric(x[-1])) > maxlen <- max(sapply(tmp2, length)) > datnew <- data.frame(t(sapply(tmp2, function(x) c(x, rep(0, maxlen-length(x)) > datnew X1 X2 X3 X4 1 60 25 15 0 2 90 10 0 0 3 40 35 15 10 4 40 25 25 1

Re: [R] prevalence of R in publications and institutions

2012-08-17 Thread David L Carlson
d "Statistics Using R" (28 volumes). ---------- 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-bounc

Re: [R] Beside Barplot

2012-08-20 Thread David L Carlson
uot;top", ncol=3))) > with(mydata, barplot(t(cbind(female, male)), names.arg=opinion, beside=TRUE, cex.names=.8, legend.text=TRUE)) -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 >

Re: [R] Beside Barplot

2012-08-20 Thread David L Carlson
bounces@r- > project.org] On Behalf Of David L Carlson > Sent: Monday, August 20, 2012 2:15 PM > To: 'darnold'; r-help@r-project.org > Subject: Re: [R] Beside Barplot > > Sure but which way? > > > dput(mydata) > structure(list(opinion = structure(c(4L, 5L, 1L,

Re: [R] Entering a table

2012-08-22 Thread David L Carlson
ed by `ML' count observed fitted 0 109 108.6701738 1 65 66.2888060 2 22 20.2180858 33 4.1110108 41 0.6269291 ---------- David L Carlson Associate Professor of Anthropology Texas A&M Univ

Re: [R] Iterative sampling with restrictions

2012-08-22 Thread David L Carlson
> table(assign) assign 1/2 1/3 2/1 2/3 3/1 3/2 10 10 10 10 10 10 -- 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- >

Re: [R] Iterative sampling with restrictions

2012-08-22 Thread David L Carlson
; table(assign) assign 1/2/3 1/3/2 2/1/3 2/3/1 3/1/2 3/2/1 101010101010 --- David > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of David L Carlson > Sent: Wednesday, August 22, 2012 5

Re: [R] TukeyHSD output

2012-08-23 Thread David L Carlson
cld(Pairs.Ex) # (c)ompact (l)etter (d)isplay plot(confint(Pairs.Ex)) -- 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-bounce

Re: [R] Turning of source echo

2012-08-25 Thread David L Carlson
This is not an RStudio issue. The RConsole echoes commands and then the output. If you want to open a window to display the output of a command, you might look at package tcltk. -- David L Carlson Associate Professor of Anthropology Texas A&M Univer

Re: [R] error type

2012-08-26 Thread David L Carlson
Look at your plot command. You included type="o" twice. ------ David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-projec

Re: [R] error type

2012-08-26 Thread David L Carlson
You are still using html - you need to tell hotmail to use plain text only. I can't replicate your error with the following: dados <- c(44, 40, 39, 38, 0, 7, 7, 1030, 57, 37, 5146, 40, 41, 4737, 34, 36, 2636, 28, 33, 3738, 26, 28, 2742, 38, 36, 3636, 27, 22, 2853, 43, 33, 40) plot(dados[1],ty

Re: [R] Aligning barplot

2012-08-26 Thread David L Carlson
How about this? > grps <- unique(c(BagA, BagB)) > BagA <- factor(BagA, levels=grps) > BagB <- factor(BagB, levels=grps) > layout(c(2,1)) > barplot(table(BagB)) > barplot(table(BagA)) ---------- David L Carlson Associate Professo

Re: [R] ?nchar ?strsplit

2012-08-27 Thread David L Carlson
anning to do with it. ---------- 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]

Re: [R] K-Means clustering Algorithm

2012-08-29 Thread David L Carlson
oes not. It also has several methods for choosing starting seeds. In R you would have to use or create a function to compute those starting seeds and then pass them to kmeans. ---------- David L Carlson Associate Professor of Anthropology Texas A&

Re: [R] Histogram to KDE

2012-08-31 Thread David L Carlson
s = "data.frame") This will give you a plot of the kde estimate: xkde <- density(rep(bins, counts), bw="SJ") plot(xkde) As for the standard error or the confidence interval, you would probably need to use bootstrapping. ---------- David

Re: [R] Adding summary title to table

2012-09-04 Thread David L Carlson
7 22 Self-medicated 69 81 50 ---------- 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] binary data

2012-09-04 Thread David L Carlson
This is a pretty vague question. Ecologists work quite a bit with distance matrices and binary data. You will find some options in packages vegan and ecodist for example. I'm sure there are many others -- David L Carlson Associate Profess

Re: [R] Comparing Von Bertalanffy Growth Curves

2012-09-04 Thread David L Carlson
ctor(Year) > Agei=as.integer(Age) > ( svCom <- vbStarts(MMi~Agei,data=LMB)) Error: could not find function "vbStarts" Now you've left out loading one or more packages with library() commands. I'll stop here. If you want help, provide "minimal, self-contained

Re: [R] Recoding categorical gender variable into numeric factors

2012-09-05 Thread David L Carlson
e a character array (chr): > str(data) 'data.frame': 10 obs. of 1 variable: $ sex: chr "Male" "Male" "Male" "Male" ... If you want to convert a character array to a factor just use the command: data$sex <- factor(data$sex) By def

Re: [R] using sqldf's read.csv.sql to read a file with "NA" for missing

2012-09-05 Thread David L Carlson
. Inserting a complete record at the top of the data prevents the conversion to text, but NA's are still converted to zeros. As a workaround, you could replace NA's with before reading the file and then convert this value to NA within R. ----

Re: [R] creating a symmetric matrix

2012-09-07 Thread David L Carlson
4321 ------ 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

Re: [R] Using predict() After Adding a Factor to a glm.nb() Model

2012-09-08 Thread David L Carlson
etters[1:4], year=1980:1999) > p2<-predict(model_b, newdata=py2, se.fit=TRUE, type='response') > py2 <- data.frame(py2, p2) > plot(count~year, data=data, pch=as.character(site)) > x <- unstack(py2, py2$year~py2$site) > y <- unstack(py2, py2$fit~py2$site) > matlines(

Re: [R] PCA legend outside of PCA plot

2012-09-09 Thread David L Carlson
Try adding the parameter xpd=TRUE to your legend() statement. Without reproducible code it is pretty hard to be sure what the problem is. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-

Re: [R] Spatial Statistics using R

2011-11-17 Thread David L Carlson
/files/rex1.pdf -- 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-boun...@r-project.org] On Behalf Of vioravis

Re: [R] how to call a function for each row

2011-11-30 Thread David L Carlson
Isn't this even easier? > X1 <- c(1:3) > X2 <- c(3, 4, 6) > X3 <- c(5, 6, 1) > Y <- 6*X1 + 7*X2 + 8*X3 > Y [1] 67 88 68 Or if you really need a function: > MakeY <- function(x, y, z) 6*x + 7*y + 8*z > MakeY(X1, X2, X3) [1] 67 88 68 -----

Re: [R] lda output missing

2011-12-08 Thread David L Carlson
r2, Groups)# Now it shows up For predicted group membership, look at predict.lda For tests of significance, look at Anova in package car For canonical discriminant analysis, look at package candisc ---------- David L Carlson Associate Professor of Anthropo

Re: [R] Adding a vertical line to plot with two overlapping density plots

2012-01-04 Thread David L Carlson
) } ) -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Petr PIKAL Sent: Wednesday, January 04, 2012 10:27 A

Re: [R] Mahalanobis Distance

2011-09-27 Thread David L Carlson
are all +/-1. -- 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-boun...@r-project.org] On Behalf Of david

Re: [R] Mahalanobis Distance

2011-09-27 Thread David L Carlson
Since you are only looking at the distance between two points, they must fall on a line so no matter how many values you have for each point, their dimension is still 1. Mahalanobis distance is a way of measuring distance in multivariate space when the variables (columns) are correlated with one an

Re: [R] Odd gridding pattern when plotting

2011-09-30 Thread David L Carlson
>From ?image " Images for large z on a regular grid are more efficient with useRaster enabled and can prevent rare anti-aliasing artifacts, but may not be supported by all graphics devices. " Adding useRaster=TRUE to the two image() calls gets rid of the white grid lines. -Original Message--

Re: [R] x axis

2011-10-13 Thread David L Carlson
There are lots of options since you did not tell us what you want on the axis (or what you have tried). For example if you want more than 6 tick marks/labels, replace xlim=c(0, 3000) with xaxp=c(0, 3000, 12) to get labels every 250 meters instead of 500. Depending on the size of the graph window y

Re: [R] reading a dense file of binary number

2011-10-18 Thread David L Carlson
Or do you want each number separated? > data <- textConnection("010101001110101 + 10101001010 + 01001010010" + ) > result <- as.matrix(read.fwf(data, rep(1, 15))) > result V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 [1,] 0 1 0 1 0 1 0 0 1 1 1 0 1 0 1 [2,]

Re: [R] replicating SAS's "proc rank" procedure

2011-10-21 Thread David L Carlson
You can get the same results with the cut() function in R: cut(cars$speed, breaks=quantile(cars$speed, probs=c(0:15/15)), labels=1:15, include.lowest=TRUE) -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station

Re: [R] Converting data frame into multidimensional array

2011-10-21 Thread David L Carlson
How about? > x <- array(Titanic, dim=c(4,2,2,2)) > str(x> num [1:4, 1:2, 1:2, 1:2] 0 0 35 0 0 0 17 0 118 154 ... ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -

Re: [R] dotPlot with diagonal

2011-10-26 Thread David L Carlson
Try again. There is no dotPlot() function in lattice and dotplot() does not take two separate rows so the example you gave us generates an error message if dotPlot is changed to dotplot. -- David L Carlson Associate Professor of Anthropology Texas A

Re: [R] Imputing Missing Data: A Good Starting Point?

2011-11-02 Thread David L Carlson
veral approaches and provides R code for them. -- 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-boun...@r-projec

Re: [R] Histograms in R

2011-11-03 Thread David L Carlson
The lines() command doesn't work and histogram combines categories unless you specify the number. How about a barplot Lam <- 3 X <- table(rpois(500, Lam)) Max <- length(X)-1 barplot(rbind(X, 500*dpois(0:Max, Lam)), beside=TRUE, legend.text=c("Observed", "Expected")) or a rootogram library(vcd) ro

Re: [R] from points in Lon/Lat to physical distance in dist class

2011-11-08 Thread David L Carlson
Look at distm() in package geosphere. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

Re: [R] barplot names.arg

2011-11-11 Thread David L Carlson
. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Diviya Smith Sent: Thursday, November 10, 2011 1

Re: [R] How to apply two parameter function in data frame

2012-03-06 Thread David L Carlson
a and x X-squared = 7.8289, df = 9, p-value = 0.5515 $d Pearson's Chi-squared test data: df$a and x X-squared = 6.1221, df = 9, p-value = 0.7276 $e Pearson's Chi-squared test data: df$a and x X-squared = 6.6181, df = 9, p-value = 0.6768 --

Re: [R] find points on a graph

2012-03-07 Thread David L Carlson
t;, "gene2", "gene3", "gene4", "gene5"), c("codon1", "codon2", "codon3"))) Library(ca) plot(ca(table, suprow=c(4, 5))) This uses the first 3 rows for the correspondence analysis and then plots rows 4 and 5 in that space us

Re: [R] A question on histogram - area much less than 1

2012-03-12 Thread David L Carlson
1 Note that the first density multiplied by 35 is .279 exactly what you expected and the sum of the densities multiplied by the width of each bar (35) is 1. The height of the bar is not the probability, the area of the bar is the probability. ---------- David L Carls

Re: [R] Maximum of remaining elements of vector

2012-03-12 Thread David L Carlson
ling list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- David L Carlson Associate Professor

Re: [R] Update Packages error

2012-03-30 Thread David L Carlson
You can check to see if you have authorization to update those files by right-clicking on the R shortcut icon (on your desktop or in Windows | All Programs | R | R2.14.1 (your version may be different). In the menu that opens, if there is an option to Run as Administrator (near the top on my system

Re: [R] Limitation on number of variables and data points in clustering

2012-04-02 Thread David L Carlson
You should probably read the posting guide, but the answer is "Yes." ------ David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project

Re: [R] grouping

2012-04-03 Thread David L Carlson
Or just replace c(0, .333, .667, 1) with n <- 10 split(x, cut(x, quantile(x, prob= c(0, 1:(n-1)/n, 1)), include.lowest=TRUE)) where n is the number of groups you want. -- David L Carlson Associate Professor of Anthropology Texas A&M Uni

Re: [R] cluster analysis with pairwise data

2012-04-04 Thread David L Carlson
ata[,i:(i+1)])^2 } dm <- sqrt(dm) dm ---------- 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-boun...@r-project.o

Re: [R] Cluster Analysis

2012-04-16 Thread David L Carlson
At the R command prompt ?kmeans (for info on the R equivalent to FASTCLUS) ?hclust (for info on the R equivalent to CLUSTER) Install package clusterSim and look at function index.G1 for the Calinski-Harabasz pseudo F-statistic -- David L Carlson

Re: [R] Creating a point pattern with spatstat

2012-04-16 Thread David L Carlson
- cbind(x, y) # Now a matrix of the 1/0 values z <- matrix(as.matrix(Lv2.8), nrow=144, ncol=1) # Finally eliminate the coordinates that are empty points <- xy[as.logical(z),] # Now your commands will work (with the window expanded slightly) X <- as.ppp(points, owin(c(0, 13), c(0,13))) plo

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread David L Carlson
wa', lwd=3, add=TRUE) Assuming you want the state outline in black with the county boundaries in white. Otherwise just eliminate the last map command. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station

Re: [R] graph paper look

2012-01-19 Thread David L Carlson
q(-1, 2, .5), lty=1, col="gray") par(oldpar) ------ 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-boun...

Re: [R] Reading in tab (and space) delimited data within a script XXXX

2012-01-19 Thread David L Carlson
xt data and the Rdata (data3). It will just get confusing. ---------- 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-boun

Re: [R] contour(): Thickness contour labels

2012-01-23 Thread David L Carlson
Does adding font=2 (to select bold) work? See ?par - option font. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-

Re: [R] calculating distance between latitude and longitude

2012-01-27 Thread David L Carlson
Look at distm() in package geosphere or geoDist() in package SoDA. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mail

Re: [R] Arial font in eps figures in R

2012-02-09 Thread David L Carlson
uot;)) postscriptFonts(Arial=Arial) par(family="Arial") postscript("testArial.eps", horizontal=F, onefile=F, width=4, height=4) plot(1:10, 1:10) dev.off() -- David L Carlson Associate Professor of Anthropology Texas A&M University Colleg

Re: [R] Importing a CSV file

2012-02-10 Thread David L Carlson
, row.names=1, header=T) I believe that "clipboard" works only on Windows computers. ---------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r

Re: [R] multi-regression with more than 50 independent variables

2012-02-13 Thread David L Carlson
among the 57 variables so that you are only getting slope values for 11. ---------- 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

<    4   5   6   7   8   9   10   >