Re: [R] Example(chron) doesn't work

2011-10-25 Thread hchui
Hi, there, I have a similar problem. The chron example gives NA. dates doesn't work but times does. I would appreciate it if there's a fix for it. Thanks, Helena > example(chron) chron> dts <- dates(c("02/27/92", "02/27/92", "01/14/92", chron+"02/28/92", "02/01/92")) chron> dt

Re: [R] difftime producing NA values in R 2.12.2

2011-10-25 Thread Jeff Newmiller
This is daylight savings time issue. Use chron or set your TZ environment variable to a standard-time-only timezone (or don't enter nonexistent time values for the timezone in which you wish to compute). --- Jeff Newmiller Th

Re: [R] Performing a non parametric Friedman Test

2011-10-25 Thread Daniel Malter
There is a friedman.test() function. Any reason you want to do it by hand? If so, you can do: #Simulated data matrix x<-matrix(rnorm(9),3,3,byrow=T) x #Rank matrix r<-matrix(rank(x),dim(x)) HTH, Daniel JohnnyJames wrote: > > My data looks like this: > (treatmen

[R] Performing a non parametric Friedman Test

2011-10-25 Thread JohnnyJames
My data looks like this: (treatments) T1 T2T3 DK 8 5 3 JP 54 1 AS 97 4 MK 8

Re: [R] Correlation Matrix in R

2011-10-25 Thread R. Michael Weylandt
I believe it has to do with the "complete.obs" choice and the presence of NAs in your data. The differences should vanish with "pairwise.complete.obs" but whether that's what you want is up to you. Michael On Tue, Oct 25, 2011 at 5:09 PM, AlexC wrote: > Hi, > > I am currently working with a dat

[R] Correlation Matrix in R

2011-10-25 Thread AlexC
Hi, I am currently working with a data set which contains a list of julian dates of phenological (flowering, leaf growth etc.) I obtained a correlation matrix by simply using the cor function with the dataset cor(dataset,use="complete.obs") that gives me a correlation matrix but the correlatio

Re: [R] RGtk2 problems

2011-10-25 Thread Aref
Thank you for the response and I am sorry about the html--will remember next time. The version of RGtk2 installed is 2.20.8 I installed it through R from CRAN repository. I believe that the problem is that during the installation the environment variable GTK_BASEPATH was set to some other location

[R] Logistic Regression - Variable Selection Methods With Prediction

2011-10-25 Thread RAJ
Hello, I am pretty new to R, I have always used SAS and SAS products. My target variable is binary ('Y' and 'N') and i have about 14 predictor variables. My goal is to compare different variable selection methods like Forward, Backward, All possible subsests. I am using misclassification rate to p

Re: [R] Create a matrix with increment and element with zero subscript

2011-10-25 Thread Md Desa, Zairul Nor Deana Binti
Thanks, all! I've tried changing the start and end of the loop and I tried cbind initial column with the other columns to get the matrix I want. It did work! Thanks also for the note about the parentheses. It real useful. I'll try Oarray if that would fasten the iteration. Thanks again! Deana

Re: [R] column subtraction by row

2011-10-25 Thread Rolf Turner
On 26/10/11 10:46, Vining, Kelly wrote: Dear UseRs, I have a data frame that looks like this: head(test2) attributes start end StemExplant Callus RegenPlant 1 LTR_Unknown 120 535 3.198 1.931 1.927 3 LTR_Unknown 2955 3218 0.541 0.103 0.613 6 LTR_Unknown 6

Re: [R] new to R coding.

2011-10-25 Thread Robert Baer
Not quite sure what you were trying to do, but try the slight modification below and see if it works for you: x = c (2434.1, 2463.7, 2451.6, 2444.5, 2431.3, 2436.3, 2412.6, 2417.9, 2380.1, 2366.2, 2349.1, 2373.9, 2336.9, 2335.0, 2297.1, 2291.1, 2278.6, 2289.9, 2314.5, 2328.8, 2322.0, 2337.3,

Re: [R] rshape2 help? [RESOLVED]

2011-10-25 Thread Rich Shepard
On Tue, 25 Oct 2011, David Winsemius wrote: At the console type: help(package=reshape2) Thank you, David. Rich __ 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

Re: [R] rshape2 help?

2011-10-25 Thread David Winsemius
On Oct 25, 2011, at 5:39 PM, Rich Shepard wrote: I installed the rshape2 package and loaded the library. But, when I type '?rshape2' I'm told there's no help available for it. CRAN has no .pdf documentation for this package. Where do I find the docs I need to learn how to use it with my

Re: [R] column subtraction by row

2011-10-25 Thread Pete Brecknock
Vining, Kelly wrote: > > Dear UseRs, > > I have a data frame that looks like this: > > head(test2) > attributes start end StemExplant Callus RegenPlant > 1 LTR_Unknown 120 535 3.198 1.931 1.927 > 3 LTR_Unknown 2955 3218 0.541 0.103 0.613 > 6 LTR_Unknown 6

[R] column subtraction by row

2011-10-25 Thread Vining, Kelly
Dear UseRs, I have a data frame that looks like this: head(test2) attributes start end StemExplant Callus RegenPlant 1 LTR_Unknown 120 535 3.198 1.931 1.927 3 LTR_Unknown 2955 3218 0.541 0.103 0.613 6 LTR_Unknown 6210 6423 6.080 4.650 9.081 9

[R] rshape2 help?

2011-10-25 Thread Rich Shepard
I installed the rshape2 package and loaded the library. But, when I type '?rshape2' I'm told there's no help available for it. CRAN has no .pdf documentation for this package. Where do I find the docs I need to learn how to use it with my data? TIA, Rich ___

Re: [R] extract data for specific levels factor

2011-10-25 Thread Dennis Murphy
Are you trying to separate the substrings in cat? If so, one way is to use the colsplit() function in the reshape2 package, something like (untested since you did not provide a suitable data format with which to work): library('reshape2') splitcat <- colsplit(mydata$cat, ' ', names = c('fat', 'bat

Re: [R] regression using GMM for mulltiple groups

2011-10-25 Thread Dennis Murphy
There are a few ways to do this. One is to use the lmList() function in the nlme package and use conditioning in the model formula. Another is to use the plyr package to create a list of models from which you can extract pieces of output from each model fit to the data subsets; for example, librar

[R] Installing rgeos on Mac OS X 10.4 (was Re: "package 'stringr' does not have a name space"

2011-10-25 Thread Nick Matzke
I figured it out, at least enough to get rgeos's gSimplify function to work, which was my original goal; the stringr problem was with 0.2, however I got stringr 0.5 to install by changing the minimum version in DESCRIPTION from R2.11 to R 2.10. ... Thanks for the help! # # This i

Re: [R] extract data for specific levels factor

2011-10-25 Thread Sarah Goslee
On Tue, Oct 25, 2011 at 4:49 PM, Nordlund, Dan (DSHS/RDA) wrote: >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of Sarah Goslee >> Sent: Tuesday, October 25, 2011 12:50 PM >> To: Andrés Aragón >> Cc: R-help@r-project.org >> S

Re: [R] extract data for specific levels factor

2011-10-25 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Sarah Goslee > Sent: Tuesday, October 25, 2011 12:50 PM > To: Andrés Aragón > Cc: R-help@r-project.org > Subject: Re: [R] extract data for specific levels factor > > Hi, > > 201

Re: [R] extract data for specific levels factor

2011-10-25 Thread Sarah Goslee
Hi, 2011/10/25 Andrés Aragón : > Dear all, > > I'm trying to analyze data with the following structure: > > ind          cat            tx      age > 40.2 por fol peq     vh        35 > 41.9 por fol med     vh        35 > 68.9 por fol preov   vh       35 > 71.5 por fol peq      ser       37 > 67.5

Re: [R] Create a matrix with increment and element with zero subscript

2011-10-25 Thread R. Michael Weylandt
Fair enough -- hadn't thought of going the other way. I do remember looking at that C trick once, but I'm actually somewhat surprised Fortan has it natively: I had always associated multiple basing with something like VBA that has to keep everyone on board but no one happy. Seems a surprisingly fle

Re: [R] difftime producing NA values in R 2.12.2

2011-10-25 Thread Richard M. Heiberger
I would like to nominate this for a new item in the FAQ for R. The FAQ should mention both the daylight-savings-time switch and have a reference to the R-News article Rich On Tue, Oct 25, 2011 at 3:16 PM, Adrienne Wootten wrote: > Ben, > > Thanks! That really helped. Turns out all the data bei

[R] extract data for specific levels factor

2011-10-25 Thread Andrés Aragón
Dear all, I'm trying to analyze data with the following structure: ind cattx age 40.2 por fol peq vh35 41.9 por fol med vh35 68.9 por fol preov vh 35 71.5 por fol peq ser 37 67.5 por fol medser 37 76.9 por fol preov

[R] regression using GMM for mulltiple groups

2011-10-25 Thread Sherlene Enriquez-Savery
Inthe code below I was trying to to obtain the GMM estimates for CAPM (REGRESSION) for 36 stocks each have 180 observations,however it only gives me one output rather than 36. In SAS i would just put in a *By statement*. I have a variable TICKER that categorize them into 36 groups. *How can I o

Re: [R] merging to data.frames whose columns are different but follow a pattern.

2011-10-25 Thread Dennis Murphy
Hi: Try this: INDIVIDUAL <- transform(INDIVIDUAL, IDHOUS = IDPERS %/% 100) merge(INDIVIDUAL, HOUSHOLD, by = c('IDHOUS', 'T')) IDHOUS T IDPERS SEX PC02 GHS Single COM2 NBPERS NBKID 1 41 1 4101 19 1 NA2 5 3 2 41 1 4102 20 0 NA2 5 3

Re: [R] difftime producing NA values in R 2.12.2

2011-10-25 Thread Adrienne Wootten
Ben, Thanks! That really helped. Turns out all the data being used was in EST and currently the system timezone is EDT. Thanks for the tip! A On Tue, Oct 25, 2011 at 2:27 PM, Ben Bolker wrote: > Adrienne Wootten ncsu.edu> writes: > >> >> R-listers, >> >> I have noticed several posts on issue

Re: [R] R for loop nested?

2011-10-25 Thread Kenn Konstabel
Hi there, I'm adding a very small bit of something utterly useless to Michael's response. When you start wondering why your code doesn't work the way you expect, making it as simple as possible might be the first step. For example, the following piece of code ... TRUE ... is simpler than ... !!

Re: [R] Lm function: Error in model.frame.default

2011-10-25 Thread Julie
When I tried dput function, the result was this: > dput(x) c(20, 200, 2000, 2) > dput(y) c(0.45, 0.05, 0.5, 0.4, 0, 0.5, 0.4, 0.05, 0.4, 0.25, 0.35, 0.5, 0.05, 0.4, 0.5, 0.5, 0.5, 0.25, 0.85, 0.5, 0.5, 0.5, 0.25, 0.4, 0.25, 0.25, 0.4, 0.25, 0.5, 0.15, 0.25, 0.1, 0.25, 0.25, 0.015, 0.4, 0.5

Re: [R] Maximization Problem

2011-10-25 Thread cberry
Eliano Marques writes: > Hi there, > > I need help in an optimization procedement. > > I'm trying to maximize the function fn=x^2+5y^2 with the restriction of > fn1=x-y<=5. > > I tried the genoud method and as well the alabama method. > > I have problems to set the constraint in R. > > Can someon

Re: [R] difftime producing NA values in R 2.12.2

2011-10-25 Thread Ben Bolker
Adrienne Wootten ncsu.edu> writes: > > R-listers, > > I have noticed several posts on issues with difftime producing NA's > but they have been for older versions of R. Here's the issue > associated with difftime that I am dealing with in R 2.12.2. > > > > difftime(strptime("03/11/2007 02:00"

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread Ben Bolker
On 11-10-25 01:35 PM, julien giami wrote: > The reason i use glmnet is that it makes the handling of 400,000 > observations easier to handle in terms of memory, > > I am looking on sparse matrices but i dont understand how to build > interacting using sparse matrices > If you're not familiar w

Re: [R] Extracting dataframe rows containing NAs in one column

2011-10-25 Thread R. Michael Weylandt
I'm thinking you need to spend some time reading about subsetting in R: temp[!complete.cases(temp),] # I don't think you need/want/should use the [,4] Michael On Tue, Oct 25, 2011 at 12:38 PM, kaallen wrote: > Hi, > > I am working on a data set which looks like this: > >> head(temp) >  Day Mon

[R] merging to data.frames whose columns are different but follow a pattern.

2011-10-25 Thread ManuelS
Hi, I'm working with panel data from the Swiss Houshold Panel (SHP). The data i got came in the following way: 1.) 12 *different* /individual/ files - one for each year . 2.) 12 *different* /houshold/ files - again: one for each year Each file came in the SPSS format (.sav). I implemented all the

Re: [R] Unlist alternatives?

2011-10-25 Thread kickout
Thank you. I suppose i needed the double bracket. Can't believe i didnt think of that earlier. That should help me. -- View this message in context: http://r.789695.n4.nabble.com/Unlist-alternatives-tp3935331p3937340.html Sent from the R help mailing list archive at Nabble.com. _

[R] Extracting dataframe rows containing NAs in one column

2011-10-25 Thread kaallen
Hi, I am working on a data set which looks like this: > head(temp) Day Month Year PW ROW 1 1 1 1959 NA 6.40 2 2 1 1959 6.65 6.35 3 3 1 1959 2.50 3.60 4 4 1 1959 0.60 2.25 5 5 1 1959 0.85 0.30 6 6 1 1959 0.00 2.20 I am trying to extract all the rows cont

[R] difftime producing NA values in R 2.12.2

2011-10-25 Thread Adrienne Wootten
R-listers, I have noticed several posts on issues with difftime producing NA's but they have been for older versions of R. Here's the issue associated with difftime that I am dealing with in R 2.12.2. > preciptime = strptime("01/10/2007 14:00",format="%m/%d/%Y %H:%M") > class(preciptime) [1] "PO

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread julien giami
The reason i use glmnet is that it makes the handling of 400,000 observations easier to handle in terms of memory, I am looking on sparse matrices but i dont understand how to build interacting using sparse matrices On Tue, Oct 25, 2011 at 12:34 PM, Marc Schwartz wrote: > > On Oct 25, 2011, at

Re: [R] Extracting dataframe rows containing NAs in one column

2011-10-25 Thread Pete Brecknock
kaallen wrote: > > Hi, > > I am working on a data set which looks like this: > >> head(temp) > Day Month Year PW ROW > 1 1 1 1959 NA 6.40 > 2 2 1 1959 6.65 6.35 > 3 3 1 1959 2.50 3.60 > 4 4 1 1959 0.60 2.25 > 5 5 1 1959 0.85 0.30 > 6 6 1 1959 0.00 2.20

[R] [R-pkgs] NMOF 0.20-0 (Numerical methods and optimization in finance)

2011-10-25 Thread Enrico Schumann
Dear all, version 0.20-0 of package NMOF is now on CRAN. 'NMOF' stands for 'Numerical Methods and Optimization in Finance'. The package accompanies the book with the same name, written by Manfred Gilli, Dietmar Maringer and Enrico Schumann, published by Elsevier/Academic Press in 2011. The

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread Marc Schwartz
On Oct 25, 2011, at 11:16 AM, Ben Bolker wrote: > Bert Gunter gene.com> writes: > >> >> If I understand you correctly, it sounds like you need to do some reading. >> >> ?lm and ?formula tell you how to specify linear models for glm or glmnet. >> However, if you do not have sufficient statisti

[R] alternative option in skewness and kurtosis tests?

2011-10-25 Thread Xiang Gao
I have a question about the D'Agostino skewness test and the Anscombe-Glynn kurtosis test. agostino.test(x, alternative = c("two.sided", "less", "greater")) anscombe.test(x, alternative = c("two.sided", "less", "greater")) The option "alternative" in those two functions seems to be the null hyp

Re: [R] constrain min and max of output

2011-10-25 Thread Vining, Kelly
That is really quite clever! -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Timothy Bates Sent: Tuesday, October 25, 2011 6:03 AM To: Jim Maas Cc: r-help@r-project.org Subject: Re: [R] constrain min and max of output this works

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread Ben Bolker
Bert Gunter gene.com> writes: > > If I understand you correctly, it sounds like you need to do some reading. > > ?lm and ?formula tell you how to specify linear models for glm or glmnet. > However, if you do not have sufficient statistical background, It probably > will be incomprehensible, in

Re: [R] [BioC] comparing two tables

2011-10-25 Thread David Winsemius
On Oct 25, 2011, at 10:40 AM, Assa Yeroslaviz wrote: Hi all, @Martin - thanks for the help it works very good. @David - sorry for the misunderstanding. I will see to it, that it won't happen again. BTW, unfortunately your function is not working. It is patialy my error as I gave no regions

Re: [R] Problem with svyvar in survey package

2011-10-25 Thread Thomas Lumley
Yes, but you didn't answer the question: what version of the package are you using? -thomas On Tue, Oct 25, 2011 at 3:03 AM, amitava wrote: > Respected Sir >        Thanks for your reply.I am giving a part of my output to clarify my > problem. > > > > >> s=sample(N,n,replace=F) >> print(s) >

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread Bert Gunter
If I understand you correctly, it sounds like you need to do some reading. ?lm and ?formula tell you how to specify linear models for glm or glmnet. However, if you do not have sufficient statistical background, It probably will be incomprehensible, in which case you should consult your local stat

[R] gvisGeoChart not recognizing US states as regions

2011-10-25 Thread Nicole Homeier
I'm having trouble using gvisGeoChart with region fills. I would like to fill a map of the U.S. by state. The documentation says it can be of the form "US-NJ" or "New Jersey", but I tried both and neither works for me. When I tried the latter the country of Georgia is filled, so at least it's d

Re: [R] R for loop nested?

2011-10-25 Thread R. Michael Weylandt
In what way doesn't this work? You declare xx with one element and it prints. Then on the next loop, you add another element, and it prints them both. Then on the next loop, you add another element, and it prints all three. And so on... If you look at the output, you can see that it's a growin

Re: [R] [BioC] comparing two tables

2011-10-25 Thread Assa Yeroslaviz
Hi all, @Martin - thanks for the help it works very good. @David - sorry for the misunderstanding. I will see to it, that it won't happen again. BTW, unfortunately your function is not working. It is patialy my error as I gave no regions with overlaps, but even after changing them it just doesn't

Re: [R] Library chron

2011-10-25 Thread R. Michael Weylandt
I think you mean to use if instead of ifelse (and you should probably read briefly on the difference between them: if is the regular programming construct: ifelse is a vectorized thing) if(length(theData) == 0) t0 <- t0 else t0 <- theData which can be more expressly written as t0 <- if(length(th

Re: [R] McFadden r^2 and the inrercept

2011-10-25 Thread Joshua Wiley
Hi Ville, McFadden's pseudo R^2 is just a (log) likelihood ratio for your model compared to the null model. The null is typically an intercept only model, but other comparisons may be valid also. If memory serves: 1 - log(full_likelihood)/log(null_likelihood) you can often extract likelihoods

[R] McFadden r^2 and the inrercept

2011-10-25 Thread Ville Iiskola
Hi I have estimated parameters of my data with mlogit and the following commands. I would like to know also the McFadden R^2 and the intercept, could soweone tell me how that can be done? library(RODBC) library(mlogit) library(foreign) z<-odbcConnectExcel("D:\\MALLI11ARVOT.xls")

[R] Glmnet Logistic Variable Questions

2011-10-25 Thread julien giami
We are workin on building a logistic regression using 1. We are doing a logistic regression with binary outcome variable using a set of predictors that include 8 continuous and 8 category predictors 2. We are trying to implement interaction between two variables (continuous and category or just c

Re: [R] textplot in layout

2011-10-25 Thread Ben quant
Perfect, thanks! ben On Tue, Oct 25, 2011 at 8:12 AM, Eik Vettorazzi wrote: > Hi Ben, > maybe mtext is of more help here? > > par(mar=c(7,3,3,3)) > plot(year,rate,main='main',sub='sub') > mtext('test',cex=1,side=1,line=5) > box() > > cheers > > Am 25.10.2011 15:26, schrieb Ben quant: > > Hello,

Re: [R] textplot in layout

2011-10-25 Thread Eik Vettorazzi
Hi Ben, maybe mtext is of more help here? par(mar=c(7,3,3,3)) plot(year,rate,main='main',sub='sub') mtext('test',cex=1,side=1,line=5) box() cheers Am 25.10.2011 15:26, schrieb Ben quant: > Hello, > > Someone (Erik) recently posted about putting text on a plot. That thread > didn't help. I'd lik

Re: [R] question regarding intersect function

2011-10-25 Thread David Winsemius
On Oct 25, 2011, at 6:07 AM, Samir Benzerfa wrote: Hi I have probably a very simple question but I'm going crazy trying to find the solution. I have two data.frames with headers and I'm doing an intersection between them by names, such that the intersected data.frames are returned b

Re: [R] [BioC] comparing two tables

2011-10-25 Thread Martin Morgan
On 10/25/2011 03:42 AM, Assa Yeroslaviz wrote: Hi everybody, I would like to know whether it is possible to compare to tables for certain parameters. I have these two tables: gene table name chr start end str accession Length gen1 4 646752 646838 + MI0

Re: [R] comparing two tables

2011-10-25 Thread David Winsemius
I (now) see that you crossposted rhelp and bioc. That practice is deprecated. Please read the Posting Guide more thoroughly. I will need to bear the burden of my sin in not looking at headers more closely in my own. -- David. On Oct 25, 2011, at 9:27 AM, David Winsemius wrote: On Oct

[R] Maximization Problem

2011-10-25 Thread Eliano Marques
Hi there, I need help in an optimization procedement. I'm trying to maximize the function fn=x^2+5y^2 with the restriction of fn1=x-y<=5. I tried the genoud method and as well the alabama method. I have problems to set the constraint in R. Can someone help me please? Regards, Eliano

Re: [R] constrain min and max of output

2011-10-25 Thread Eliano
Hi There, I have a similar problem. I have a function that i want to maximize. lets say: (x-2)^2+(y-4)^2 and i want to constraint that maximization to x+y<=5 I can program that constraints in R. Do you have any suggestion? Regards -- View this message in context: http://r.789695.n4.nabble.c

[R] R for loop nested?

2011-10-25 Thread Delia Shelton
Hi, I'm trying to execute the same R code on multiple data frames listed in a single directory. The code works fine if I use the code (below) for each file. However, I have several files and it becomes tedious to run each one, name it and then aggregate into a single dataframe. Name 0.0  

Re: [R] Problem with svyvar in survey package

2011-10-25 Thread amitava
Respected Sir Thanks for your reply.I am giving a part of my output to clarify my problem. > s=sample(N,n,replace=F) > print(s) [1] 6 29 27 44 37 43 1 10 26 20 > srswor_sample_data=getdata(salarydata,s) > attach(srswor_sample_data,warn.conflicts=F) > dsrswor=svydesign(id=~1,weights=r

[R] How to find seasonal effect and trend from raw data (newbie ...)

2011-10-25 Thread PtitBleu
Hello, >From the data provided in the attached file, I would like to find the seasonal effect and the trend (if there are some) like in page 10 of the following document: http://www.statoek.wiso.uni-goettingen.de/veranstaltungen/zeitreihen/sommer03/ts_r_intro.pd http://www.statoek.wiso.uni-goettin

[R] Maximization

2011-10-25 Thread Eliano
hi people, I'm trying to maximize this function: fn= function (x) {x[1]^2+5*x[2]^2} with this restriction fn1 = function (x) {x[1]+x[2] <=5} Can someone help me how to procedure this? I tried in the alabama and genoud package but i have problems with the setting of constrains. Regards, Eliano

[R] question regarding intersect function

2011-10-25 Thread Samir Benzerfa
Hi I have probably a very simple question but I'm going crazy trying to find the solution. I have two data.frames with headers and I'm doing an intersection between them by names, such that the intersected data.frames are returned by: df1[intersect(names (df1), names(df2))] and the same for

[R] Problem in creating XML

2011-10-25 Thread arunkumar1111
I've a problem in creating an XML My code node= newXMLNode("data") new<-newXMLNode("new",parent=node) child<-newXMLNode("Plot",parent=new) My dataframe Plot looks like below x y 0 123812.31 1 120166.77 2 15.83

[R] Library chron

2011-10-25 Thread hchui
Hi there, I have the following problem using times() and ifelse(). t0 <- c(rep("NA", 7)) theData <- times(c("07:36:00","08:09:00","10:28:00","13:28:00","16:29:00", "19:30:00","22:29:00")) t0 <- ifelse(length(theData)==0, t0,theData) In this case, R gives this, instead of theData: > t0 [1] 0.316

Re: [R] bestglm function and output in R

2011-10-25 Thread Candice
Hi Dennis, Thanks so much, I will try change the code and see what happens. Many thanks, Candice PhD. Student Centre for Invasion Biology Department of Botany and Zoology Stellenbosch University Cell: 083 987 2200 Date: Mon, 24 Oct 2011 09:18:02 -0700 From: ml-node+s789695n3933698...@

[R] How to use assign function within foreach

2011-10-25 Thread Bos, Roger
All, I would like to use the assign to save some data from a calculation within a foreach loop. Below is a contrived example where I cannot get output_1 ... output_100 to show up in my list when I do ls(). I have tried different combinations of pos and envir without anything showing up.

Re: [R] comparing two tables

2011-10-25 Thread David Winsemius
On Oct 25, 2011, at 6:42 AM, Assa Yeroslaviz wrote: Hi everybody, I would like to know whether it is possible to compare to tables for certain parameters. I have these two tables: gene table name chr start end str accession Length gen1 4 646752 646838

[R] textplot in layout

2011-10-25 Thread Ben quant
Hello, Someone (Erik) recently posted about putting text on a plot. That thread didn't help. I'd like to put text directly below the 'sub' text (with no gap). The code below is the best I can do. Note the large undesirable gap between 'sub' and 'test'. I'd like the word 'test' to be just below the

Re: [R] constrain min and max of output

2011-10-25 Thread Duncan Murdoch
On 25/10/2011 9:03 AM, Timothy Bates wrote: this works x=1; y=-100; z = min(5, max(1, x+y)); z But it only works for scalar x and y. The vector version would use pmin() and pmax(). Duncan Murdoch On 25 Oct 2011, at 1:46 PM, Jim Maas wrote: > Hello, > > Is there a simple way/function t

Re: [R] constrain min and max of output

2011-10-25 Thread Timothy Bates
this works x=1; y=-100; z = min(5, max(1, x+y)); z On 25 Oct 2011, at 1:46 PM, Jim Maas wrote: > Hello, > > Is there a simple way/function to constrain the minimum and maximum value of > an output from an assignment? > > if I have > > z <- x +y > > but I want z to always be between 1 and 5

Re: [R] Create a matrix with increment and element with zero subscript

2011-10-25 Thread S Ellison
R. Michael Weylandt wrote: > > This may be an unnecessary aside, but other than obfuscating > code or allowing people to never stop thinking in C and start > thinking in R, what practical purpose would this package > serve in an R context? > I'd think about constructs like income[1990:2010]

[R] constrain min and max of output

2011-10-25 Thread Jim Maas
Hello, Is there a simple way/function to constrain the minimum and maximum value of an output from an assignment? if I have z <- x +y but I want z to always be between 1 and 5, such that z=5 if (x+y >= 5) and z=1 if (x+y <= 1). I know it sounds simple, I can do it with "if" statements bu

Re: [R] Bar chart: break long bars

2011-10-25 Thread Jim Lemon
On 10/25/2011 09:27 PM, Florian Weiler wrote: Dear all, I have a problem with my stacked bar charts. I have one very long bar, hence I would like to break the x-axis at a certain point so that the shorter bars can be seen better. Here is a cooked up example: library(lattice) group<- rep(1:3,10)

Re: [R] how can I install the latest version of r in linux?

2011-10-25 Thread Marc Schwartz
On Oct 25, 2011, at 12:38 AM, Jie TANG wrote: > -- Forwarded message -- > From: Jie TANG > Date: 2011/10/25 > Subject: how can I install the latest version of r in linux? > To: r-help@r-project.org > > > HI R-users > I downloaded the latest version of R with the name R-latest.t

Re: [R] Create a matrix with increment and element with zero subscript

2011-10-25 Thread R. Michael Weylandt
This may be an unnecessary aside, but other than obfuscating code or allowing people to never stop thinking in C and start thinking in R, what practical purpose would this package serve in an R context? Michael On Mon, Oct 24, 2011 at 11:31 PM, Ben Bolker wrote: > Md Desa, Zairul Nor Deana Binti

Re: [R] lambda, uncertainty coefficient (& Somers D)

2011-10-25 Thread Marc Schwartz
On Oct 24, 2011, at 11:18 PM, hongwm wrote: > Dear Marc, > > I would also like to request the R code for doing this nominal measure of > association analyses, thanks in advance. Your kindly helps are really > appreciated. > > My email is hon...@mun.ca > > Have a great day, > Hong Hong, if you

[R] comparing two tables

2011-10-25 Thread Assa Yeroslaviz
Hi everybody, I would like to know whether it is possible to compare to tables for certain parameters. I have these two tables: gene table name chr start end str accession Length gen1 4 646752 646838 + MI0005806 86 gen12 2L 243035 243141

[R] Bar chart: break long bars

2011-10-25 Thread Florian Weiler
Dear all, I have a problem with my stacked bar charts. I have one very long bar, hence I would like to break the x-axis at a certain point so that the shorter bars can be seen better. Here is a cooked up example: library(lattice) group <- rep(1:3,10) x <- runif(30, 0, 100) y <- runif(30, 0, 100)

[R] lock a package to specific R version

2011-10-25 Thread Mehmet Suzen
Hi, I was wondering if it is possible to lock a package to a specific version of R. Dependency attribute in the package DESCRIPTION only accepts >= AFAIU (http://cran.r-project.org/doc/manuals/R-exts.html#fn-3 ) Any work around? Thanks, Mehmet LEGAL NOTICE This message is intended for the use