[R] Misleading error message: XML content does not seem to be XML

2017-01-30 Thread Sigbert Klinke
Hi, using the XML package reading an XML file library("XML") doc <- xmlParse(file='abc.xml') I got the above error message. The problem was that the file was located at a different directory. So the file was not found rather than containing invalid XML. Best Sigbert -- http://u.hu-berlin.

Re: [R] Challenge extracting months

2017-01-30 Thread Jim Lemon
Hi Kwesi, A mistake in the last email. Don't try to replace the column in era.sta as the result will be a different length. Try this: newera.sta2<-collapse.values(era.sta[,2],3) Jim On Tue, Jan 31, 2017 at 10:32 AM, Jim Lemon wrote: > Hi Kwesi, > The function collapse_values will only work on a

Re: [R] HELP GLM

2017-01-30 Thread Jim Lemon
After scrupulous textual analysis, I conclude that you have at least one NA/NaN/Inf in b$induction. There is also a hint that you should acquaint yourself with family="binomial". Sherlock On Tue, Jan 31, 2017 at 11:18 AM, CHIRIBOGA Xavier wrote: > Dear colleagues, > > > I am trying to perform GL

[R] HELP GLM

2017-01-30 Thread CHIRIBOGA Xavier
Dear colleagues, I am trying to perform GLM but I got the following message. m2<-glm(induction~time+plant,data=b) Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, : NA/NaN/Inf in 'y' Adem�s: Warning messages: 1: In Ops.factor(y, mu) : '-' not meaningful for factors 2:

Re: [R] caculate correlation

2017-01-30 Thread Jim Lemon
Hi Elham, What I meant is to simply copy these two expressions into the R command line: coding.rpkm[grep("23.C",coding.rpkm$name),-1] ncoding.rpkm[grep("23.C",ncoding.rpkm$name),-1] and see what comes out. If both return a vector of numbers of the same length with no NA values, my guess was wron

Re: [R] Challenge extracting months

2017-01-30 Thread Jim Lemon
Hi Kwesi, The function collapse_values will only work on a vector of numbers with FUN="mean". era.sta looks like a data frame with at least two elements. As the second of these elements seems to be numeric, perhaps this will work: era.sta[,2]<-collapse.values(era.sta[,2],3) Don't try to apply the

Re: [R] Challenge extracting months

2017-01-30 Thread Kwesi Quagraine
Hello Jim,this is my script now; I am having this error when I called the function;" In mean.default(list(era...1. = 1:444, Node_freq = c(-0.389855332400718, : argument is not numeric or logical: returning NA" Any help will be much appreciated. Kwesi rm(list = ls()) setwd('/home/kwesi/Documents

Re: [R] caculate correlation

2017-01-30 Thread Elham - via R-help
this script automatically recognizes what is control among cod and lnc. Note that this script contains a piece of text that is "grep(".C",cod$name)". This text select - among all column names - those that contain ".C". in my files, I named C1, C2, C3, etc all columns that correspond to controls.

Re: [R] Save a generated .txt (or .csv) file on the desktop

2017-01-30 Thread Mark Sharp
You can define the "file" argument in your call to write.csv() ## This will write out a file named "test_file.csv" to your working directory write.csv(tableau,file = "test_file.csv", row.names=FALSE) R. Mark Sharp, Ph.D. msh...@txbiomed.org > On Jan 30, 2017, at 2:26 PM, varin sacha wrote:

Re: [R] caculate correlation

2017-01-30 Thread Jim Lemon
Hi Elham, This is about the same as your first message. What I meant was, what do these two expressions return? Is whatever is returned suitable input for the "cor" function? coding.rpkm[grep("23.C",coding.rpkm$name),-1] ncoding.rpkm[grep("23.C",ncoding.rpkm$name),-1] Jim On Tue, Jan 31, 2017

Re: [R] Challenge extracting months

2017-01-30 Thread Jim Lemon
Hi Kwesi, Even without the data, it seems clear that you want something like a rolling mean. Here is a simple function that will apply a function like "mean" to successive bits of a vector of numbers: collapse_values<-function(x,span,FUN="mean",na.rm=FALSE) { jump<-span-1 newx<-rep(NA,length(x)-

[R] Save a generated .txt (or .csv) file on the desktop

2017-01-30 Thread varin sacha
Dear R-Experts, I have generated a data.frame. Now I would like to get it (the generated data.frame) saved on my desktop (desktop of my computer) in a .csv or .txt file. How can I proceed ? Many thanks. Here is the reproducible example : # Génération aléatoire des colonnes Individu<-1:50 Ge

Re: [R] g parameter for deltaMethod() as a function

2017-01-30 Thread Fox, John
Dear Mark, I realized that there was a typo in my last response, which is corrected below: > On Jan 30, 2017, at 2:03 PM, Fox, John wrote: > > Dear Marc, > > A "wrapper function" *calls* deltaMethod(). > Your function try_g() is intended to be *called by* try_g(). Actually this should say, "Y

Re: [R] caculate correlation

2017-01-30 Thread Elham - via R-help
I have 9 experiments control/treatment that I analysed coding and lncoding, after that I normalize expression value.as you know we have different known number of coding and non -coding genes,so for calculating correlation first I transposed data ,(rows become columns)so row is control&treatment

Re: [R] caculate correlation

2017-01-30 Thread Jim Lemon
Hi Elham, Without knowing much about what coding.rpkm and ncoding.rkpm look like, it is difficult to say. Have you tried to subset these matrices as you do in the "cor" function and see what is returned? Jim On Tue, Jan 31, 2017 at 6:40 AM, Elham - via R-help wrote: > for calculating correlation

Re: [R] Strange display of saved functions

2017-01-30 Thread Duncan Murdoch
On 30/01/2017 2:17 PM, William Dunlap via R-help wrote: This must be a pretty old RData file (pre-2.14.0). news() says: Changes in version 2.14.0: NEW FEATURES o The "source" attribute on functions created with keep.source=TRUE has been replaced with a "srcref" attribute. The "

Re: [R] graphical behavior of a table of numbers

2017-01-30 Thread Richard M. Heiberger
I still think plot(fr, xlab="Determinant", ylab="Frequency") has a totally non-intuitive x-axis. I recommend that the example in R-intro.pdf include an additional sentence and option. ## In this example, where the x-axis is the entire set of integers -81:81, ## displaying them as an ordinary n

[R] caculate correlation

2017-01-30 Thread Elham - via R-help
for calculating correlation between coding and noncoding,first I transposed data ,(rows become columns) so row is control&treatment and columns are gene names.(so I have 2 matrix with same row and different column),I use these function for calculating correlation but all of spearman correlation

Re: [R] lines those not started with "rs"

2017-01-30 Thread Bert Gunter
... heh, heh and even simpler (but maybe not much faster) x[substring(x,1,2) != "rs"] (DUHHH!) -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon,

Re: [R] lines those not started with "rs"

2017-01-30 Thread Bert Gunter
Rui, et. al.: **IF** the data set can be read into R (3e6 lines x ?bytes/line ??) , then I think for a completely specified regular pattern such as that described by the OP, grep would be a bit inefficient. If x is a vector of strings, and you wish to remove all those that don't begin with "rs" th

Re: [R] Strange display of saved functions

2017-01-30 Thread William Dunlap via R-help
This must be a pretty old RData file (pre-2.14.0). news() says: Changes in version 2.14.0: NEW FEATURES o The "source" attribute on functions created with keep.source=TRUE has been replaced with a "srcref" attribute. The "srcref" attribute references an in-memory copy of

Re: [R] g parameter for deltaMethod() as a function

2017-01-30 Thread Fox, John
Dear Marc, A "wrapper function" *calls* deltaMethod(). Your function try_g() is intended to be *called by* try_g(). Actually, you just pass to deltaMethod() a character string that would evaluate to the function call, and deltaMethod() doesn't know what to do with that. The description of the

[R] Strange display of saved functions

2017-01-30 Thread Mik Bickis
Hello: I recently upgraded to R version 3.3.2 (2016-10-31) Now I find that functions that I load from an older .RData file give a strange display: --- > payments function (a,

Re: [R] lines those not started with "rs"

2017-01-30 Thread Rui Barradas
Hello, Try to study the following example. A <- c("rs1056", "rs1076", "ab1234567") x <- 1:3 dat <- data.frame(A, x) inx <- grepl("^rs", dat$A) dat[!inx, ] Hope this helps, Rui Barradas Em 30-01-2017 14:23, greg holly escreveu: Hi all; I have a file which has about 3.000.000 lines.

[R] metafor rma.mv weights questions

2017-01-30 Thread Duncan, Laura
Hi there, Question: Does the rma.mv command in metafor automically adjust the weights to account for multiple effect sizes within study or do these weights need to manually calculated and applied? Details: In setting up a multilevel meta-analysis and meta-regression with multiple effect sizes

Re: [R] (no subject)

2017-01-30 Thread Jeff Newmiller
Try d3 <- embed( c( NA, NA, dta$MEI ), 3) -- Sent from my phone. Please excuse my brevity. On January 30, 2017 9:28:52 AM PST, Kwesi Quagraine wrote: >Upon trying this method, I get an error ; > >Error in `$<-.data.frame`(`*tmp*`, "MEImeans", value = >c(0.313162987462034, : > replacement ha

Re: [R] g parameter for deltaMethod() as a function

2017-01-30 Thread Marc Girondot via R-help
Le 30/01/2017 � 19:04, Fox, John a �crit : >> Hi everyone, >> >> I try to use the Default S3 method DeltaMethod() from car package, but I >> have some problems when I try to use a function as the "g" parameter. I >> don't know if it is possible anyway. I hope that you could tell me: > I don't see h

Re: [R] g parameter for deltaMethod() as a function

2017-01-30 Thread Fox, John
Dear Marc, > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Marc > Girondot via R-help > Sent: Monday, January 30, 2017 12:19 PM > To: R-help Mailing List > Subject: [R] g parameter for deltaMethod() as a function > > Hi everyone, > > I try to use t

Re: [R] Challenge extracting months

2017-01-30 Thread Kwesi Quagraine
Well noted David. Thanks Kwesi On Mon, Jan 30, 2017 at 5:52 PM, David Winsemius wrote: > > > On Jan 30, 2017, at 4:53 AM, Kwesi Quagraine > wrote: > > > > Hello, I have a data with two variables nodes and index, I want to > extract > > 3 months seasons, with a shift of 1 month, that is, DJF, J

Re: [R] (no subject)

2017-01-30 Thread Kwesi Quagraine
Thanks for your suggestion. I am much grateful. Kwesi On Mon, Jan 30, 2017 at 4:23 PM, Robert Sherry wrote: > Here is one thought. Assign each month a value of 0, 1 or 2. Then do a > simple linear regression analysis where the value of the month > is the independent variable. You can also do mu

Re: [R] (no subject)

2017-01-30 Thread Kwesi Quagraine
Upon trying this method, I get an error ; Error in `$<-.data.frame`(`*tmp*`, "MEImeans", value = c(0.313162987462034, : replacement has 442 rows, data has 444 Any thoughts? Kwesi On Mon, Jan 30, 2017 at 5:37 PM, PIKAL Petr wrote: > Hi > > Probably just a small correction. > > d3 <- embed(

Re: [R] (no subject)

2017-01-30 Thread Kwesi Quagraine
Hello Eric, thanks for the code, it seems to do something closer to what I want. I generate JFM, FMA and so on, but it does not create the DJF at the beginning. Any thoughts on that? Kwesi On Mon, Jan 30, 2017 at 6:01 PM, Erich Subscriptions < erich.s...@neuwirth.priv.at> wrote: > Using dplyr an

[R] g parameter for deltaMethod() as a function

2017-01-30 Thread Marc Girondot via R-help
Hi everyone, I try to use the Default S3 method DeltaMethod() from car package, but I have some problems when I try to use a function as the "g" parameter. I don't know if it is possible anyway. I hope that you could tell me: Here an example from the help of deltaMethod(). It works and I und

Re: [R] (no subject)

2017-01-30 Thread Erich Subscriptions
Using dplyr and magrittr you could do the following -=-=-=-=- library(dplyr) library(magrittr) mydata <- read.table(text=" era...1.Node_freq MEI 1 1980-01-01 -0.389855332 0.3394196488 2 1980-02-01 -0.728019153 0.2483738232 3 1980-03-01 -1.992457784 0.3516954904 4 1

Re: [R] Challenge extracting months

2017-01-30 Thread David Winsemius
> On Jan 30, 2017, at 4:53 AM, Kwesi Quagraine wrote: > > Hello, I have a data with two variables nodes and index, I want to extract > 3 months seasons, with a shift of 1 month, that is, DJF, JFM, FMA etc to > OND. Was wondering how to go about it. Kindly find attached the data as csv. > Any hel

Re: [R] graphical behavior of a table of numbers

2017-01-30 Thread Martin Maechler
> Richard M Heiberger > on Mon, 30 Jan 2017 10:19:53 -0500 writes: > Duncan, thank you for locating the problem. > Martin, thank you for explaining the behavior and for the first pass > at fixing it. > With the fix, now the x-axis has ticks at all integers, and tick

Re: [R] (no subject)

2017-01-30 Thread PIKAL Petr
Hi Probably just a small correction. d3 <- embed( dta$MEI, 3) Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jeff > Newmiller > Sent: Monday, January 30, 2017 4:19 PM > To: r-help@r-project.org; Kwesi Quagraine > Subject: Re: [R] (no

Re: [R] graphical behavior of a table of numbers

2017-01-30 Thread Richard M. Heiberger
Duncan, thank you for locating the problem. Martin, thank you for explaining the behavior and for the first pass at fixing it. With the fix, now the x-axis has ticks at all integers, and tick labels at c(-81,-67,-53,-39,-25,-11,0,9,19,31,43,55,67,79) This is with R-3.3.2, as I interpret your fix to

Re: [R] (no subject)

2017-01-30 Thread Jeff Newmiller
How you proceed depends on how consistent the data are and on what you want to do with those sets of three months after you have identified them. One approach is to create a matrix where each row contains the values corresponding to the "second previous", "previous", and "current" months data,

Re: [R] lines those not started with "rs"

2017-01-30 Thread Robert Sherry
then my solution should work. Bob On 1/30/2017 9:44 AM, greg holly wrote: > Hi Robert; > > I do appreciate your advice. Only the first column of the data is > text. The rest columns are numeric. > > Regards, > > Greg > > On Mon, Jan 30, 2017 at 9:36 AM, Robert Sherry

Re: [R] lines those not started with "rs"

2017-01-30 Thread greg holly
Hi Robert; I do appreciate your advice. Only the first column of the data is text. The rest columns are numeric. Regards, Greg On Mon, Jan 30, 2017 at 9:36 AM, Robert Sherry wrote: > Greg, > > I am assuming that your data is in a text file. R is a good tool but not > the tool I would use for

Re: [R] lines those not started with "rs"

2017-01-30 Thread Robert Sherry
Greg, I am assuming that your data is in a text file. R is a good tool but not the tool I would use for this job. The tool I would use is grep. The following command should get you want you want: grep -v "^rs" Bob On 1/30/2017 9:23 AM, greg holly wrote: Hi all; I have a file which

[R] lines those not started with "rs"

2017-01-30 Thread greg holly
Hi all; I have a file which has about 3.000.000 lines. Most of the lines at first column start with "rs", for example, rs1056, rs1076 and so on. I would like to get the lines which do not start with "rs" . Your helps highly appreciated. Regards, Greg [[alternative HTML version d

Re: [R] (no subject)

2017-01-30 Thread Robert Sherry
Here is one thought. Assign each month a value of 0, 1 or 2. Then do a simple linear regression analysis where the value of the month is the independent variable. You can also do multiple linear regression with the value you assigned to the month plus the other factors that you believe are causin

[R] (no subject)

2017-01-30 Thread Kwesi Quagraine
Hello, I have a data with two variables nodes and index, I want to extract 3 months seasons, with a shift of 1 month, that is, DJF, JFM, FMA etc to OND. Was wondering how to go about it. Kindly find data sample below, data is in csv format. Any help will be appreciated. My data sample; era.

Re: [R] RQDA issue

2017-01-30 Thread peter dalgaard
That would be http://rqda.r-forge.r-project.org? It appears that the entire r-forge site is offline just now, but it is hosted at WU-Vienna, so they are the ones that have the hard facts about what has happened. Peter D. On 30 Jan 2017, at 08:09 , Miya Draga wrote: > Hello, > > Sincerest apo

[R] Challenge extracting months

2017-01-30 Thread Kwesi Quagraine
Hello, I have a data with two variables nodes and index, I want to extract 3 months seasons, with a shift of 1 month, that is, DJF, JFM, FMA etc to OND. Was wondering how to go about it. Kindly find attached the data as csv. Any help will be appreciated. Regards, ​Kwesi​ -- Try not to become a m

Re: [R] graphical behavior of a table of numbers

2017-01-30 Thread Martin Maechler
> Duncan Murdoch > on Sun, 29 Jan 2017 06:32:27 -0500 writes: > On 29/01/2017 12:05 AM, Jim Lemon wrote: >> Hi Richard, I think there may be something amiss in the >> plot.table function. As you note, changing the class of >> fr to array produces a more sensible plot,

[R] RQDA issue

2017-01-30 Thread Miya Draga
Hello, Sincerest apologies if I am emailing the wrong person/people, but I had a hard time finding contact information that seemed relevant to the issue that I'm having. I hope someone can answer my question. I would like to download RQDA to use for my research, but the RQDA Project website seems