[R] R problem: Error in data[2:4] : object of type 'closure' is not subsettable

2013-12-11 Thread andrepavlik
Human_Rights_Excel_Data.xlsx Above is the attachment for my excel data. I am having this problem: Error in data[2:4] : object of type 'closure' is not subsettable Here is my code #data<-readcsv("HumanRightsExcelData")

[R] freetype 2.5.2, problem with the survival package, build R 2.15.x with gcc 4.8.x

2013-12-11 Thread Hin-Tak Leung
Here is a rather long discussion etc about freetype 2.5.2, problem with the survival package, and build R 2.15.x with gcc 4.8.x. Please feel free to skip forward. - freetype 2.5.2: the fix to cope with one of the Mac OS X's system fonts just before the release of freetype 2.5.1 caused a regre

[R] refline in forest() {metafor}

2013-12-11 Thread johnwilliams
Hello all, I am using forest.rma to plot a random effects model meta-analysis. I noticed that refline sets a vertical line indicating the null hypothesis. Is there a way to draw another vertical line, possibly dashed, centered on the summary estimate? Prof. Viechtbauer, if you happen to read thi

Re: [R] R problem: Error in data[2:4] : object of type 'closure' is not subsettable

2013-12-11 Thread Michael Sumner
That message refers to the function (closure) "data", which is a function in R and that you have not overwritten with a data.frame in that session. Note how you two versions of the code: dat1 <- read.csv("Human_Rights_Excel_Data.csv") #converted .xlsx to .csv and #data<-readcsv("HumanRightsExcel

Re: [R] R problem: Error in data[2:4] : object of type 'closure' is not subsettable

2013-12-11 Thread arun
Hi, May be this helps: dat1 <- read.csv("Human_Rights_Excel_Data.csv") #converted .xlsx to .csv mat1 <- log10(t(as.matrix(dat1[,2:4]))) mat1[!is.finite(mat1)] <- 0 par(mar=c(5,22,4,0.2)) COLOR<-c('red','brown4','black') barplot(mat1,beside=T,horiz=T,las=2,col=COLOR,main='KilingsinGaza,\nWestBank

Re: [R] bargraph.CI

2013-12-11 Thread yuanzhi
William Dunlap wrote > Furthermore, if you have a factor z with the levels in an undesirable > order > or missing some levels you can call > z <- factor(z, levels=betterOrderedLevels) > to get them in the order you want. E.g., > > > z <- factor(c("High", "Low", "High")) > > table(z) # lev

Re: [R] bargraph.CI

2013-12-11 Thread William Dunlap
Furthermore, if you have a factor z with the levels in an undesirable order or missing some levels you can call z <- factor(z, levels=betterOrderedLevels) to get them in the order you want. E.g., > z <- factor(c("High", "Low", "High")) > table(z) # levels are in alphabetical order z Hig

[R] "getRank" ?

2013-12-11 Thread Nicole Heim
Hello, I am trying to use the model.avg function after installing MuMIn for a list of models but an error arises each time stating that R could not find ".getRank". I am using a mac but not sure if this is the problem? My code is as follows: model.avg(model.list), where model.list was the obje

Re: [R] bargraph.CI

2013-12-11 Thread Sarah Goslee
Did you try what I suggested, which was to check your factor levels with str()? And no, pasting your data into an email is not helpful, because it does not tell me how R sees it. Using str() to provide that information, or dput() to provide the data itself, is necessary. Sarah On Wed, Dec 11, 20

Re: [R] solving simultaneous Equations in R

2013-12-11 Thread eliza botto
Dear Berend, Thankyou very much indeed for you reply. By taking help from your previous reply @ http://r.789695.n4.nabble.com/Simultaneous-equations-td2524645.html i was able to generate the following loop for the calculation of x=x[1] and y=x[2]. fun <- function(x) { f <- n

Re: [R] 3-D interpretation

2013-12-11 Thread Shane Carey
Hey, Thanks for this. I think I need some way of transposing the data onto a horizontal plane and then running the interpolation. Would this work maybe? I really dont know at this stage. Thanks for your help On Wednesday, December 11, 2013, Ben Bolker wrote: > > I got a little bit farther.

Re: [R] bargraph.CI

2013-12-11 Thread Sarah Goslee
Without knowing where you got bargraph.CI() I can't answer that part, since it isn't part of base R, but the most likely cause is that you did not specify the desired levels of your factor. You can check with str(). Compare: > testdata <- factor(c("a", "b", "a", "c", "b")) > str(testdata) Factor

[R] useR! 2014 cal for tutorials

2013-12-11 Thread Joshua Wiley
The R User Conference, useR! 2014 is scheduled for July 1-3, 2014 at the University of California, Los Angeles. Before the official program, half-day tutorials will be offered on Monday, June 30. We invite R users to submit proposals for three hour tutorials on special topics regarding R. The pro

[R] bargraph.CI

2013-12-11 Thread Yuanzhi Li
hello, I had a problem with the function "bargraph.CI". "bargraph.CI" draws a figure according to the alphabet sequence of the factor used. For example, I have a factor with for levels "CK", "N5", "N10", "N15", but the bars appear in "CK","N10","N15","N5" order(alphabet sequence), but I w

Re: [R] Heatmap Help

2013-12-11 Thread Sarah Goslee
You have some randomly doubled quotation marks and parentheses. A text editor with syntax highlighting is wonderful for catching that sort of problem. Beyond that, see: ?heatmap A "very urgent" request suggests homework to me, which this list doesn't do. Though sometimes someone will offer a h

[R] Leap hours?

2013-12-11 Thread Berry Boessenkool
Hi there, If you want to show off just how good R handles dates+times, forward this. I showed some colleagues difftime today, and encountered something interesting: difftime(ISOdatetime(1936:1947+1,1,1, 0,0,0), ISOdatetime(1936:1947,1,1, 0,0,0)) which returns the values 366, 365, 365, 365, 365.95

[R] Heatmap Help

2013-12-11 Thread Gaurav Pandey
Hello, I want a help, i have to make heat map.And i am using the following command In R for generating a matrix, but its returning an error,and i am not able to figure it out. Can you please tell me what is wrong? And please also suggest me how to generate a heat map. Its very urgent. Thanks a lot

Re: [R] Covert many lines in a specific line

2013-12-11 Thread arun
Hi, May be this helps: dat1 <- read.table(text="Sample  Genotype  Region     sample1    A  Region1     sample1    B  Region1     sample1    A  Region1     sample2    A  Region1     sample2    A  Region1     sample3    A  Region1     sample4    B  Region1",sep="",header

Re: [R] 3-D interpretation

2013-12-11 Thread Shane Carey
I want it as one block, if you know what I mean. Like the akima example. Thanks On Wed, Dec 11, 2013 at 4:41 PM, Shane Carey wrote: > Ok, here is the first 1500 points, but Im giving up hope on it to be > honest. > It seems to be going crazy, creating triangles everywhere. Do the points > need

Re: [R] 3-D interpretation

2013-12-11 Thread Shane Carey
Ok, here is the first 1500 points, but Im giving up hope on it to be honest. It seems to be going crazy, creating triangles everywhere. Do the points need to be evenly spaced? Thanks for your help. structure(list(X = c(9816966.951, 9816963.08, 9816947.516, 9816939.51, 9816924.005, 9816916.096, 981

Re: [R] 3-D interpretation

2013-12-11 Thread Ben Bolker
On 13-12-11 11:13 AM, Shane Carey wrote: > Hey, > > Nope, it crashes. R stops abruptly. I sent just 500 points to show the > structure of the data. There is in fact over 22,000 points and it is 3-D > data composing of x,y,z data > > Cheers We really, really need a reproducible example to be ab

Re: [R] 3-D interpretation

2013-12-11 Thread Shane Carey
Hey, Nope, it crashes. R stops abruptly. I sent just 500 points to show the structure of the data. There is in fact over 22,000 points and it is 3-D data composing of x,y,z data Cheers On Wed, Dec 11, 2013 at 3:24 PM, Ben Bolker wrote: > Shane Carey gmail.com> writes: > > > > > it just keeps

Re: [R] data distribution for lme

2013-12-11 Thread Kevin Wright
On Tue, Dec 10, 2013 at 7:33 PM, Rolf Turner wrote: > > See inline below. > > > On 12/11/13 11:28, Bert Gunter wrote: > >> This is not really an R question -- it is statistics. >> In any case, you should do better posting this on the >> R-Sig-Mixed-Models list, which concerns itself with matters l

Re: [R] fisher.test - can I use non-integer expected values?

2013-12-11 Thread bakerwl
I think that I can answer my own question, which was which R function is appropriate for the test I need. It looks like the EMT package and the exact multinomial test is appropriate for goodness-of-fit to test a null hypothesis of equal proportions, given at least 3 categories. Unless I am wrong, I

Re: [R] 3-D interpretation

2013-12-11 Thread Ben Bolker
Shane Carey gmail.com> writes: > > it just keeps crashing on me, > > It seems to crash on this line > > rgl.surface(akima.li$x,akima.li$y,akima.li$z,color="green",alpha=c(0.5)) When I run the code you gave us along with the data you gave us, I get Error in rgl.surface(akima.li$X, akima.li$

Re: [R] fisher.test - can I use non-integer expected values?

2013-12-11 Thread bakerwl
Thank you David, Peter, and Peter, I understand now that I would be misusing fisher.test to use it for a goodness-of-fit test and that non-integer data are inappropriate since it is for testing two sets of observed counts. Peter D., it does not seem like a good idea for me to "cheat" fisher.test

Re: [R] To transform a vector of qualitatives values into a dataframe of quantitatives values

2013-12-11 Thread Andrea Spano
more generally x <- c("A", "A", "B", "C", "B", "A", "C") as.data.frame(Map(match , table = unique(x), nomatch = 0, x = list(x))) Andrea On 11 December 2013 14:43, Duncan Murdoch wrote: > On 13-12-11 8:22 AM, PIKAL Petr wrote: > >> Hi >> >> -Original Message- >>> From: r-help-boun...@r

Re: [R] To transform a vector of qualitatives values into a dataframe of quantitatives values

2013-12-11 Thread Duncan Murdoch
On 13-12-11 8:22 AM, PIKAL Petr wrote: Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Arnaud Michel Sent: Wednesday, December 11, 2013 2:01 PM To: R help Subject: [R] To transform a vector of qualitatives values into a datafr

Re: [R] To transform a vector of qualitatives values into a dataframe of quantitatives values

2013-12-11 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Arnaud Michel > Sent: Wednesday, December 11, 2013 2:01 PM > To: R help > Subject: [R] To transform a vector of qualitatives values into a > dataframe of quantitatives values

[R] To transform a vector of qualitatives values into a dataframe of quantitatives values

2013-12-11 Thread Arnaud Michel
Hi From the vector X <- c(A, A, B, C, B, A, C) I would like to build the Dataframe : data.frame( A=c(1,1,0,0,0,1,0), B=c(0,0,1,0,1,0,0), C=c(0,0,0,1,0,0,1)) Any ideas ? -- Michel ARNAUD Chargé de mission auprès du DRH DGDRD-Drh - TA 174/04 Av Agropolis 34398 Montpellier cedex 5 tel : 04.67.61

Re: [R] setting effect plot parameters

2013-12-11 Thread John Fox
Dear Malcolm, You can't specify some trellis arguments to plot.eff() because some of them, such as scales, will conflict with trellis arguments that are already set by plot.eff(), the plot() method for objects of class "eff" produced by effect(). Likewise arguments that you specify via trellis.par

Re: [R] fisher.test - can I use non-integer expected values?

2013-12-11 Thread peter dalgaard
On 11 Dec 2013, at 06:37 , Peter Langfelder wrote: >> >> Expected values are needed to test a null hypothesis against observed >> counts, but if total observed counts are 20 for 3 categories, then a null >> hypothesis of a random effect would use expected values = 6.67 in each of >> the 3 categ

Re: [R] solving simultaneous Equations in R

2013-12-11 Thread Berend Hasselman
On 11-12-2013, at 12:16, eliza botto wrote: > Dear users of R, > I'm trying to solve the following 2 equations simultaneously in R for "x" and > "y". I couldn't get through due to my limited knowledge of R. > > 3=1-[(x-1)!(2x-y-1)!/(2x-1)!(x-y-1)!] > > 6={[(x-y-1)!/(x-1)!]-[3(2x-y-1)!/(2x-1)

[R] solving simultaneous Equations in R

2013-12-11 Thread eliza botto
Dear users of R, I'm trying to solve the following 2 equations simultaneously in R for "x" and "y". I couldn't get through due to my limited knowledge of R. 3=1-[(x-1)!(2x-y-1)!/(2x-1)!(x-y-1)!] 6={[(x-y-1)!/(x-1)!]-[3(2x-y-1)!/(2x-1)!]+[2(3x-y-1)!/(3x-1)!]}/{[(x-y-1)!/(x-1)!]-[(2x-y-1)!/(2x-1)

[R] How to deal with multiple class ROC analysis in R (pROC package)?

2013-12-11 Thread Yin Zhao
Here is the question link: http://stackoverflow.com/questions/20507108/how-to-deal-with-multiple-class-roc-analysis-in-r-proc-package Thanks! -- *Yin Zhao * *My Blogger * [[alternative HTML version deleted]]

Re: [R] Splitting a vector

2013-12-11 Thread Gerrit Eichner
Hello, Long Vo, take a look at the help page of split or directly at str(Y) They tell you that Y is a list, and list components are indexed using "[[": mean(Y[[4]]) should do what you want. Regards -- Gerrit This does what I needed. However, as the output is a list object, is there

Re: [R] If-statement in for-loop

2013-12-11 Thread Gerrit Eichner
Hello, "gncl dzgn", your problem has a flavor of homework which is usually not delt with on this list. However, a few comments: 0. The description of your problem is rather vague, in particular, the meaning of "input" in the description of your "conditions" is unclear! (By the way, your main