Re: [R] processing matrix equation derived from rows of two matrices

2013-04-12 Thread arun
Hi, May be this helps:  tb[1,]%*%(((val-rep(meansb79[1,],5))^2)/6) #    [,1] #[1,] 1.47619 tryvarb-c(1,2,3,4,4,4,4)  var(tryvarb) #[1] 1.47619 tb[2,]%*%(((val-rep(meansb79[2,],5))^2)/6) # [,1] #[1,] 1.904762 sapply(seq_len(nrow(tb)),function(i)

[R] Creating %d/%m/%Y %H:%M:%S format from separate date and time columns

2013-04-12 Thread Cat Cowie
Hi R forum, Each row of my data (below) show a new contact event between animals. In order to ultimately look at the patterns of intervals between contacts, I need to calculate a contact end time. The contact starts at the date and time shown in V4 and V5, and lasts for the duration shown IN

Re: [R] Creating %d/%m/%Y %H:%M:%S format from separate date andtimecolumns

2013-04-12 Thread Gerrit Eichner
Hello, Cat, see inline below. Hth -- Gerrit On Fri, 12 Apr 2013, Cat Cowie wrote: Hi R forum, Each row of my data (below) show a new contact event between animals. In order to ultimately look at the patterns of intervals between contacts, I need to calculate a contact end time. The

Re: [R] Assessing the fit of a nonlinear model to a new dataset

2013-04-12 Thread Rebecca Lester
Thank you all for your useful suggestions. Jean, I had already tried to use the maxiter command in that way, but it simply told me that the model had not converged. Based on Profs Ripley and Nash's comments, I have opted to use an alternative approach, and am creating a distribution of

Re: [R] Creating %d/%m/%Y %H:%M:%S format from separate date andtimecolumns

2013-04-12 Thread Cat Cowie
Hi Gerrit, Thanks for your quick reply - this, in combination with reversing the date as it is shown in my data, worked perfectly. startt- strptime((paste(data2$V4, data2$V5)), %Y-%m-%d %H:%M:%S) Apologies for the silly question it seems, but you've saved me a lot of time. Always learning

Re: [R] Creating %d/%m/%Y %H:%M:%S format from separate date and time columns

2013-04-12 Thread Pascal Oettli
Hi, The following should work: x - paste(paste(data2$V4, data2$V5), data2$V6, sep='.') startt - strptime(x, %Y-%m-%d %H:%M:%OS) Regards, Pascal 2013/4/12 Cat Cowie cat.e.co...@gmail.com Hi R forum, Each row of my data (below) show a new contact event between animals. In order to

Re: [R] Ordination Plotting: Warning: Species scores not available

2013-04-12 Thread Jari Oksanen
Micah Bennett micahgbennett at yahoo.com writes: Hi, I am working with a species-by-trait .csv file (columns=traits, rows=species) and get the following warning message when trying to plot results of both metaMDS and pcoa:  Warning message: In ordiplot(x, choices = choices, type =

Re: [R] Creating %d/%m/%Y %H:%M:%S format from separate date andtimecolumns

2013-04-12 Thread Jeff Newmiller
avoid using F, spell it out Use an appropriate TZ... e.g. use Sys.setenv( TZ=Etc/GMT+5 ) before converting if your time is local standard time year round Use difftime to add to time values for consistent results endt - startt + as.difftime( data2$V6, units=secs ) Use the str function to

Re: [R] bnlearn: how to compute boot strength with mmhc and a blacklist

2013-04-12 Thread Marco Scutari
Dear Leonore, On Wed, Apr 10, 2013 at 5:51 PM, Leonore Wigger leonore.wig...@unil.ch wrote: Question: I have specified a blacklist. I would have expected this to completely disallow the arcs on the blacklist. But the result shows that some of the blacklisted arcs have a strength 0 (rows

[R] pairwise ANOSIM test

2013-04-12 Thread Joon-Taek Yoo
Hello I am studying ANOSIM (analysis of similarities) using a package(vegan) provided in r statistics. I am wondering how to do pairwise ANOSIM test among three groups. Can anybody please explain this question. Thanks. [[alternative HTML version deleted]]

[R] werttemberg

2013-04-12 Thread Ali Zanaty
http://aragon-vida.com/11a-hdnsdsjreunx-1.php well, good night and thank you very much 932d4a1dff1375c06208c4cf2a7675e527431024e7d241382978df47d0f8c43f [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Error loading workspaces after upgrade

2013-04-12 Thread Tamas Barjak
Dear Members, I upgraded R from 2.15.3 to 3.0.0 (binary) on my WinXP and now I can't load my workspaces. The error message is: Error: requested primitive type is not consistent with cached value During startup - Warning message: unable to restore saved data in .RData Any idea to fix that?

Re: [R] Error loading workspaces after upgrade

2013-04-12 Thread PIKAL Petr
Hm. Sometimes workspace cannot be loaded when some packages which vere used for creationd objects in workspaces are missing, but in that case the error message is different. So you either can delete .RData but it obviously **delete** all objects or you need to find which package is missing

Re: [R] bnlearn: how to compute boot strength with mmhc and a blacklist

2013-04-12 Thread Leonore Wigger
Thanks a lot, Marco. This works. And your remark regarding less reliable arc strengths with cpdag=FALSE was very helpful. Leonore Le 12/04/2013 11:08, Marco Scutari a écrit : Dear Leonore, On Wed, Apr 10, 2013 at 5:51 PM, Leonore Wigger leonore.wig...@unil.ch wrote: Question: I have

Re: [R] A strange behaviour in the graphical function curve

2013-04-12 Thread Julio Sergio
Berend Hasselman bhh at xs4all.nl writes: Yes. curve expects the function you give it to return a vector if the input argument is a vector. This is clearly documented for the argument expr of curve. Thanks a lot, Berend! In fact, I didn't read carefully the documentation of curve. Anyway,

[R] RODBC MSSQL query with date - time tag

2013-04-12 Thread Rob Steenburgh
Greetings: I am trying to query an MSSQL database which contains time series data using RODBC. Using Server Management Studio, I can retrieve the data with this query: Select * from tb_ace_mag_1m where time_tag='2012-01-08 00:00:00' AND time_tag'2012-01-08 03:00:00' However, when I try to

[R] produce a map in ARCGIS from a GAM output

2013-04-12 Thread Lauria, Valentina
Hi, I am trying to predict the habitat suitability of lobster with GAMs. I need to produce a map in ArcGis of the predicted densities. I did some search and the function predict.gam seems to do the job. Is this the right way to do it? when you apply the function you get the predicted values

Re: [R] odfWeave: Some questions about potential formatting options

2013-04-12 Thread Milan Bouchet-Valat
Le jeudi 11 avril 2013 à 13:40 -0700, Paul Miller a écrit : Hello All, Learning to use the odfWeave package. I really like the package. It has good documentation, makes some very nice looking tables, and seems to have lots of options for customizing output. There are a few things I'd

[R] Problems with the DSL package

2013-04-12 Thread Vini
Hello, I'm trying to use R with an distributed File system (HDFS) and when I launch a MapReduce job with DSL package, I've got this message : *Streaming Command Failed! Error in !unlist(lapply(chunks, is.null)) : invalid argument type* I am using the Cloudera CDH4 Virtual Machine, R version is

[R] gc()

2013-04-12 Thread Keith S Weintraub
Folks, I have some computations in a function that create some large matrices. I have been in the habit in these circumstances to call null out a matrix once used and call gc(). Some pseudo code: theFunction-function(x, y, z, 1) { myMatrix - black.box.function(x, y, z, 1)

Re: [R] produce a map in ARCGIS from a GAM output

2013-04-12 Thread Barry Rowlingson
On Fri, Apr 12, 2013 at 10:37 AM, Lauria, Valentina valentina.lau...@nuigalway.ie wrote: Hi, I am trying to predict the habitat suitability of lobster with GAMs. I need to produce a map in ArcGis of the predicted densities. I did some search and the function predict.gam seems to do the job.

Re: [R] Adding unequal tables

2013-04-12 Thread arun
Hi, table.x- as.table(as.matrix(read.table(text= A    B C    D 2 4  6 5 ,sep=,header=TRUE))) table.y- as.table(as.matrix(read.table(text= C  D 5   1 ,sep=,header=TRUE))) library(plyr) library(reshape2) vec1-rowSums(join(melt(table.x)[,-1],

[R] Stat question: How to deal w/ negative outliers?

2013-04-12 Thread ramoss
Hello all, I have a question: I am using the interquantile method to spot outliers it gives me values of say 234 -120 or for the higher lower benchmarks. I don't have any issues w/ the higher end. However I don't have any negative values. My lowest possible value is 0. Should I consider 0

Re: [R] Read the data from a text file and reshape the data

2013-04-12 Thread Janesh Devkota
Hi Arun, Thank you so much for your answer. It surely does help. Having to know different approaches for the same problem has given me more insights on R language. I appreciate your time and effort. Best, Janesh Devkota On Thu, Apr 11, 2013 at 10:00 PM, arun smartpink...@yahoo.com wrote:

Re: [R] A strange behaviour in the graphical function curve

2013-04-12 Thread Julio Sergio
Berend Hasselman bhh at xs4all.nl writes: Your function miBeta returns a scalar when the argument mu is a vector. Use Vectorize to vectorize it. Like this VmiBeta - Vectorize(miBeta,vectorize.args=c(mu)) VmiBeta(c(420,440)) and draw the curve with this

[R] Multivariate AICc

2013-04-12 Thread Vinicius Bastazini
Dear all, I would like to find out if anyone is aware of the existence of implemented functions, or codes, for running multivariate AICc as it was developed by* *Fujikoshi Satoh (1997)* *. I've been searching for it, but goggle, rseek, and all other searching mechanism returns nothing.

Re: [R] produce a map in ARCGIS from a GAM output

2013-04-12 Thread Lauria, Valentina
Dear Barry, Thank you very much for your reply. I am trying to create a map in GIS of the habitat prediction of lobster using environmental predictors. I am attaching here a brief example of my script and data. I am OK for the GAM fitting and evaluation (residuals plot etc) but I am having

Re: [R] processing matrix equation derived from rows of two matrices

2013-04-12 Thread becksj
Thanks so much Arun. If you have time, what reference do you use to learn seq_len(nrow…etc and other aspects of your code? Again. Thanks very much. Jan Beckstrand From: arun kirshna [via R] [mailto:ml-node+s789695n4664037...@n4.nabble.com] Sent: Friday, April 12, 2013 2:01 AM To:

Re: [R] A strange behaviour in the graphical function curve

2013-04-12 Thread Jeff Newmiller
See below On Fri, 12 Apr 2013, Julio Sergio wrote: Berend Hasselman bhh at xs4all.nl writes: Your function miBeta returns a scalar when the argument mu is a vector. Use Vectorize to vectorize it. Like this VmiBeta - Vectorize(miBeta,vectorize.args=c(mu)) VmiBeta(c(420,440)) and draw

Re: [R] A strange behaviour in the graphical function curve

2013-04-12 Thread David Winsemius
On Apr 12, 2013, at 7:58 AM, Julio Sergio wrote: Berend Hasselman bhh at xs4all.nl writes: Your function miBeta returns a scalar when the argument mu is a vector. Use Vectorize to vectorize it. Like this VmiBeta - Vectorize(miBeta,vectorize.args=c(mu)) VmiBeta(c(420,440)) and draw

Re: [R] Stat question: How to deal w/ negative outliers?

2013-04-12 Thread Ista Zahn
Hi, This is not an R question and is therefore not appropriate for this list. You should post to a statistics forum such as http://stats.stackexchange.com/. But the answer is NO! Best, Ista On Fri, Apr 12, 2013 at 9:49 AM, ramoss ramine.mossad...@finra.org wrote: Hello all, I have a

Re: [R] Stat question: How to deal w/ negative outliers?

2013-04-12 Thread S Ellison
-Original Message- I have a question: I am using the interquantile method to spot outliers it gives me values of say 234 -120 or for the higher lower benchmarks. I don't have any issues w/ the higher end. However I don't have any negative values. My lowest possible value

Re: [R] processing matrix equation derived from rows of two matrices

2013-04-12 Thread arun
Hi Janis, For example The goal here is to get results per row BTW, your original posting had tb[,1] tb[,1]%*%(((val-rep(meansb79[1,],5))^2)/6) #Error in tb[, 1] %*% (((val - rep(meansb79[1, ], 5))^2)/6) :  # non-conformable arguments I guess it should be:

Re: [R] A strange behaviour in the graphical function

2013-04-12 Thread Julio Sergio
Jeff Newmiller jdnewmil at dcn.davis.ca.us writes: system.time( miBeta( seq( 370, 430, length.out=1e5 ) ) ) user system elapsed 1.300 0.024 1.476 system.time( miBetav( seq( 370, 430, length.out=1e5 ) ) ) user system elapsed This is very interesting, Jeff. Of course, I

Re: [R] Solving an integral in R gives the error “The integral is probably divergent”

2013-04-12 Thread peter dalgaard
But is it supposed to be t^{-3/2} or t^{-0.5}?? The formula has the former and the code the latter, and the integral is clearly divergent with the former. -pd On Apr 12, 2013, at 04:51 , Thomas Lumley wrote: I don't get an error message (after I correct the missing line break after the

Re: [R] Error loading workspaces after upgrade

2013-04-12 Thread Duncan Murdoch
On 12/04/2013 7:14 AM, Tamas Barjak wrote: Dear Members, I upgraded R from 2.15.3 to 3.0.0 (binary) on my WinXP and now I can't load my workspaces. The error message is: Error: requested primitive type is not consistent with cached value During startup - Warning message: unable to restore saved

Re: [R] Solving an integral in R gives the error The integral is probably divergent

2013-04-12 Thread Janesh Devkota
Hi Peter, It is supposed to be t^{3/2} instead of t^{0.5}. The code had a typo. Yes, I figured out that when x =0, the solution is divergent because it is like dividing something by zero. Thanks. Best, Janesh -Original Message- From: peter dalgaard [mailto:pda...@gmail.com] Sent:

[R] Why copying columns of a data.frame becomes numeric?

2013-04-12 Thread C W
Dear list, I want the 1st, 2nd, 5th, and 6th columns of mtcars. After copying them, the columns become numeric class rather than data frame. But, when I copy rows, they data frame retains its class. Why is this? I don't see why copying rows vs columns is so different. class(mtcars) [1]

Re: [R] Why copying columns of a data.frame becomes numeric?

2013-04-12 Thread Sarah Goslee
It's another reason not to use $ for extraction. By default, R reduces dimensionality when subsetting, so mtcars$mpg actually returns a numeric vector. With $, there's no way to override the default behavior. data(mtcars) a - mtcars$mpg class(a) [1] numeric dim(a) NULL a - mtcars[, mpg,

Re: [R] Why copying columns of a data.frame becomes numeric?

2013-04-12 Thread William Dunlap
class(mtcars[1:4,]) # select some rows [1] data.frame class(mtcars[,1:4]) # select some columns [1] data.frame class(mtcars[,3]) # select one column [1] numeric class(mtcars[, 3, drop=FALSE]) # select one column [1] data.frame I cannot give a definitive reason why it is done this way, but you

Re: [R] Error loading workspaces after upgrade

2013-04-12 Thread Tamas Barjak
YES, it's work! Fine! Thank you! I wait for the R-patch. Regards, Tamas 2013/4/12 Duncan Murdoch murdoch.dun...@gmail.com On 12/04/2013 7:14 AM, Tamas Barjak wrote: Dear Members, I upgraded R from 2.15.3 to 3.0.0 (binary) on my WinXP and now I can't load my workspaces. The error message

Re: [R] Why copying columns of a data.frame becomes numeric?

2013-04-12 Thread Berend Hasselman
On 12-04-2013, at 21:32, C W tmrs...@gmail.com wrote: Dear list, I want the 1st, 2nd, 5th, and 6th columns of mtcars. After copying them, the columns become numeric class rather than data frame. But, when I copy rows, they data frame retains its class. Why is this? I don't see why

Re: [R] how to change the date into an interval of date?

2013-04-12 Thread arun
Hi, I am not sure I understand your question correctly. dat1- read.table(text= id    responsed_at number_of_connection  scores 1  12-01-2010   1       2 1   

Re: [R] Why copying columns of a data.frame becomes numeric?

2013-04-12 Thread C W
What if my data is much larger, and I don't know what column number but know its name? Do I have to grep its by name? How about subset()? Is that what people commonly use? Mike On Fri, Apr 12, 2013 at 3:44 PM, Berend Hasselman b...@xs4all.nl wrote: On 12-04-2013, at 21:32, C W

Re: [R] Why copying columns of a data.frame becomes numeric?

2013-04-12 Thread Berend Hasselman
On 12-04-2013, at 21:56, C W tmrs...@gmail.com wrote: What if my data is much larger, and I don't know what column number but know its name? Do I have to grep its by name? How about subset()? Is that what people commonly use? Continuing with mtcars and the desired columns b -

Re: [R] Removing rows that are duplicates but column values are in reversed order

2013-04-12 Thread arun
Hi, From your example data, dat1- read.table(text= id1   id2   value a  b   10 c  d    11 b a 10 c  e 12 ,sep=,header=TRUE,stringsAsFactors=FALSE) #it is easier to get the output you wanted dat1[!duplicated(dat1$value),] #  id1 id2 value #1   a   b    10

Re: [R] Why copying columns of a data.frame becomes numeric?

2013-04-12 Thread C W
I was thinking, b - subset(mtcars, select=c(mpg, cyl, drat, wt)) Yours is even simpler. :) Thanks Mike On Fri, Apr 12, 2013 at 4:06 PM, Berend Hasselman b...@xs4all.nl wrote: On 12-04-2013, at 21:56, C W tmrs...@gmail.com wrote: What if my data is much larger, and I don't know what column

Re: [R] Search for common character strings within a column

2013-04-12 Thread arun
Hi, May be this helps: Not sure how you wanted to select those two letters.  dat1- read.table(text=    Seq,Output  A B B C D A C,Yes  B C A C B D A C,Yes C D A A C D,No ,sep=,,header=TRUE,stringsAsFactors=FALSE) library(stringr) lapply(str_split(str_trim(dat1$Seq),

[R] split date and time

2013-04-12 Thread Ye Lin
Hi R experts, For example I have a dataset looks like this: Number TimeStamp Value 1 1/1/2013 0:00 1 2 1/1/2013 0:01 2 3 1/1/2013 0:03 3 How can I split the TimeStamp Column into two and return a new table like this: Number Date Time Value 1

Re: [R] Search for common character strings within a column

2013-04-12 Thread arun
HI, In case if you wanted to take BC and CB as the same. dat1- read.table(text=    Seq,Output  A B B C D A C,Yes  B C A C B D A C,Yes C D A A C D,No ,sep=,,header=TRUE,stringsAsFactors=FALSE) lapply(str_split(str_trim(dat1$Seq), )[dat1$Output==Yes],function(x) {x1-t(combn(x,2));

Re: [R] split date and time

2013-04-12 Thread arun
Hi, dat1- read.table(text= Number,TimeStamp,Value 1,1/1/2013 0:00,1 2,1/1/2013 0:01,2 3,1/1/2013 0:03,3 ,sep=,,header=TRUE,stringsAsFactors=FALSE) dat2-data.frame(Number=dat1[,1],do.call(rbind,strsplit(dat1[,2], )), Value=dat1[,3])  names(dat2)[2:3]- c(Date,Time)  dat2 #  Number Date Time

[R] Fw: split date and time

2013-04-12 Thread arun
- Forwarded Message - From: arun smartpink...@yahoo.com To: Ye Lin ye...@lbl.gov Cc: Sent: Friday, April 12, 2013 6:25 PM Subject: Re: [R] split date and time Hi Ye, Is this okay? dat2-cbind(dat1[,-2],do.call(rbind,strsplit(dat1[,2], )),stringsAsFactors=FALSE)  dat2 #  Number

Re: [R] Fw: split date and time

2013-04-12 Thread Ye Lin
Thanks! On Fri, Apr 12, 2013 at 3:30 PM, arun smartpink...@yahoo.com wrote: - Forwarded Message - From: arun smartpink...@yahoo.com To: Ye Lin ye...@lbl.gov Cc: Sent: Friday, April 12, 2013 6:25 PM Subject: Re: [R] split date and time Hi Ye, Is this okay?

[R] kNNimpute error

2013-04-12 Thread Aimee Kopolow
Hi all, I'm trying to use kNNimpute in the imputation package to fill in missing precipitation data for a data frame I have. Example is: okee: Date rainfall 1997-05-010 1997-05-020 1997-05-03NA 1997-05-04

[R] Batch open netcdf files and get variables

2013-04-12 Thread Enhao Du
Hi, I'm new to R. I have some daily soil moisture data for the year 1979 in netcdf format such as these sm19790101.1.nc sm19790102.1.nc . . . sm19791231.1.nc I need to average a variable called sm to monthly resolution. I've done these days = formatC(1:31, width=2, flag=0) ncfiles =

[R] CCA report species environment correlation

2013-04-12 Thread SRuhl
Hi everyone, I did a CCA with R in the vegan package and got all the outputs I need/want to report except for one, that is the species environment correlation values. I only know of them because of one of the sources I read up on about CCAs reported it and I have the suspicion that it´s a value

[R] remove colinear variables

2013-04-12 Thread jul 2-pom
Hello I have a dataset with 151 dependent variables and estimated in 6 different conditions, and each condition is repeated 3 times. It si proteomic and therefore expensive, so few repetitions. I want to conduct a stepwise discriminant analysis to identify the variables that really matter. To do

[R] model frame and formula mismatch in model.matrix()

2013-04-12 Thread jul 2-pom
Hello everyone, I am trying to fit the following model All X. variables are continuous, while the conditions are categoricals. model - lm(X2

Re: [R] Removing rows that are duplicates but column values are in reversed order

2013-04-12 Thread vpr3
Thanks very much for your rapid help Arun. Vince On Apr 12, 2013, at 4:10 PM, arun kirshna [via R] wrote: Hi, From your example data, dat1- read.table(text= id1 id2 value a b 10 c d11 b a 10 c e 12 ,sep=,header=TRUE,stringsAsFactors=FALSE)

[R] BLAS with glmnet

2013-04-12 Thread Brian Pasley
I'm using a multithreaded BLAS library with R and I see the expected speed improvements with matrix multiplication, svd, etc. However, glmnet continues to use only a single CPU. Since this package is compiled from Fortran, is this the expected behavior or is there a way to compile the glmnet

[R] Problem with handling of attributes in xmlToList in XML package

2013-04-12 Thread santiago gil
Hello all, I have a problem with the way attributes are dealt with in the function xmlToList(), and I haven't been able to figure it out for days now. Say I have a document (produced by nmap) like this: mydoc - 'host starttime=1365204834 endtime=1365205860status state=up reason=echo-reply

[R] RJSONIO Installation

2013-04-12 Thread John Henry
Trying to install rjsonio and I've run into a couple of issues. 1. When installing from R, it's starts to download, then I get * installing *source* package 'RJSONIO' ... ERROR: configuration failed for package 'RJSONIO' * removing 'C:/Program Files/R/R-3.0.0/library/RJSONIO' 2. I've tried

Re: [R] Comparison of Date format

2013-04-12 Thread arun
Hi,  In the example you provided, it looks like the dates in Date2 happens first.  So, I changed it a bit.  DataA- read.table(text= ID,Status,Date1,Date2            1,A,3-Feb-01,15-May-01         1,B,15-May-01,16-May-01         1,A,16-May-01,3-Sep-01                    

Re: [R] Solving an integral in R gives the error “The integral is probably divergent”

2013-04-12 Thread Thomas Lumley
On Sat, Apr 13, 2013 at 6:31 AM, peter dalgaard pda...@gmail.com wrote: But is it supposed to be t^{-3/2} or t^{-0.5}?? The formula has the former and the code the latter, and the integral is clearly divergent with the former. I didn't look at that -- I just assumed that the code would

Re: [R] Comparison of Date format

2013-04-12 Thread arun
HI, In cases like below: DataA- read.table(text= ID,Status,Date1,Date2            1,A,3-Feb-01,15-May-01         1,B,15-May-01,16-May-01         1,A,16-May-01,3-Sep-01                     1,B,3-Sep-01,13-Sep-01                     1,C,13-Sep-01,26-Feb-04