[R] why standardize the variables to perform LDA?

2019-02-08 Thread Tony Gozdz
I understand the need to standardize the variables to perform PCA, but is this a recommendation or necessity before running LDA? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://st

[R] confidence intervals for differences in proportions from complex survey design?

2015-05-10 Thread Brown, Tony Nicholas
d on asymptotic normality - either for a single proportion or split up into subgroups. Question: Is this a correct or a defensible procedure? Or should I use a different approach? Note that this approach should also allow to estimate CI's for proport

[R] Optometrists and Ophthalmologists dataset

2014-09-23 Thread Tony Parker
Hi, Hope you are doing well. My name is Tony I came across your company website and I could see Optometrists and Ophthalmologists is your one of the targeted specialist, so I thought of asking if you would be interested in acquiring a complete data-set of Optometrists and Ophthalmologists

[R] ltm package: how to calculate ability

2014-06-08 Thread Tony Garcia
to calculate the ability value of this two patters with those values. Thanks in advanced! Tony [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] (no subject)

2013-09-19 Thread tony toca
Many thanks, guys. Tony On Thu, Sep 19, 2013 at 11:28 PM, Richard Kwock wrote: > Hi Tony, > > The dimnames parameter is only in the matrix() function, not in the > as.matrix() function. > > #So you can do: > A <- matrix(rbind(Fert,M), nrow = nrow(rbind(Fert,M))) > A

[R] (no subject)

2013-09-19 Thread tony toca
fyi. *Fert<-c(0,1,5) * *M <- matrix(0, 2, 3) diag(M) <- c(0.3,0.5) * *A<- as.matrix(rbind(Fert,M),dimnames=NULL) A* Any insights as to how to remove the row names from the new vector would be greatly appreciated. Many thanks, Tony [[alternative HTML ver

[R] remove from list

2013-08-17 Thread Tony Paredes
[[alternative HTML version deleted]] __ R-help@r-project.org mailing 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,

Re: [R] Array analogue of row and col

2013-04-06 Thread Tony Plate
slice.index() in base On 4/2/2013 9:53 AM, Enrico Bibbona wrote: Great! Thanks a lot, Enrico 2013/4/2 Duncan Murdoch On 02/04/2013 6:36 AM, Enrico Bibbona wrote: Is there any function that extends to multidimentional arrays the functionalities of "row" and "col" which are just defined for

Re: [R] Array analogue of row and col

2013-04-06 Thread Tony Plate
slice.index() in base On 4/2/2013 6:36 AM, Enrico Bibbona wrote: Is there any function that extends to multidimentional arrays the functionalities of "row" and "col" which are just defined for matrices? Thanks, Enrico Bibbona [[alternative HTML version deleted]] ___

Re: [R] list of matrices --> array

2013-02-17 Thread Tony Plate
abind() (from package 'abind') can take a list of arrays as its first argument, so in general, no need for do.call() with abind(). As another poster pointed out, simplify2array() can also be used; while abind() gives more options regarding which dimension is created and how dimension names are

[R] Tools for Building Packages (Fedora)

2012-12-11 Thread Tony Paredes
Hello everyone, I'm trying to install the tools to build packages under Fedora (17), and have little luck finding anything useful using Google. I wanted to ask if there is any documentation associated with this issue; a link will be very useful. Thank you very much. [[alternative HTML ve

[R] Installing R under Redhat el6

2012-11-28 Thread Tony Paredes
Hi, I'm having a very difficult time installing R under redhat el6 (64 bit), and I wanted to ask if there are any lesson learned that someone will like to share with me about the process of installing R under redhat. thank you very much and have a wonderful afternoon/evening/morning.

[R] i would like to unsubscribe. How do i do this?

2012-10-03 Thread tony toca
[[alternative HTML version deleted]] __ R-help@r-project.org mailing 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,

[R] Running R in BATCH MODE Windows

2012-05-18 Thread Tony Paredes
Hello everyine, I am trying to run R in Batch mode in windows, but can't find any help in google. In particular, the only information I get is that I need to have an R.exe file, than I can't find in the bin folder. Can you please provide me with a link or refence on how to run R in batch mode in w

Re: [R] Census ARIMA x-12 seasonal adjustment in R?

2011-12-29 Thread Tony . CTR . Choi
Thanks David and everyone for the help. I do see "x12" under the RsiteSearch and will test it to see if it works for what I need to do. Happy new year! Tony From: David Winsemius To: Duncan Murdoch Cc: Tony CTR Choi/AWA/CNTR/FAA@FAA, R-help@r-project.org Date: 12/28/201

[R] Census ARIMA x-12 seasonal adjustment in R?

2011-12-28 Thread Tony . CTR . Choi
Hello, I am new to usin R - which is a great tool - and would like to know if R has a seasonal adjustment program for time series and/if it incorporates the Census Bureau's ARIMA x-12 seasonal adjustment program in any way? Thanks so much! Tony [[alternative HTML version de

Re: [R] Am I misunderstanding loop variable assignment or how to use print()?

2011-12-15 Thread Tony Stocker
On Thu, Dec 15, 2011 at 10:54, Sarah Goslee wrote: > > print(get(x)[["Pr"]]) maybe. Do the get(), then do the subsetting. > > >>> >>> It's often neater and more efficient to store your anova objects in a >>> list, though. >> >> anything since it's still a set of character strings.  Could you >> el

Re: [R] Am I misunderstanding loop variable assignment or how to use print()?

2011-12-15 Thread Tony Stocker
On Thu, Dec 15, 2011 at 09:51, Sarah Goslee wrote: > But "anova.ag.m2529.az"  is a character string that happens to be the > *name* of an anova object, but R has no way to know that unless you > specifically tell it that your character string is an object by using > get(). > > Something like print

[R] Am I misunderstanding loop variable assignment or how to use print()?

2011-12-15 Thread Tony Stocker
Given this interactive session: > an<-ls(pat="anova.ag.m2529") > an [1] "anova.ag.m2529.az" "anova.ag.m2529.can" "anova.ag.m2529.fl" > print(anova.ag.m2529.az) Analysis of Variance Table Response: year Df Sum Sq Mean Sq F value Pr(>F) time 1 14.823 14.8235

[R] Saving non table object as text file with outputting preserved?

2011-12-14 Thread Tony Stocker
All, Given the following commands: > ag.m35<-read.table("m35.txt",header=TRUE,sep=",") > ag.m35.lp<-subset(ag.m35, race=="lp") > aov.m35.lp=aov(year~time,data=ag.m35.lp) > anova.m35.lp=anova(aov.m35.lp) > anova.m35.lp Analysis of Variance Table Response: year Df Sum Sq Mean Sq F value

Re: [R] Creating appropriate time axis for data

2011-12-12 Thread Tony Stocker
2011/12/12 Uwe Ligges : > On 12.12.2011 17:44, Tony Stocker wrote: Sorry for the double post but the first message was held for so long that I figured there was a problem with the email address I was using so I unsubscribed that one and resubscribed the other one. >> >> Hello, >

[R] Help with charting time in seconds as HH:MM:SS on charts

2011-12-12 Thread Tony Stocker
relatively straight-forward and easy to use way to do this? Thanks, Tony __ R-help@r-project.org mailing 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 comm

[R] Creating appropriate time axis for data

2011-12-12 Thread Tony Stocker
relatively straight-forward and easy to use way to do this? Thanks, Tony __ R-help@r-project.org mailing 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 comm

[R] I really need help to merge two data frames

2011-11-01 Thread Tony
526.R.csv",header=TRUE,sep=",") bcusip <- bcusip[!duplicated(bcusip$bond_id),] bcusip$Freq = as.numeric(bcusip$Freq) And here is my attempt to merge: (I tried a few) merge (bdescr,bcusip,by="bond_id",all=TRUE) merge (bdescr,bcusip,by="bond_id") merge (bdesc

Re: [R] Problem in installing and starting Rattle

2011-03-19 Thread Tony Plate
x[file.exists(x)]) [1] "C:\\R\\GTK2-Runtime\\bin/zlib1.dll" > There are many ways to modify the PATH. To set PATH inside R: > Sys.setenv(PATH=paste(grep("UNWANTEDPATH", strsplit(Sys.getenv("PATH"), > ";")[[1]], value=T, invert=T), collapse=&q

[R] How to source() a .R file which was saved using UTF-8 encoding on Windows?

2011-02-21 Thread Tony Breyal
as to retain the special Chinese characters), then when I source() it in R, I get the following error: > source(file="C:\\Users\\Tony\\Desktop\\character_test.R", encoding = "UTF-8") Error in source(file = "C:\\Users\\Tony\\Desktop\\character_test.R", encoding = "utf

[R] Problem with augPred?

2010-09-27 Thread Meissner, Tony (DFW)
others encountered this problem with augPred? I am using R-2.11.1 under Windows XP Tschüß Tony Meissner Principal Scientist - Monitoring Department for Water | Level 3 28 Vaughan Terrace Berri SA 5343 T 8595 2209 | M 0401 124 971 E tony.meiss...@sa.gov.au<mailto:tony.meiss...@sa.gov.au> Mon

[R] Problem with augPred?

2010-09-27 Thread Meissner, Tony (DFW)
I am using R-2.11.1 under Windows XP Tschüß Tony Meissner Principal Scientist - Monitoring Department for Water | Level 3 28 Vaughan Terrace Berri SA 5343 T 8595 2209 | M 0401 124 971 E tony.meiss...@sa.gov.au<mailto:tony.meiss...@sa.gov.au> Mon | Tue | Wed | Thurs | Fri www.waterforgood.sa

[R] standard error of difference for mixed effects

2010-09-15 Thread Meissner, Tony (DFW)
have formulated log(Salinity) ~ log(flow), random=~log(flow)|sites/phase where sites is a factor with levels upstream & downstream, and phase is a factor with two levels before and after. Any help would be appreciated. Tschüß Tony Meissner Principal Scientist - Monitoring Department for W

[R] termplot for mixed linear effects models

2010-08-12 Thread Meissner, Tony (DFW)
Is there an equivalent package for mixed linear effects models developed using the package "nlme" as there is for linear models? Tschüß Tony Meissner Principal Scientist (Monitoring/Statistics) Resource Monitoring Science, Monitoring and Information Division Department for Water "

[R] How to point a column of dataframe by a "character"

2010-07-28 Thread Tony
ng Xs[1] will give me only "character" - "a". Thus, is there any function that allow me to pull values of dadta[,"a"] , eg, some_function(Xs[1]) give me values of data[,"a"] Any help is appreciated. Tony [[alternative HTML version deleted]] _

Re: [R] taking daily means from hourly data

2010-07-14 Thread Meissner, Tony (DFW)
Thanks Alan and Gabor. Alan’s code appears to be the simplest to run and Gabor provided some further insight. Tschüß Tony Meissner Principal Scientist (Monitoring) Resources Monitoring Group Science, Monitoring and Information Division Department for Water "Imagine" © •(ph)

[R] taking daily means from hourly data

2010-07-14 Thread Meissner, Tony (DFW)
- NULL Is there a more efficient way of doing this? I am running R-2.11.0 under Windows XP Tschüß Tony Meissner Principal Scientist (Monitoring) Resources Monitoring Group Science, Monitoring and Information Division Department for Water "Imagine" © *(ph) (08) 8595 2209 *(mob) 0401 12

Re: [R] POSIXlt error -Oops

2010-07-14 Thread Meissner, Tony (DFW)
t; I hope that makes it clearer what the data looks like. I am r=running R-2.11.0 under Windows XP Tschüß Tony Meissner Principal Scientist (Monitoring) Resources Monitoring Group Science, Monitoring and Information Division Department for Water "Imagine" © (ph) (08) 8595 2209 (mob

Re: [R] POSIXlt error

2010-07-13 Thread Meissner, Tony (DFW)
t; I hope that makes it clearer what the data looks like Tschüß Tony Meissner Principal Scientist (Monitoring) Resources Monitoring Group Science, Monitoring and Information Division Department for Water "Imagine" © (ph) (08) 8595 2209 (mob) 0401 124 971 (fax) (08) 8595 2232 28 Vaugh

[R] Converting POSIXct vales to real values

2010-07-13 Thread Meissner, Tony (DFW)
vec/(60*60*24) I only get integer values and not fraction of a day which is what I want. What do I need to do to get decimal days? Tschüß Tony Meissner Principal Scientist (Monitoring) Resources Monitoring Group Science, Monitoring and Information Division Department for Water "Imagine"

Re: [R] how to process this in R

2010-07-08 Thread Tony B
rame(name=rep(c("aaa", "bbb"), 2), count = c(100, 2000, 300, 400)) name count 1 aaa 100 2 bbb 2000 3 aaa 300 4 bbb 400 subset(DF, name == "aaa") name count 1 aaa 100 3 aaa 300 HTH Tony Breyal __ R

Re: [R] is there a Decode HTML function somewhere (similar to URLdecode)?

2010-06-24 Thread Tony Breyal
Thank you kindly Henrique, that works perfectly for me. On 24 June 2010 15:25, Henrique Dallazuanna wrote: > Try this: > > library(XML) > xmlValue(getNodeSet(htmlParse(x, asText = TRUE), "//p")[[1]]) > > On Thu, Jun 24, 2010 at 6:53 AM, Tony Breyal > wrote: >

Re: [R] is there a Decode HTML function somewhere (similar to URLdecode)?

2010-06-24 Thread Tony Breyal
uot;, "&", "a", "p", "o", "s", ";", "t", sep = "") would become the following, when output to the plain text file: > "isn't" Thank you again for your time, Tony Breyal On 23 June 2010 12:32,

[R] is there a Decode HTML function somewhere (similar to URLdecode)?

2010-06-23 Thread Tony B
Dear all, I am aware of the URLdecode(..) function and was wondering if there was something similar for HTML? For example, I would like to convert strings like this: > x <- "isn't" into this: > "isn't" Many thanks for your time, Tony Breyal # O/S:

Re: [R] mvbutils and trackObjs

2010-06-02 Thread Tony Plate
into mvbutils, but it would probably be a significant amount of work. -- Tony Plate On 05/31/2010 09:56 PM, Day, Roger S wrote: Hello Colleagues, I've recently become a fan of Mark Bravington's mvbutils package for organizing analysis projects in a tree. Using cd(), Save(), fix

[R] substitution in a function

2010-05-26 Thread Meissner, Tony (DWLBC)
e function match.trace is match.trace(ror31.01, Kms, Mon, Tues) However I am getting an error because day1-day1[1] is non-numeric. How can I make this work to plot out the difference in day1 initial value and the remainder lagged against the difference in values for the next day? Any help

[R] se from lme

2010-05-19 Thread Meissner, Tony (DWLBC)
Is there a R package that calculates the standard errors of prediction/fit from lme/nlme models? Tschüß Tony Meissner Principal Scientist (Monitoring) Resources Monitoring Group Science, Monitoring and Information Division Department of Water, Land & Biodiversity Conservation "Imagin

Re: [R] Variable variables using R ... e.g., looping over data frames with a numeric separator

2010-05-18 Thread Tony Plate
bove, try something like this: for (i in 1:(L-1)) { dataName <- paste("fData.", i, sep="") df <- get(dataName) ... do something with data frame df ... } You can also give additional arguments to get() to tell it where to look (pos=,envir=), and wh

Re: [R] reading formatted txt file into a data frame

2010-05-07 Thread Tony B
Thank you all for your help, this has solved my problem. My main problem with using gsubfn was that i was getting confused by the square brackets in [^]]+[^] but I now have a much better understanding of what this means. Cheers! Tony Breyal On 6 May, 19:38, Gabor Grothendieck wrote: > T

[R] reading formatted txt file into a data frame

2010-05-06 Thread Tony B
use readLines on the text file and maybe do some regular expressions and also use strsplit(..); but having confused myself after several attempts I was wondering if there is a way, perhaps using maybe read.table instead? My end goal is to hopefully convert DF into an XML structure. Thank

Re: [R] regular expression help to extract specific strings from text

2010-04-01 Thread Tony B
Thank you guys, both solutions work great! Seems I have two new packages to investigate :) Regards, Tony Breyal On 31 Mar, 14:20, Tony B wrote: > Dear all, > > Lets say I have the following: > > > x <- c("Eve: Going to try something new today...", "Adam:

[R] regular expression help to extract specific strings from text

2010-03-31 Thread Tony B
t :)" [5] "blahblah" and > gsub("#([A-Za-z0-9_]+)", "#[...]", x) [1] "Eve: Going to try something new today..." [2] "Adam: Hey @Eve, how are you finding R? #[...]" [3] "Eve: @Adam, It's awesome, so much better at statistics that #[...] ever was! @Cain & @Able disagree though :(" [4] "Adam: @Eve I'm sure they'll sort it out :)" [5] "blahblah" I hope that makes sense, and thank you kindly in advance for your time. Tony Breyal __ R-help@r-project.org mailing 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.

[R] [R-pkgs] New package: equate

2010-03-26 Thread Tony Albano
ed! Thanks Tony ____ Tony Albano University of Minnesota 193 Education Sciences Building 56 East River Road Minneapolis, MN 55455 ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.

[R] Using nrow with summaryBy

2010-03-17 Thread Tony Laidig
s summaryBy(Weight+Feed~Evit+Cu,data=dietox12,FUN=c(mean,var,length,nrow)) There must be a way to do this, but I can't figure it out. I suspect there is another function that would be compatible with summaryBy. Thanks in advance. -Tony [[alte

Re: [R] Three most useful R package

2010-03-03 Thread Tony B
I only really need the base packages, but otherwise I suppose the most useful for me are: (1) RCurl (2) plyr (3) XML On 2 Mar, 20:13, Ralf B wrote: > Hi R-fans, > > I would like put out a question to all R users on this list and hope > it will create some feedback and discussion. > > 1) What are

Re: [R] two questions for R beginners

2010-03-01 Thread Tony B
mples and points of view about it. Of course that is probably overkill. I just wanted to see if i could mention WoW in my post. > I especially want to hear from people who are > lazy I did a degree in Maths. > and impatient. I sometimes produce graphics in Excel. Cheers, Tony *

Re: [R] Reshaping data with xtabs giving me 'extra' data

2010-01-20 Thread Tony B
ke your sugestion to get the desire result: > x <- with(do.call(rbind, df.list), tapply(Score, list(Date, Show, Time), > function(x) { x } )) > x[,,"13:30:00"] Being Human Doctor Who Red Dwarf 2010-01-19 NA NANA 2010-01-20

[R] Reshaping data with xtabs giving me 'extra' data

2010-01-20 Thread Tony B
data for "2010-01-19" which was not in any of my original data frames above: > # I do not want the zeros below > my.xtab[,,"13:30:00"] Show Date Being Human Doctor Who Red Dwarf 2010-01-19 0 0 0 2010-01-20 2

Re: [R] Align two protein sequences using BLAST

2010-01-05 Thread Tony Chiang
You should send this note to the biconductor mailing list rather than the R-help. As to your question, please look at the Biostrings bioconductor package. On Tue, Jan 5, 2010 at 6:09 AM, Alla Bulashevska < alla.bullashev...@fdm.uni-freiburg.de> wrote: > > Dear R users, > I would like to align two

Re: [R] How to change the default Date format for write.csvfunction?

2009-12-28 Thread Tony Plate
ply(d, function(x) if (is(x, "Date")) format(x, "%m/%d/%Y") else x)) write.table(d1, quote=which(sapply(d, function(x) !is.numeric(x) & !is(x, "Date" "ticker" "date" "price" "1" "IBM" 12/03/2009 120 "2&qu

Re: [R] 2D array of strings

2009-12-28 Thread Tony Plate
matrix(str, ncol=1) Francesco Napolitano wrote: Sorry for the dumb question, but I couldn't figure this out myself. Consider the following: str <- c("abc","def") array(str, c(2,1)) [,1] [1,] "abc" [2,] "def" How can i obtain the outcome of the second instruction without specifying the

Re: [R] Reading PDF files

2009-12-22 Thread Tony B
mmand: (1) Download xpdf (whichever is the latest version): ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl4-win32.zip (2) Unzip it # system(paste("[app]", "[pdf file]"), wait = FALSE) > system(paste('"C:/Program Files/xpdf/pdftotext.exe"', '"C:/D

Re: [R] Reading PDF files (using xpdf)

2009-12-22 Thread Tony Breyal
tem(paste('"C:/Program Files/xpdf/pdftotext.exe"', '"C:/Documents and > Settings/tony/Desktop/test/r-intro.pdf"'), wait=FALSE) Method Two - if you want to use the tm package like I did last year, ?readPDF requires the following (not documented anywhere that I kn

Re: [R] [Rd] Error in namespaceExport(ns, exports) :

2009-12-03 Thread Tony Plate
Try looking in the NAMESPACE file (in the same directory as the DESCRIPTION file). -- Tony Plate David Scherrer wrote: Dear all, I get the error "Error in namespaceExport(ns, exports) : undefined exports function1 , function2" when compiling or even when I roxygen my packag

Re: [R] Replying to Posts Within Same Thread

2009-12-02 Thread Tony B
To be honest, I've never figured this out either. However, if you're familiar with the gmail way of threading emails, just bookmark and use google groups: http://groups.google.co.uk/group/r-help-archive It's the easiest way I've personally found, and has a very intuitive i

Re: [R] XML package example code?

2009-11-25 Thread Tony B
rking with malformed code, and therefore I usually just force those notifications into an empty function. library(RCurl) library(XML) html <- getURL("http://www.omegahat.org/RSXML/index.html";) html.tree <- htmlTreeParse(html, useInternalNodes = TRUE, error = function(...){}) HTH,

Re: [R] XML package example code?

2009-11-25 Thread Tony B
Not sure if my code was attached in that last post: library(RCurl) library(XML) html <- getURL("http://www.omegahat.org/RSXML/index.html";) html.tree <- htmlTreeParse(html, useInternalNodes = TRUE, error = function(...){}) On 25 Nov, 16:21, Peng Yu wrote: > On Wed, Nov 25, 2009 at 12:19 AM, cls

Re: [R] XML package example code?

2009-11-25 Thread Tony B
rror = function(...){}) # the xpath expression is next nodes <- getNodeSet(html.tree, "//a...@href][@class='l']") links <- sapply(nodes, function(x) x <- xmlAttrs(x)[[1]]) HTH Tony On 25 Nov, 01:49, Peng Yu wrote: > I'm interested in parsing an html page. I should use

Re: [R] parsing Google search results

2009-11-17 Thread Tony B
tp://www.cranmusic.com/"; "http://www.sizes.com/units/cran.htm"; [5] "http://www.r-project.org/"; "http://www.myspace.com/ cranmusic""http://www.rozcran.co.uk/"; "http:// www.cherylcran.com/" [9] "http://www.ch

Re: [R] Help with complicated regular expression

2009-11-13 Thread Tony Plate
;more words in front(2)") grep("[[:alpha:]]+[ \t]*\\([ \t]*[0-9]+[ \t]*\\)", x) [1] 1 2 3 4 6 grep("^[[:alpha:]]+[ \t]*\\([ \t]*[0-9]+[ \t]*\\)", x) [1] 1 2 3 4 -- Tony Plate Dennis Fisher wrote: Colleagues, I am using R (2.9.2, all platforms) to search for a

Re: [R] Loadings and scores from fastICA?

2009-11-12 Thread Tony Plate
Hyvärinen and Erkki Oja * (http://www.cis.hut.fi/aapo/papers/IJCNN99_tutorialweb/) -- it's an excellent introduction. -- Tony Plate Joel Fürstenberg-Hägg wrote: Ok, so then the S gives the individual components, good. Thanks Tony! But what about the principal components from the PCA

Re: [R] Loadings and scores from fastICA?

2009-11-11 Thread Tony Plate
uot;S" (the estimated source matrix) and "A" (the estimated mixing matrix). Are these what you want? -- Tony Plate Joel Fürstenberg-Hägg wrote: Hi all, Does anyone know how to get the independent components and loadings from an Independent Component Analysis (ICA), as well as

Re: [R] partial cumsum

2009-11-11 Thread Tony Plate
long computationally intensive job. And if that's the case, it would make sense to code it in C. -- Tony Plate Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com any ideas? thank you and best regards, stefan __ R-help@r-pro

Re: [R] Comparison of vectors in a matrix

2009-11-11 Thread Tony Plate
uot;, \"b\"" "\"b\"" row2 "\"c\"""\"d\"" # use R's parsing and evaluation to turn '"a", "b"' into c("a", "b"), and turn that # into a matrix containing characte

Re: [R] Comparison of vectors in a matrix

2009-11-10 Thread Tony Plate
;=apply(x, 1, function(ab) setdiff(ab[[1]], ab[[2]] A B A-B 1 Character,2 Character,5 "b" 2 Character,2 Character,5 "g" 3 Character,3 Character,3 Character,3 4 Character,5 Character,3 Character,2 5 Character,2 "i"

Re: [R] prcomp - principal components in R

2009-11-09 Thread Tony Plate
e a shortcut for computing the values of D in the SVD of a matrix -- you could look for that if you have demanding computations (e.g., the sqrts of the eigen values of the covariance matrix of scaled x: sqrt(eigen(var(scale(x, center=T, scale=F)), only.values=T)$values)). -- Tony Plate

Re: [R] rm(list<-ls()) error

2009-11-05 Thread Tony Plate
; argument having the value of ls() Here's an example that doesn't confuse things by having non-standard evaluation rules: f <- function(a=1, b=2) cat("a=", a, "b=", b, "\n") b Error: object 'b' not found f(b <- 33) a= 33 b= 2 b [1]

Re: [R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread Tony Plate
x <- matrix(sample(0:1, 1200, replace=T, prob=c(0.952, 0.048)), ncol=30) table(x) x 01 1131 69 x <- matrix(sample(0:1, 1200, replace=T, prob=c(0.952, 0.048)), ncol=30) table(x) x 01 1151 49 bikemike42 wrote: Dear All, I am trying to create an artificial binary matrix

Re: [R] polar.plot

2009-11-01 Thread Tony Greig
Jim and John, Thanks for your replies. I ended up using both suggestions to plot the full tide series and then overlay the averages for rise and fall in different colours, which illustrated very well how such parameters can be misleadings in some cases. Regards, Tony 2009/10/31 Jim Lemon

[R] polar.plot

2009-10-30 Thread Tony Greig
at 90 in my example above? Thanks, Tony [[alternative HTML version deleted]] __ R-help@r-project.org mailing 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

Re: [R] column names of a correlation matrix

2009-10-28 Thread Tony Plate
col a 1 2 b 2 3 cbind(ii, cor=xc[ii]) row colcor a 1 2 -0.3767034 b 2 3 0.6040273 -- Tony Plate Lee William wrote: Hi! All, I am working on a correlation matrix of 4217x4217 named 'cor_expN'. I wish to obtain pairs with highest correlation values. So, I

Re: [R] How to average subgroups in a dataframe? (not sure how to apply aggregate(..))

2009-10-21 Thread Tony Breyal
Thank you all for your responses, i have now achieved the desired output for my own real data using your suggestions. I will also have to look into this 'plyr' package as i have noticed that it gets mentioned a lot. On 21 Oct, 13:33, Karl Ove Hufthammer wrote: > In article <800acfc0-2c3c-41f1-af

[R] How to average subgroups in a dataframe? (not sure how to apply aggregate(..))

2009-10-21 Thread Tony Breyal
09 12.831509 10.882712 My feeling is that I should be using the ?aggregate is some fashion but can't see how to do it. Or possibly there's another function i should be using? Thanks in advance, Tony O/S: Windows Vista Ultimate > sessionInfo() R version 2.9.2 (2009-08-24) i386-

Re: [R] LDA Precdict - Seems to be predicting on the Training Data

2009-10-20 Thread Tony Plate
sep="\t") fit <- lda(c1 ~ v1 + v2 + v3, data=myDat[1:10,]) predict(fit, myDat[11:16,]) $class [1] c c c b c a Levels: a b c ... -- Tony Plate BostonR wrote: When I import a simple dataset, run LDA, and then try to use the model to forecast out of sample data, I get a forecast

Re: [R] rbind to array members

2009-10-19 Thread Tony Plate
, you must add a row to all the slices. When I read "to add a row in place to a single table of the 3 dimensional array" it sounds like you might be trying to do something that's not possible with R arrays. However, if I could see your examples, then I probably give more help. --

Re: [R] populating an array

2009-10-16 Thread Tony Plate
R doesn't access arrays like C, use [i,j] to access a 2-d array, e.g.: my_array <- array(0,dim=c(2,2)) for(i in seq(1,2,by=1)){ + for(j in seq(1,2,by=1)){ + my_array[i,j] = i+j + } + } my_array [,1] [,2] [1,]23 [2,]34 tdm wrote: Hi, Can someone please give m

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread Tony Plate
test$x doesn't evaluate the function, you want something like test(1,2)$x, e.g.: test <- function(i, j){ x <- i:j y <- i*j z <- i/j return(list(x=x,y=y,z=z)) } test(1,2)$x [1] 1 2 test(1,2)$y [1] 2 test(1,2)$z [1] 0.5 Or if you want to avoid evaluating y

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Tony Plate
Try playing around with the "oma" setting in par() -- it sets the outer margins, which by default are zero. The following shows the mtext label for me, using the windows device: par(mfrow=c(2,2)) par("oma") [1] 0 0 0 0 par("oma"=c(0,0,2,0)) for (i in 1:4) plot(0:1,0:1) mtext(text = "my test

Re: [R] how to have 'match' ignore no-matches

2009-10-05 Thread Tony Plate
x <- data.frame(d=letters[1:3], e=letters[3:5]) lookuptable <- c(a="aa", c="cc", e="ee") match.or.keep <- function(x, lookuptable) {if (is.factor(x)) x <- as.character(x); m <- match(x, names(lookuptable)); ifelse(is.na(m), x, lookuptable[m])} # to return a matrix apply(x, 2, match.or.keep, looku

[R] How to get NA's into the output of xtabs?

2009-10-05 Thread Tony Breyal
00 The best i can do so far is: > xtabs(as.numeric(Size) ~ Show + Date, data = my.df) Date Show2007-08-03 2007-08-04 2007-08-05 Babylon 5 0.000 0.000 0.000 Dr Who 0.701 0.850 0.850 Star Tr

Re: [R] grep or other complex string matching approach to capture necessary information...

2009-09-25 Thread Tony Plate
6, but do be careful of the gotcha that sample(2:3, ...) will generate a selection of 2's and 3's, while sample(3,...) will generate samples from 1, 2, and 3.) -- Tony Plate Jason Rupert wrote: Say I have the following data: house_number<-floor(runif(100, 200, 600)) water_eval

Re: [R] Downloading currency data from from Yahoo

2009-09-24 Thread Tony Plate
0.52 0.52 0.51 0.51 0.51 0.51 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:6] "GBP=X.Open" "GBP=X.High" "GBP=X.Low" "GBP=X.Close" ... Indexed by objects of class: [Date] TZ: GMT xts Attributes: List of 2 $ src: chr "yahoo&q

Re: [R] retrieve certain part from html

2009-09-23 Thread Tony Breyal
maybe you could modify the following to suit your situation (i use this xPath expression to get links from google): ?htmlTreeParse ?getNodeSet > library(XML) > link <- > 'http://www.google.co.uk/search?hl=en&client=firefox-a&rls=org.mozilla:en-GB:official&hs=2XR&ei=mxa6SojjOeaMjAfJkcDuBQ&sa=X&oi

Re: [R] How can I get "predict.lm" results with manual calculations ? (a floating point problem)

2009-09-14 Thread Tony Plate
m + smallPosNum) + bigNegNum). They can also depend on whether intermediate results are kept in CPU registers, which sometimes have higher precision than 64 bits. Usually, they're nothing to worry about, which is one of the major reasons that all.equal() has a non-zero default for the

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
text from a hyperlink and copy and pasted it into R. It did not occur to me that the 'spaces' might be something else. However I am surprised that it worked in the first instance for both of the kind posters above. Perhaps i'm just unluky with the local settings on my Vista PC :S Ch

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
52 attached base packages: [1] stats graphics grDevices utils datasets methods base > On 8 Sep, 09:47, Tony Breyal wrote: > After further investigation it appears that the problem is specific to > my Vista PC. I am able to get the correct results using R 2.9.2 on a > Window XP

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
ystem type: 32-bit Operating System 2009/9/8 Gabor Grothendieck : > I am using the exact same version of R as you also on Vista > but can't reproduce your result.  For me it splits properly. > > Try starting R like this (modify path if needed) from the > Windows cmd line: >

[R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-07 Thread Tony Breyal
', fixed=TRUE) [[1]] [1] "sales to 23 August 2008 " "29 August" [[2]] [1] "sales to 6 September 2008 published 11 September" Thank you kindly for any help in advance. Tony O/S: Win Vista Ultimate > sessionInfo() R version 2.9.2 (2009-08-24) i386-pc-mingw32 locale

[R] Merge data frames but with a twist.

2009-08-27 Thread Tony Breyal
13 Red Dwarf24 my reason for doing this is so that i can plot a time series somehow. I hope the formating stays when i post this message and that what i'm trying to do is easy to understand. Thank you kindly for

Re: [R] un run run...

2009-08-14 Thread Tony Plate
You could try setting options(error=function() NULL). This should cause R in batch mode to continue running after an error (the same way it does in interactive mode.) -- Tony Plate Nir Shachaf wrote: Hi All, I am running an Rscript with a bunch of algorithms that are UNSTABLE under some

Re: [R] A question on operation on list

2009-07-22 Thread Tony Plate
ind(along=0, x2)) [1] 5 2 2 colSums(abind(along=0, x2)) [,1] [,2] [1,] 1.768406 -1.534413 [2,] -1.534413 3.890200 -- Tony Plate megh wrote: Hi, I have created a list object like that : x = vector("list") for (i in 1:5) x[[i]] = rnorm(2) x Now I want to do two th

[R] What has happened to the R-Help Google Groups Archive? Alternative?

2009-06-22 Thread Tony Breyal
rnative website which uses a similar structure to google groups? I had a quick browse on the R Wiki (http://wiki.r-project.org/rwiki/doku.php?id=links:links) but didn't see a page with this sort of info. Thank you kindly, Tony Breyal __ R-help@r-proj

Re: [R] 'Errors' with Ubuntu

2009-06-15 Thread Tony Breyal
numbers you mentioned so am not sure if this will help in your situation. My next challenge is working out how to install R on Ubuntu (will try this weekend)! HTH, Tony Breyal On 13 June, 01:18, Len Vir wrote: > Good Day To You All, > > I have installed Ubuntu 9.04 on a Laptop running Vista

Re: [R] graphically representing frequency of words in a speech?

2009-06-10 Thread Brown, Tony Nicholas
Yihui, This is quite impressive, thanks for helping me think about how to make tag clouds in R. Tony -Original Message- From: Yihui Xie [mailto:xieyi...@gmail.com] Sent: Wednesday, June 10, 2009 3:15 AM To: Brown, Tony Nicholas Cc: r-help@r-project.org Subject: Re: [R] graphically

  1   2   3   >