Re: [R] polygon angle option perpendicular to axis

2016-04-27 Thread Peter Alspach
quot; it would help. HTH Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Simon, Heather Sent: Thursday, 28 April 2016 8:17 a.m. To: r-help@r-project.org Subject: [R] polygon angle option perpendicular to axis I am trying to use the angle op

Re: [R] PDF form Rstudio

2016-02-25 Thread Peter Alspach
So, do you have MikTeK installed (assuming you are using Windows)? Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Alnazer Elbedairy Sent: Friday, 26 February 2016 5:13 p.m. To: Erin Hodgess Cc: r-help mailing list Subject: Re: [R] PDF

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Peter Alspach
isn't moderated in the 'usual' sense. That said, I have occasionally asked a new poster to reword their question (or simply add a subject line) and explained that this helps ensure they get a good answer, and not a rude one. Mostly people seem to appreciate that. Peter Alsp

Re: [R] Working with Data Frames

2015-11-03 Thread Peter Alspach
Tena koe Robert Many times in R one can do things without a loop. In this case, see ?rle. You might also need to check substring or months depending on how you dates are stored. HTH Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] Locating the starting position of the first number in a string

2015-11-02 Thread Peter Alspach
e end. If this is correct, then use this feature (i.e., nchar(ID)-4) as you'd want "IBBS3_MSM_HN104213" (the fifth element in ID) to split to IBBS3, MSM, HN1 and 04213. However, if it isn't always 5 digits then split at the first number (i.e., HN and 104213). HTH .

Re: [R] heritability parameter

2015-10-13 Thread Peter Alspach
ke an exclusive list (e.g., nadiv and hglm), but it's a start. I don't find your question clear, and thus apologise if the above does not address your request. Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ramendra Sarma Sent: Wednes

Re: [R] Multiple if function

2015-09-15 Thread Peter Alspach
Tena koe Maria It seems you need to multiply Flow by 0.05+ASBClass/20 (i.e., no if calls are necessary) HTH Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Maria Lathouri Sent: Tuesday, 15 September 2015 10:57 p.m. To: r-help@r

Re: [R] indices of mismatch element in two vector with missing values

2015-07-28 Thread Peter Alspach
One way seq(test1)[-which(test1==test2)] but I imagine there are better ones . Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of baccts Sent: Wednesday, 29 July 2015 8:26 a.m. To: r-help@r-project.org Subject: [R] indices of

Re: [R] Plotting legend outside of chart area

2015-06-24 Thread Peter Alspach
Tena koe Samantha You probably need to set some graphics parameters such as xpd and mar (see ?par), and then give the × and y location of the legend rather than 'bottomright' (see ?legend). HTH .... Peter Alspach PS Please don't post in html (see the posting guide) ... P

Re: [R] Using dates in R

2015-03-04 Thread Peter Alspach
Tena koe Brian See ?as.Date and ?strptime (and, maybe, ?locales). For example: as.Date('2/15/15', '%m/%d/%y') [1] "2015-02-15" as.Date('12/15/14', '%m/%d/%y') < as.Date('2/15/15', '%m/%d/%y') [1] TRUE > as.Date('12/15/16', '%m/%d/%y') < as.Date('2/15/15', '%m/%d/%y') [1] FALSE You might have p

Re: [R] Replace the value with 1 and 0

2015-02-25 Thread Peter Alspach
;month')], sum) will give your final table, but it will need some tidying up. HTH Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of smart hendsome Sent: Thursday, 26 February 2015 11:54 a.m. To: r-help@r-project.org Subject: [R] Re

Re: [R] Bayesian Networks

2015-02-17 Thread Peter Alspach
Tena koe Elias Googling 'Bayesian Networks in R' brings up several packages, so the answer appears to be 'Yes'. Whether any of them are relevant to you is another question. HTH Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-proje

Re: [R] counting sets of consecutive integers in a vector

2015-01-04 Thread Peter Alspach
Tena koe Mike An alternative, which is slightly fast: diffv <- diff(v) starts <- c(1, which(diffv!=1)+1) cbind(v[starts], c(diff(starts), length(v)-starts[length(starts)]+1)) Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf O

Re: [R] Stop R from changing matrix to numeric

2014-12-17 Thread Peter Alspach
(ttMat) str(ttMat[1,]) str(as.matrix(ttMat[1,])) str(t(as.matrix(ttMat[1,]))) str(matrix(ttMat[1,], ncol=2)) HTH . Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sachinthaka Abeywardana Sent: Wednesday, 17 December 2014 7:55 p.m. To: r-

Re: [R] Convert time format to character

2014-11-03 Thread Peter Alspach
Tena koe For example: myTime <- Sys.time() myTime [1] "2014-11-04 14:58:10 NZDT" format(myTime, '%Y%m%d:%H%M%S') [1] "20141104:145810" My information in ?strptime. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-01 Thread Peter Alspach
23 TRUE # 3 40 45 FALSE # 4 10 12 FALSE # 5 70 72 TRUE # 6 101 90 FALSE # 7 9 12 FALSE Which seems correct. Can't say why you get something different without more details. Peter Alspach -Original Message- From: Kate Ignatius [mailto:kate.ignat...@gmail.com] Sent: Thursday, 2

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-01 Thread Peter Alspach
be enough to allow you to get there. HTH .... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Kate Ignatius Sent: Thursday, 2 October 2014 11:11 a.m. To: r-help Subject: [R] How to check to see if a variable is with

Re: [R] Import data from Excel to R

2014-09-09 Thread Peter Alspach
pper to do the most standard tasks (which I can share if you like) .... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of JAWADI Fredj Sent: Wednesday, 10 September 2014 8:48 a.m. To: r-help@R-project.org Subject: [R] I

Re: [R] Frequencies for a list of vectors

2014-08-05 Thread Peter Alspach
Alternatively, use sapply instead of lapply marieData <- list('30008'=c(1,0,1,0), '60008'=c(0,0,1,0), '90008'=c(0,0,1,0), '17'=1, '130001'=c(0,1)) marieData $`30008` [1] 1 0 1 0 $`60008` [1] 0 0 1 0 $`90008` [1] 0 0 1 0 $`17` [1] 1 $`130001` [1] 0 1 table(sapply(marieData, paste

Re: [R] a knitr question

2014-07-29 Thread Peter Alspach
Kia ora Erin But beware - to quote from Yihui 2013 introduction to knitr "It is easy to revert to the output with prompts (set option prompt=TRUE), and you will quickly realize the inconvenience to the readers if they want to copy and run the code ..." Peter Alspach -Origin

Re: [R] working on a data frame

2014-07-24 Thread Peter Alspach
ectors, as Sarah says. Try: yourData[,10] <- yourData[,9]/yourData[,8] yourData[yourData[,8]==0,10] <- yourData[yourData[,8]==0,9] This doesn't change the 0 to 1 in column 8, but it doesn't appear you actually need to do that. HTH Peter Alspach -Original Message--

Re: [R] Retrieve Axis coordinates from map

2014-07-24 Thread Peter Alspach
Tena koe Julien I don't use the maps package much, but I suspect par()$usr will allow you to do what you want. HTH .... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Julien Million Sent: Friday, 25 July 2

Re: [R] Using apply() with functions I wrote

2014-07-24 Thread Peter Alspach
Tena koe Steven R is case-sensitive. FUN is missing (you have supplied fun - and × and margin) ... HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Pfeiffer, Steven Sent: Friday, 25 July 2014 5:08 a.m. To

Re: [R] Is there an easier way than this to list all functions in the global environment?

2014-05-18 Thread Peter Alspach
ser system elapsed # 47.860.02 47.89 test <- character(10^5) system.time(for (i in 1:10^5) test[i] <- as.character(i)) # user system elapsed # 0.25 0.00 0.25 HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project

Re: [R] Select random observation from a group

2014-03-27 Thread Peter Alspach
Tena koe Whitney tapply should work. Try: tapply(yourData$IndividualID, yourData$FamilyID, sample, size=1) # untested HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Whitney Melroy Sent: Friday, 28 March

Re: [R] Beginner: How do I copy the results from a for loop in a csv file?

2014-03-17 Thread Peter Alspach
empMat, 2, diff)) [,1] [,2] [,3] [,4] [1,] 75 -10 46 38 [2,] 12 -14 -62 42 and then write.csv(diffMat, 'diffMat.csv') HTH .... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of koushiki sark

Re: [R] Beginner: how to split up character string into different columns

2014-03-17 Thread Peter Alspach
Tena koe Jessie Lots of ways of doing this. Perhaps the easiest, if your data is formatted as you suggest, is to use substring; e.g., substring(yourData$Sample, 1, 4) should give you the sites. Otherwise, you might need to investigate regular expressions. HTH . Peter Alspach

Re: [R] cum sums

2014-03-09 Thread Peter Alspach
<- unlist(by(df1$val, df1$id, cumsum)) df1 If you need to get back to the original order you can sort by row.names. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon Sent: Monday, 10 March 201

Re: [R] How to obtain a mean by more than one other variable

2014-03-09 Thread Peter Alspach
Tena koe Erynn Have you checked tapply and aggregate? HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erynn Call Sent: Monday, 10 March 2014 3:40 p.m. To: r-help@r-project.org Subject: [R] How to obtain a

Re: [R] Plots with Y axis split into two scales

2014-02-25 Thread Peter Alspach
Another suggestion - would a square-root scale work for you? Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon Sent: Wednesday, 26 February 2014 3:00 p.m. To: David Parkhurst Cc: r-help@r-project.org Subject

Re: [R] "for" loop in R - strange behaviour

2014-01-29 Thread Peter Alspach
Tena koe Not really strange: (7+2):11 is 9:11, 7+2:11 is 7+c(2,3,4,5,6,7,8,9,10,11); i.e., 9:18 Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Supriya Jain Sent: Thursday, 30 January 2014 5:32 a.m. To: r-help@r

Re: [R] How to evaluate sequence of strings like this

2013-12-08 Thread Peter Alspach
Tena koe Try apply(mydat, 1, paste, collapse='') HTH .... Peter Alspach From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of kingsly [ecoking...@yahoo.co.in] Sent: Monday, December 09, 2013 12:22 AM To: r-help@r-p

Re: [R] Arcsine transformation

2013-09-22 Thread Peter Alspach
Tena koe I think you'll find the arcsine transformation is asin(sqrt(x/100)) where × is the percentage. However, it might be better to ask whether the data wouldn't be better analysed using generalised models (e.g., glm). HTH .... Peter Alspach -Original Message- From: r

Re: [R] combine select data from 2 dataframes sharing same variables

2013-07-17 Thread Peter Alspach
Tena koe Without reading your request in detail, I will suggest you look at ?merge. It is often the answer when 'combine' is in the question. Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of bcrombie Sent

Re: [R] Importing data by odbcConnectExcel in 64 bit

2013-07-16 Thread Peter Alspach
liarities of the Excel drivers. readOnly = TRUE may allow very limited changes (to insert and update rows)." HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ahmed Attia Sent: Wednesday, 17 July 2013 6:25 a.

Re: [R] Quote as element of a vector/list

2013-04-30 Thread Peter Alspach
Tena koe Jie Try x <- ' 12"ab"34 ' plot(1:10, xlab=x) HTH ... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jie Sent: Wednesday, 1 May 2013 6:46 a.m. To: r-help@r-project.org Subject: [R

[R] Introduction to R. Any such documentation in Vietnamese?

2013-03-19 Thread Peter Alspach
scientists involved from using Excel for 'analysis' to R. Thanks .... Peter Alspach The contents of this e-mail are confidential and may be ...{{dropped:17}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Function completely locks up my computer if the input is too big

2013-03-05 Thread Peter Alspach
[BEN1> -10] <- NA}) user system elapsed 0.170.030.20 all.equal(BEN, BEN1) [1] TRUE HTH ... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Benjamin Caldwell Sent: Wednesday, 6 March 2013 10:18 a.m.

Re: [R] Using if

2012-11-20 Thread Peter Alspach
0, length(EvHint)) RiskTest1[EvHint==1 & MinTex==1] <- 1}) all.equal(RiskTest0, RiskTest1) Hei kona ra Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jeff Newmiller Sent: Wednesday, 21 November 2012 8:1

[R] FW: Interfacing R and Weka

2012-11-08 Thread Peter Alspach
-Original Message- From: Patrick Connolly Sent: Friday, 9 November 2012 11:29 a.m. To: Peter Alspach Subject: Interfacing R and Weka > version _ platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu sta

Re: [R] Plot 3 lines in one graph

2012-11-05 Thread Peter Alspach
ith(yourData, plot(x, y1, ylim=range(unlist(yourData[,-1])), type='l')) with(yourData, lines(x, y2, col='red3')) with(yourData, lines(x, y3, col='blue2', lty='dashed')) I hope this is of some help ... Peter Alspach -Original Message- From: r-help-bou

Re: [R] Name assignment in for loop

2012-11-01 Thread Peter Alspach
s the list using these names as I find that less error prone and more informative. HTH .... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of nrm2010 Sent: Friday, 2 November 2012 10:16 a.m. To: r-help@r-project.org S

Re: [R] Confused by code?

2012-09-23 Thread Peter Alspach
first element of × and y (repeatedly). Hope this helps Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bazman76 Sent: Monday, 24 September 2012 8:53 a.m. To: r-help@r-project.org Subject: [R] Confused by code? x<

Re: [R] Extracting data from dataframe with tied rows

2012-08-23 Thread Peter Alspach
ames(johnAgg)[3] <- 'distance' merge(johnAgg, johnData) HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of rjb Sent: Friday, 24 August 2012 9:19 a.m. To: r-help@r-project.org Subject: [R] Extracting da

Re: [R] a priori mean comparison/orthogonal contrast?

2012-07-19 Thread Peter Alspach
Tena koe Anna Yes: see https://stat.ethz.ch/pipermail/r-help/2006-August/111234.html which includes an excellent description on this written by Bill Venables back in 1997. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r

Re: [R] Subsetting problem data

2012-07-18 Thread Peter Alspach
uot;A" "B" "B" ... $ X1: num 2 3 1 2 1 3 $ X4: num 3 4 6 NA 6 2 $ X5: num 3 NA 6 6 5 2 > lib1 <- aggregate(lib[,-1], list(lib[,1]), function(x) length(x[is.na(x)])>0) > lib1[apply(lib1[,-1], 1, sum)>0,1] [1] "A" "B" HTH ... Peter

Re: [R] Accessing coefficient values in linear regression

2012-07-12 Thread Peter Alspach
ficients["(Intercept)"]) and you'll see it is 191.9161 with a name attribute. Thus you can use it 'for other purposes'. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of PRAGYA SUR Se

Re: [R] Trying to speed up an if/else statement in simulations

2012-06-18 Thread Peter Alspach
sum(natalie[,'flag1']), 1, 0.95) natalie[natalie[,'flag1']==0, 'flag2'] <- rbinom(nrow(natalie)-sum(natalie[,'flag1']), 1, 0.5) tapply(natalie[,'flag2'], natalie[,'flag1'], table) HTH Peter Alspach -Original Message- From:

Re: [R] Unbalanced Design Power Analysis

2012-06-12 Thread Peter Alspach
Tena koe Jacob Possibly your best option is to simulate. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jacob Warren (RIT Student) Sent: Wednesday, 13 June 2012 4:40 a.m. To: r-help@r-project.org Subject

Re: [R] Reading Excel Formulas as values

2012-05-15 Thread Peter Alspach
Tena koe Mike Another alternative to those already given is to use the RODBC package. HTH Peter Alspach. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mike Smith Sent: Wednesday, 16 May 2012 8:11 a.m. To: r-help@r

Re: [R] Interpreting Q-Q Plots

2012-05-14 Thread Peter Alspach
Tena koe Rich Probably highly skewed to the right, with discrete values (perhaps due to the limitations in the accuracy of the assessment equipment). But note: library(fortunes) fortune('chicken') HTH ..... Peter Alspach -Original Message- From: r-help-boun...@r-p

Re: [R] Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.

2012-05-09 Thread Peter Alspach
cted input in "OlPrcFl <- loadWorkbook("". I'm guessing it is the " which is causing problems, although I haven't used the XLConnect package. HTH . Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.

Re: [R] Selecting obs within groups defined by 2 variables

2012-04-04 Thread Peter Alspach
nction(x) x[length(x)]) C2 C1 x y 1 2 2 2 3 2 > aggregate(naomi[,3], naomi[,1:2], function(x) x[length(x)]) C1 C2 x 1 1 x 2 2 2 x 3 3 1 y 2 4 2 y 2 HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On B

Re: [R] Histogram from a table in R

2012-04-03 Thread Peter Alspach
Tena koe Possibly barplot() is what you are after. ?barplot HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of gina_alessa Sent: Wednesday, 4 April 2012 9:08 a.m. To: r-help@r-project.org Subject: [R

Re: [R] Getting codebook data into R

2012-02-09 Thread Peter Alspach
Tena koe ?read.fwf HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of barny Sent: Friday, 10 February 2012 9:52 a.m. To: r-help@r-project.org Subject: [R] Getting codebook data into R I've been trying t

Re: [R] Gray levels

2012-01-25 Thread Peter Alspach
Tena koe See the colorspace package. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jeffrey Joh Sent: Thursday, 26 January 2012 10:36 a.m. To: r-help@r-project.org Subject: [R] Gray levels The gray

Re: [R] help

2012-01-10 Thread Peter Alspach
Tena koe Anna [ is for subsetting, you need c(): x <- c(10.4, 5.6, 3.1, 6.4, 21.7) y <- c(12, 5.6, 7.2, 1.0, 9.3) plot(x, y) HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Anna Olofsson Sent: Wed

Re: [R] delete all columns with all values equal to zero

2011-12-22 Thread Peter Alspach
Tena koe Frederico Something like yourDF[, apply(yourDF, 2, sum)!=0] HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Frederico Mestre Sent: Friday, 23 December 2011 10:55 a.m. To: r-help@r-project.org

Re: [R] Plot coordinates with gradien colour according to a different column

2011-12-01 Thread Peter Alspach
Tena koe Lara If I understand your question correctly, I use the colorspace package for that sort of thing, but you could also use the built-in colour palettes such as rainbow and topo.colors HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [ma

Re: [R] match first consecutive list of capitalized words in string

2011-11-09 Thread Peter Alspach
udex et gograven Rheinensis") Names1 <- sub('^[0-9a-z]* ', '', Names) Names1 ttReg <- regexpr(' [^A-Z]', Names1) ifelse (ttReg>0, substring(Names1, 1, regexpr(' [^A-Z]', Names1)-1), Names1) Incidentally, it is not good practice to

Re: [R] Plot two matrices and keeping the record of row names

2011-10-31 Thread Peter Alspach
Tena koe Vikas If I understand you correctly, you could generate a character matrix the elements of which are the row.names and col.names of x1 pasted together (perhaps with : as a separator). Then the upper.tri of this will give you the associations. HTH ... Peter Alspach > -Origi

Re: [R] contact person for UseR 2012, please?

2011-10-18 Thread Peter Alspach
Tena koe Erin http://biostat.mc.vanderbilt.edu/wiki/Main/UseR-2012 has the contact person on the front page ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Erin Hodgess > Sent: Wednesday, 19

Re: [R] correlation matrix

2011-10-10 Thread Peter Alspach
Tena koe Sharad If I understand you correctly, you want the lower triangle of your combined matrix to be the lower triangle of one of the correlation matrices, and the upper triangle to be the upper triangle from the other. If so, check lower.tri() and upper.tri(). HTH Peter Alspach

Re: [R] Create combinations of rows

2011-10-04 Thread Peter Alspach
Tena koe Don ?expand.grid HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of darkgaze > Sent: Wednesday, 5 October 2011 11:21 a.m. > To: r-help@r-project.org > Subject: [R] Create co

Re: [R] stumped on how to reorder factors

2011-08-30 Thread Peter Alspach
t;- factor(B, levels=unique(apply(ttMat, 1, paste, collapse=' '))) summary(B) Engine 1 Engine 3 Engine 10 Ladder 3 Ladder 10 1 1 2 1 1 HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bo

Re: [R] change values in a character vector

2011-08-25 Thread Peter Alspach
Tena koe Henri-Paul Does the following do what you want? testVector <- LETTERS[1:3] temp <- matrix(c(rep(c(NA, 'foo'), each=length(testVector)), testVector, rep(c(NA, 'bar', 'blah'), each=length(testVector))), ncol=6) c(t(temp)) HTH Peter Alspach &g

Re: [R] Loops for repetitive task

2011-08-09 Thread Peter Alspach
Tena koe Try something along the following lines: chrData <- vector('list', 22) names(chrData) <- paste('chr', 1:22, sep='') for (i in 1:length(chrData)) { chrData[[i]] <- read.table(file=paste('chr', i, '.out.txt', sep='')

Re: [R] select element from each row of the matrix

2011-07-20 Thread Peter Alspach
Tena koe Assuming your matrix is called yourMatrix, then try apply(yourMatrix, 1, function(x) which(x<=5)) HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of gallon li > Sent: Thursday,

Re: [R] timeDate with month designated by three letters.

2011-07-19 Thread Peter Alspach
Tena koe Michael The help file for strptime suggests you should be using %b (three letter month) rather than %m (decimal number month). HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behal

Re: [R] Subsetting data systematically

2011-06-22 Thread Peter Alspach
(TRUE, rep(FALSE,19)),] will give every twentieth row, starting with the first. There's also seq(). HTH .... Peter Alspach. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of gibberish > Sent: Thursday, 23 Ju

Re: [R] R string functions

2011-06-15 Thread Peter Alspach
Tena koe Karena Try: table(strsplit("GGCCCAATCGCAATTCCAATT", '')) HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of karena > Sent: Thursday, 16 June 2011 8:37

Re: [R] use variable value to create new variable name

2011-06-13 Thread Peter Alspach
yVar1, myVar2 etc. HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of maciek kryza > Sent: Tuesday, 14 June 2011 2:14 a.m. > To: r-help@r-project.org > Subject: [R] use variable value to create ne

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Peter Alspach
Tena koe Eric ?sub and ?gsub HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Lee, Eric > Sent: Tuesday, 14 June 2011 3:49 a.m. > To: r-help@R-project.org > Subject: [R] remove comma

Re: [R] Calculating a mean based on a factor range

2011-06-09 Thread Peter Alspach
Tena koe Sam You could use cut() to convert the depths into your categories and then tapply(). HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Sam Albers > Sent: Friday, 10 June 2011 10:

Re: [R] Cleveland dot plots

2011-06-07 Thread Peter Alspach
Kia ora Colin I don't know if there is a package that does what you want, but they are easy enough to create using plot(). Error bars can be added with arrows(). HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- &g

Re: [R] sub-matrix block size

2011-04-26 Thread Peter Alspach
something could be achieved with judicious use of diag() and rle(). HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Santosh > Sent: Wednesday, 27 April 2011 12:14 p.m. > To: r-help >

Re: [R] font and size times New Roman

2011-04-12 Thread Peter Alspach
Tena koe Fabiane ?par In particular, various cex. parameters. These can be used with plot (e.g., plot(x, y, cex.axis=1.2)) HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Fabiane Sil

Re: [R] What does the command diag(solve(matrix)) do?

2011-04-12 Thread Peter Alspach
used in fitting the so-called animal model. See Lynch, M. and B. Walsh (1998) Genetics and Analysis of Quantitative Traits. Sunderland, MA, USA, Sinauer Associates, Inc. in particular chapters 26 and 27 (I think) for more details. HTH Peter Alspach > -Original Message- > F

Re: [R] Specifying the color of points and the plot symbol to be used on a graph

2011-04-10 Thread Peter Alspach
of legal names. HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of John Sorkin > Sent: Monday, 11 April 2011 2:29 p.m. > To: r-help@r-project.org > Subject: [R] Specifying the color of p

Re: [R] Simple but elusive - expand back from counts

2011-03-29 Thread Peter Alspach
Tena koe Try something like: tmp[rep(1:nrow(tmp), each=tmp[,4]),] # untested HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of jjap > Sent: Wednesday, 30 March 2011 7:16 a.m. > To: r-hel

Re: [R] overlaying

2011-03-27 Thread Peter Alspach
Tena koe There are many ways. I tend to use the arrows() function. See ?arrows HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Bulent Arikan > Sent: Monday, 28 March 2011 10:45 a.m. &g

Re: [R] tapply with specific quantile value

2011-03-24 Thread Peter Alspach
Tena koe Steven The ... argument of the apply series of functions allows one to pass arguments to the called function. So: tapply(x, l.c.1, quantile, probs=0.75) should work (although I haven't tested it). HTH ..... Peter Alspach > -Original Message- > From: r-hel

Re: [R] mean of runoff for several years

2011-03-23 Thread Peter Alspach
sted the above and since I can never remember exact syntax or output I would not be surprised if the above needed tweaking. HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of dominique > Sent:

Re: [R] distance between consecutive points

2011-02-15 Thread Peter Alspach
Tena koe D'Arcy You might find dist() more suited to your needs. HTH .... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Darcy Webber > Sent: Wednesday, 16 February 2011 1:10 p.m. > To:

Re: [R] Changing the direction of axis labels on a plot

2011-02-03 Thread Peter Alspach
Tena koe ?par and check the las argument. HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Longe > Sent: Friday, 4 February 2011 7:16 a.m. > To: r-help@r-project.org > Subject

Re: [R] automatic coercion to character

2011-02-01 Thread Peter Alspach
Tena koe Lorenz c() combines the elements to form a vector and all elements of a vector must be of the same type. If you elements of different types you need to use a list. Note, a data.frame is a special type of list. HTH Peter Alspach > -Original Message- > From: r-hel

Re: [R] "each" argument in rep (Bug?)

2011-02-01 Thread Peter Alspach
), but I don't see that it is a bug or undocumented (although the documentation is subtle). HTH .... Peter Alspach. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of T.D. Rudolph > Sent: Wednesday, 2 February 201

Re: [R] Colour area under density curve

2011-01-26 Thread Peter Alspach
Tena koe David ?polygon should help you. HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of David Hervas Marin > Sent: Thursday, 27 January 2011 12:02 p.m. > To: R-Help > Subject: [R]

Re: [R] Find the empty element in a factor array

2011-01-26 Thread Peter Alspach
Tena koe Wendy which(test=='') Should do it. HTH .... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Wendy > Sent: Thursday, 27 January 2011 10:59 a.m. > To: r-help@r-project.or

Re: [R] Grouped bars in barplot

2011-01-12 Thread Peter Alspach
Mat, beside=TRUE, space=c(0,2)) tTicks <- barplot(dataMat, beside=TRUE, space=c(0,2)) tTicks <- tapply(tTicks, rep(1:7, each=2), mean) axis(1, tTicks, letters[1:7]) Is that what you want? HTH .... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [

Re: [R] Difficulty loading packages in R version 2.12.0

2010-11-23 Thread Peter Alspach
Tena koe John I got a similar message with a different package, and solved it by loading the latest version of the package (which was built under 2.12.0). So you may need to get around your institutional firewall! HTH Peter Alspach > -Original Message- > From: r-help-bou

Re: [R] Extending a plot in a loop (With attachment)

2010-11-16 Thread Peter Alspach
Tena koe Nasrin Try points() instead of plot() in your second and subsequent calls to plot(). points() and lines() adds to the current plot by default. Of course you may have difficulties with setting the x and y limits by that's another matter. HTH .... Peter Alspach > -

Re: [R] Change a value in a matrix randomly

2010-11-09 Thread Peter Alspach
Tena koe Judit If it is really a matrix (and not a data.frame) and you wish to change a randomly selected zero to a one, then judit <- matrix(0, nrow=3, ncol=4) judit[sample(1:length(judit), 1)] <- 1 will do. This uses the fact that a matrix is a vector with a dim attribute. HTH

Re: [R] Help with getting ?match to not sort

2010-11-08 Thread Peter Alspach
myMerge$myOrder), colnames(myMerge) != "myOrder"] } but I'm not sure this will work in all circumstances in which people might use merge(). HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behal

Re: [R] Getting tripped up on NAs in trying to create new variable

2010-10-17 Thread Peter Alspach
Tena koe Greg df$c <- 0 df[apply(df[,-3], 1, function(x) any(x %in% 3)), 3] <- 1 df[apply(df[,-3], 1, function(x) all(is.na(x))), 3] <- NA df a b c 1 NA NA NA 2 2 NA 0 3 2 3 1 4 3 NA 1 5 2 1 0 6 NA 3 1 HTH .... Peter Alspach > -Original Message- > Fr

Re: [R] Beginner question on bar plot

2010-10-15 Thread Peter Alspach
Tena koe Steven cutData <- rbind(summary(Acut), summary(Bcut)) barplot(cutData, beside=TRUE) should get you started. The challenge, as you identify, is to get the data into the appropriate form and the simple approach I have used may not work for your real data. HTH Peter Alsp

Re: [R] Line Type Specification: lty="" but lty=""?

2010-10-10 Thread Peter Alspach
col='red', lwd=2) abline(0, 1, col='blue', lty='88', lwd=2)) This may be system or graphics device dependent (I'm using Windows). HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > projec

Re: [R] Alphabetical sequence of data along the x-axis in a box plot

2010-09-27 Thread Peter Alspach
Tena koe Eddie One way: eddie <- data.frame(grp=rep(c('small','medium','large','very large'), each=20), wgt=rnorm(80, 100, 10)) with(eddie, plot(grp, wgt)) eddie$grp <- factor(eddie$grp, levels=c('small','medium','la

Re: [R] Determine area between two density plots

2010-09-22 Thread Peter Alspach
the same will make this process easier. Let me know if you'd like more details. HTH .... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Ralf B > Sent: Thursday, 23 September 2010 8:55 a.m. >

Re: [R] "sequeeze" a data frame

2010-09-09 Thread Peter Alspach
Tena koe John ?aggregate maybe? HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of array chip > Sent: Friday, 10 September 2010 11:13 a.m. > To: David Winsemius > Cc: r-help@r-project

  1   2   3   >