Re: [R] Problem with new(er) R version's matrix package

2014-04-25 Thread Arne Henningsen
On 25 April 2014 20:15, David Winsemius wrote: > > On Apr 25, 2014, at 9:17 AM, Werner W. wrote: > >> Dear Rs, >> >> I am re-executing some older code. It does work in the ancient R 2.12.0 >> which I still have on my PC but with the new version R 3.1.0 it does not >> work any more (but some othe

Re: [R] about rect.hclust

2014-04-25 Thread Gregory Jefferis
On 26 Apr 2014, at 02:35, chris Jhon wrote: > The question is how to plot the cluster number on the dendrogram plot? Besides Peter Langfelder’s suggestion, you may also want to take a look at CRAN packages dendroextras or dendextend For example using the dendroextras # set up your data ##

Re: [R] about rect.hclust

2014-04-25 Thread Peter Langfelder
On Fri, Apr 25, 2014 at 6:35 PM, chris Jhon wrote: > Hi, > > I am using hclust and cutree to cluster a data frame y and cut it into few > clusters as follows > > y > V1 V2 V3 V4 > A 1 2 3 4 > B 5 6 7 8 > C 9 10 11 12 > D 13 14 15 16 > E 17 18 19 20 >> clu<-hclust(dist(y),method="comple

Re: [R] Within ID variable delete all rows after reaching a specific value

2014-04-25 Thread Jim Lemon
On 04/26/2014 12:42 PM, Jennifer Sabatier wrote: So, I know that's a confusing Subject header. Here's similar data: tmp<- data.frame(matrix( c(rbinom(1000, 1, .03), array(1:127, c(1000,1)), array(format(seq(ISOdate(

[R] extrafont query | importing only 1 TTF

2014-04-25 Thread Evan Cooch
Greetings -- For a host of reasons, I need to use/embed Garamond font with various graphics for a particular publication. I've figured out how to more or less get there from here, using the following sequence: library(extrafont) Then, I need to import the system fonts (Windoze box). So, I us

[R] error from hist() with POSIXt 00 seconds for breaks of secs, mins, hours, or day

2014-04-25 Thread Stephen G Matthews
Hello, When using hist() with a POSIXt date that has 00 seconds an error is produced. For example > hist(as.POSIXlt("2010-07-01 00:00:00"), breaks="mins") Error in seq_len(1L + max(which(breaks < maxx))) : argument must be coercible to non-negative integer In addition: Warning message: In max(w

[R] partitioning around medoids

2014-04-25 Thread Tomassini, Letizia
Hello I am running some k-medoids analysis to see if that algorithm will work better on my dataset compared to the k-means I have been using so far. When running k-means I used to specify the nstart option, equal to a certain number, depending on how many random sets of clusters I wanted. Could

[R] access environment in which an error occoured

2014-04-25 Thread Jannis
Dear R users, is there any way to access/print/save the content of an environment in which an error occoured? Image the following testcase: test = function() { b = 3 plot(notavailable) } dump.frames.mod = function() { save(list=ls(parent.frame(1)), file='dummy.RData') } options(er

[R] about rect.hclust

2014-04-25 Thread chris Jhon
Hi, I am using hclust and cutree to cluster a data frame y and cut it into few clusters as follows y V1 V2 V3 V4 A 1 2 3 4 B 5 6 7 8 C 9 10 11 12 D 13 14 15 16 E 17 18 19 20 > clu<-hclust(dist(y),method="complete") clu<-hclust(dist(y),method="complete") > clu Call: hclust(d = dist(y)

Re: [R] Loops (run the same function per different columns)

2014-04-25 Thread CRoa
Hi Arun, Thanks a lot for your script. Ill work on it tomorrow. Cheers On 24/04/2014, at 11:54 AM, "arun kirshna [via R]" wrote: > HI, > I guess you got an output like this using my script: > ##Please use ?dput() to show the example data. > > FA <- structure(list(Sample = c("L1 Control",

[R] ideal: object 'normalize' not found.

2014-04-25 Thread soracem
Dear all, When I try to run IDEAL it gives me an error saying: Error in ideal(mydatarc.working, codes = mydatarc.working$codes, dropList = list(lop = 0), : object 'normalize' not found. Below is what I did require(pscl) mydata<-read.csv(file.choose()) summary(mydata) legNames<-mydata[,1] pty1<-

[R] Within ID variable delete all rows after reaching a specific value

2014-04-25 Thread Jennifer Sabatier
So, I know that's a confusing Subject header. Here's similar data: tmp <- data.frame(matrix( c(rbinom(1000, 1, .03), array(1:127, c(1000,1)), array(format(seq(ISOdate(1990,1,1), by='month', length=56), format='%d.%m.%Y')

Re: [R] Can't plot transparency images in R-3.1.0

2014-04-25 Thread Ulises M. Alvarez
On 04/25/2014 07:26 PM, Fong Chun Chan wrote: Hi all, I recently upgraded to R-3.1.0 from R-3.0.2. Things seem to be fine, but when trying to plot a ggplot image with transparency, I get the following issue: Warning message: In grid.Call.graphics(L_polygon, x$x, x$y, index) : semi-transparen

[R] Can't plot transparency images in R-3.1.0

2014-04-25 Thread Fong Chun Chan
Hi all, I recently upgraded to R-3.1.0 from R-3.0.2. Things seem to be fine, but when trying to plot a ggplot image with transparency, I get the following issue: Warning message: In grid.Call.graphics(L_polygon, x$x, x$y, index) : semi-transparency is not supported on this device: reported only

Re: [R] mgcv::gam.check qq plot residuals are not standardized?

2014-04-25 Thread Simon Wood
Hi Michael, You seem to have a quite recent mgcv if you are using qq.gam, so a help file for version 1.3 is probably not going to be much help (gam.fit2 no longer exists, for example). By default qq.gam plots deviance residuals (see ?qq.gam). So the default is standardization. When possible

[R] mgcv::gam.check qq plot residuals are not standardized?

2014-04-25 Thread Folkes, Michael
Hello all, I looking for confirmation of what I'm seeing. The qq plot in gam.check and qq.gam is not standardizing the residuals. The current help doesn't suggest they're standardized. Somehow I found, online, a help for gam.check from version [Package mgcv version 1.3-23 Index]: "If the fit

Re: [R] Metafor: How to integrate effectsizes?

2014-04-25 Thread Viechtbauer Wolfgang (STAT)
If you know the d-value and the corresponding group sizes for a study, then it's possible to add that study to the rest of the dataset. Also, if you only know the test statistic from an independent samples t-test (or only the p-value corresponding to that test), it's possible to back-compute wha

Re: [R] sensitivity and specificity

2014-04-25 Thread MacQueen, Don
Try this: > sens <- function(ct) { ct[2,2] / sum(ct[,2]) } > spec <- function(ct) { ct[1,1] / sum(ct[,1]) } > > > myt <- matrix( c(1427,271,110,166), ncol=2) > > sens(myt) [1] 0.6014493 > > spec(myt) [1] 0.8404005 > -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave

Re: [R] Problem with new(er) R version's matrix package

2014-04-25 Thread David Winsemius
On Apr 25, 2014, at 9:17 AM, Werner W. wrote: > Dear Rs, > > I am re-executing some older code. It does work in the ancient R 2.12.0 which > I still have on my PC but with the new version R 3.1.0 it does not work any > more (but some other new stuff, which won't work with 2.12). > > The probl

Re: [R] sensitivity and specificity

2014-04-25 Thread David Winsemius
On Apr 25, 2014, at 10:58 AM, Si Qi L. wrote: > Hi guys, > > I will be very grateful if you guys can do me a little favor on R. I am > calculating the sensitivity and specificity for a 2*2 matrix, such as > > t > 01 > 0 1427 110 > 1 271 166 > > > > My codes are: sens <- func

[R] sensitivity and specificity

2014-04-25 Thread Si Qi L.
Hi guys, I will be very grateful if you guys can do me a little favor on R. I am calculating the sensitivity and specificity for a 2*2 matrix, such as t 01 0 1427 110 1 271 166 My codes are: sens <- function(ct) { ct[2,2] / sum(ct[,2]) } spec <- f

Re: [R] HELP with fonts

2014-04-25 Thread David Winsemius
On Apr 24, 2014, at 6:40 PM, christian millan wrote: > Hi,I have been trying to make my axis fonts and axis labels fonts in bold > even when the I write the right command. I writing font.lab=2, font.axis=2 > but the bold fonts don't show up. Any help? There are three different plotting systems

[R] Problem with new(er) R version's matrix package

2014-04-25 Thread Werner W.
Dear Rs, I am re-executing some older code. It does work in the ancient R 2.12.0 which I still have on my PC but with the new version R 3.1.0 it does not work any more (but some other new stuff, which won't work with 2.12). The problem arises in context with the systemfit package using the matr

Re: [R] purtest and missing values (plm-package)

2014-04-25 Thread arun
Hi, May be this helps: library(plm) data(Grunfeld)  Grunfeld$inv[c(2,8)] <- NA  GrunfeldNew <- subset(Grunfeld, !year %in% year[is.na(inv)]) x <- data.frame(split(GrunfeldNew$inv, GrunfeldNew$firm)) purtest(x, pmax = 4, exo = "none", test = "levinlin",lags="SIC") #    Levin-Lin-Chu Unit-Root Te

Re: [R] purtest and missing values (plm-package)

2014-04-25 Thread Katharina Mersmann
Because, my inbox shows a "cutted-email-version", once again: Hello R-Community, I have quarterly panel-data and not surprisingly missing values, in a few variables, which are differently distributed around the panel. Now I want to run different unit-root tests. For ADF on the pooled data set,

Re: [R] Metafor: How to integrate effectsizes?

2014-04-25 Thread Michael Dewey
At 12:33 25/04/2014, you wrote: Thank you very much for your reply and the book recommendation, Michael. Yes, I mean Cohen's d - sorry for the typo :-) Just to make this sure for me: There is no possibility to integrate stated Cohens' ds in an R-Metaanalysis (or a MA at all), if there is no

[R] purtest and missing values (plm-package)

2014-04-25 Thread Katharina Mersmann
Hello R-Community, I have quarterly panel-data and not surprisingly missing values, in a few variables, which are differently distributed around the panel. Now I want to run different unit-root tests. For ADF on the pooled data set, I chose CADF-package, which can determine the number of

Re: [R] Unable to install rqpd

2014-04-25 Thread Sarah Goslee
Well, you could upgrade to the latest version of R, as the R-Forge page states, "R-Forge provides these binaries only for the most recent version of R, but not for older versions." If there's no Windows binary, it' s possible that some necessary requirement isn't available for Windows. You'll need

Re: [R] Unbalanced manova

2014-04-25 Thread John Fox
Dear Sergio, The Anova() function in the car package can perform MANOVA with a multivariate linear model fit to unbalanced data by lm() -- see the examples in ?Anova. I'm not sure what you mean by "avoiding NA values," however. With the default na.action, which is na.omit, lm() will perform a c

Re: [R] Linear line on pairs plot

2014-04-25 Thread Shane Carey
Do you know how I would put in the R squared value rather than the correlation by any chance? Cheers On Fri, Apr 25, 2014 at 12:56 PM, Shane Carey wrote: > Hey Frede, > > I found the answer, > > thanks for your help. > > Shane > > > On Fri, Apr 25, 2014 at 12:42 PM, Shane Carey wrote: > >> I

Re: [R] Linear line on pairs plot

2014-04-25 Thread Shane Carey
Hey Frede, I found the answer, thanks for your help. Shane On Fri, Apr 25, 2014 at 12:42 PM, Shane Carey wrote: > I just plotted one variable against the other, added a trend line and got > my R squared value. I presumed the absolute correlation from pairs() would > be the same? > > > On Fri

Re: [R] Linear line on pairs plot

2014-04-25 Thread Shane Carey
I just plotted one variable against the other, added a trend line and got my R squared value. I presumed the absolute correlation from pairs() would be the same? On Fri, Apr 25, 2014 at 12:24 PM, Frede Aakmann Tøgersen wrote: > No it is difficult to say when I don’t know what you did in Excel

[R] Cramer Rao upper/lower bounds- No Comments ?

2014-04-25 Thread Mohammed Ouassou
Dear R users; I have a question about Cramer Rao upper/lower bounds Is it possible to compute Crammer Rao upper/lower bounds from residuals and corresponding covariance matrices ? Any suggestions will be appreciated, thanks in advance. M.O __ R-he

[R] maximum size of dump.frames files?

2014-04-25 Thread Jannis
Hi R users, is there any possibility that the file created by: dump.frames(dumpto = file.name, to.file = TRUE) has any upper size limitations? I use the command above to debug R Code run on a cluster environment. Looking at the logs, I get an indication that an error occoured but the file

Re: [R] why does it say all the cases are complete?

2014-04-25 Thread ONKELINX, Thierry
You have no missing data. Note that the string "" is not missing! You need to code missings as NA. Have look at ?is.na ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Klin

Re: [R] Linear line on pairs plot

2014-04-25 Thread Frede Aakmann Tøgersen
No it is difficult to say when I don’t know what you did in Excel and Sigma Plot. The latter I don’t know and do not use it my self. Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5

Re: [R] Metafor: How to integrate effectsizes?

2014-04-25 Thread Michael Dewey
At 13:15 24/04/2014, Verena Weinbir wrote: Hello! I am using the metafor package for my master's thesis as an R-newbie. While calculating effectsizes from my dataset (mean values and standarddeviations) using "escalc" shouldn't be a problem (I hope ;-)), I wonder how I could at this point integr

Re: [R] Linear line on pairs plot

2014-04-25 Thread Shane Carey
Great, thanks Frede, This works perfectly. Ive tested these correlations with ones in sigma plot and excel and for some reason the r squared value is different. Any idea why this is? Thanks again for your help. Cheers On Fri, Apr 25, 2014 at 11:57 AM, Frede Aakmann Tøgersen wrote: > Hi > > Ha

[R] why does it say all the cases are complete?

2014-04-25 Thread Bill
Hi, Can someone explain why it says the cases are complete. It seems they are not. head(x) rnumExam.Title Patient.ID Age Sex Impression2 11 Temporal bone3529243 009Y M 22 Temporal bone3529243 010Y M 33 Head3508570 002M M 44Sacrum3494713

Re: [R] Linear line on pairs plot

2014-04-25 Thread Frede Aakmann Tøgersen
Hi Have a look on how panel.smooth is defined: panel.smooth function (x, y, col = par("col"), bg = NA, pch = par("pch"), cex = 1, col.smooth = "red", span = 2/3, iter = 3, ...) { points(x, y, pch = pch, col = col, bg = bg, cex = cex) ok <- is.finite(x) & is.finite(y) if (any(ok)

[R] Linear line on pairs plot

2014-04-25 Thread Shane Carey
Hi, Im trying to plot a linear line on the scatter plot using the pairs() function. At the moment the line is non linear. However, I want a linear line and the associated R value. Here is my current code: panel.cor.scale <- function(x, y, digits=2, prefix="", cex.cor) { usr <- par("usr"); on.e

[R] Unbalanced manova

2014-04-25 Thread Sergio Fonda
Hello list, I would be very grateful if somebody could suggest me which kind of call may be used to perform a manova with unbalanced data avoiding NA values. Thanks a lot [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Fast way to populate a sparse matrix

2014-04-25 Thread Martin Maechler
> Stefan Evert > on Fri, 25 Apr 2014 09:09:31 +0200 writes: > On 24 Apr 2014, at 23:56, Greg Snow <538...@gmail.com> wrote: >> library(Matrix) >> >> adjM <- Matrix(0,nrow=10,ncol=10) >> >> locs <- cbind( sample(1:10), sample(1:10) ) >> vals <- rnorm(10)

Re: [R] Fast way to populate a sparse matrix

2014-04-25 Thread Stefan Evert
On 24 Apr 2014, at 23:56, Greg Snow <538...@gmail.com> wrote: > library(Matrix) > > adjM <- Matrix(0,nrow=10,ncol=10) > > locs <- cbind( sample(1:10), sample(1:10) ) > vals <- rnorm(10) > > adjM[ locs ] <- vals ... and once you've got your data in this format, why not construct the sparse ma