Re: [R] Best Mac for R

2015-02-25 Thread Dan Murphy
Quick responses as usual. Can always count on R-Help! Bert's point that "it depends" is key, of course. Mark and Karim reminded me that R does not use all cores natively. Putting those together, an expensive quad core machine is not necessary for simple package development, documentation, etc. And

Re: [R] How many digits are there in left of dot of 0.0001 ?

2015-02-25 Thread ce
No no, I don't want scientific , I want really the number 4 in a variable or cut the 4 out of 1e-04 . I can do it with sub what difficulty is to cut how many characters , one or two -Original Message- From: "Hasan Diwan" [hasan.di...@gmail.com] Date: 02/25/2015 09:55 PM To: "ce" CC:

Re: [R] How many digits are there in left of dot of 0.0001 ?

2015-02-25 Thread Hasan Diwan
Ahh... The exponent of your number in scientific notation, which you can obtain using: format(a.number, scientific=TRUE) Hope that helps.. -- H On 25 February 2015 at 18:43, ce wrote: > > Sorry I meant right. I want to do it R of course. result should be 4 > naturally. On the left answer I wan

Re: [R] How many digits are there in left of dot of 0.0001 ?

2015-02-25 Thread ce
Sorry I meant right. I want to do it R of course. result should be 4 naturally. On the left answer I want would be 1 , -Original Message- From: "Hasan Diwan" [hasan.di...@gmail.com] Date: 02/25/2015 09:28 PM To: "R Project Help" Subject: Re: [R] How many digits are there in left of dot

Re: [R] How many digits are there in left of dot of 0.0001 ?

2015-02-25 Thread Hasan Diwan
On 25 February 2015 at 17:55, ce wrote: > Dear all, > > I would like to count how many digits are there on the left of a the dot > of a numeric variable > Left? An infinite number... What does this have to do with R, though? -- H > > a=0.0001 > > thanks > > _

[R] How many digits are there in left of dot of 0.0001 ?

2015-02-25 Thread ce
Dear all, I would like to count how many digits are there on the left of a the dot of a numeric variable a=0.0001 thanks __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Replace the value with 1 and 0

2015-02-25 Thread JS Huang
Hi, Here is an implementation. More data are added. An extra column hasRain is added instead of replacing column Amount. > rain Year Month Day Amount 1 1950 1 10.0 2 1950 1 2 35.5 3 1950 1 3 17.8 4 1950 1 4 24.5 5 1950 1 5 12.3 6 1950 1

Re: [R] Replace the value with 1 and 0

2015-02-25 Thread Clint Bowman
or: with(yourData,table(year,month,yourData[["rain"]]>0)) Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:

Re: [R] Replace the value with 1 and 0

2015-02-25 Thread Peter Alspach
Tena koe Something like: set.seed(153) # Create some (unrealistic) rainfall data yourData <- data.frame(year=rep(1950:1954, each=10), month=rep(rep(1:2, each=5), 5), rain=sample(0:1, 50, replace=TRUE)*round(rnorm(50, 20, 2), 1)) tapply(yourData$rain>0, yourData[,c('year','month')], sum) will gi

[R] Replace the value with 1 and 0

2015-02-25 Thread smart hendsome
Hi everyone, I have this kind of rainfall dataset:    Year Month Day Amount 1  1950 1   1    0.0 2  1950 1   2   35.5 3  1950 1   3   17.8 4  1950 1   4   24.5 5  1950 1   5   12.3 6  1950 1   6   11.5 7  1950 1   7    5.7 8  1950 1   8   13.2 9  1950 1   9   11.

Re: [R] Best Mac for R

2015-02-25 Thread Karim Mezhoud
Hi, It is not so efficient to have the most speed processor or biggest RAM. In general One processor is working at the time. It is more interesting to work with Linux for multiple multi_thread package and 64 bit. I am not sure if turbo boost is working with R. http://stackoverflow.com/questions/13

[R] Processing key_column, begin_date, end_date in R

2015-02-25 Thread Matt Gross
Hi, I am trying to process a large dataset in R. The dataset contains the following three columns: key_column - a unique key identifier begin_date - the start date of the active period end_date - the end date of the active period Example data is here: key_column,begin_date,end_date 123456,201

Re: [R] .Rd files

2015-02-25 Thread Erin Hodgess
Solved: it's the prompt function. On Wed, Feb 25, 2015 at 4:40 PM, Erin Hodgess wrote: > Hello there! > > When you use package.skeleton, you can put in all of your nice functions, > and the "bones" of the .Rd files are generated, which is fine. > > Now if you add another R function after the fa

[R] .Rd files

2015-02-25 Thread Erin Hodgess
Hello there! When you use package.skeleton, you can put in all of your nice functions, and the "bones" of the .Rd files are generated, which is fine. Now if you add another R function after the fact into the package, is there a quick-and-dirty function to generate an .Rd file, please? My inclina

[R] Merging Data.Tables on conditions other than equality

2015-02-25 Thread Brian Trautman
I have two tables that I would like to join together in a way equivalent to the following SQL. Note that I'm using a "greater than" statement in my join, rather than checking for equality. require(sqldf) require(data.table) dt <- data.table(num=c(1, 2, 3, 4, 5, 6), char=c('A', 'A', 'A', 'B', 'B

Re: [R] Help with nonlinear least squares regression curve fitting

2015-02-25 Thread Andrew Robinson
Finding starting values is a bit of a dark art. That said, there are steps you can take, but it may take time. First, I would scale Year so that it's not in the thousands! Experiment with subtracting 1980 or so. For specific advice, see inline. On Thu, Feb 26, 2015 at 3:03 AM, Corey Callaghan

Re: [R] Best Mac for R

2015-02-25 Thread Mark Sharp
For what I do, which does not require a lot of parallel work, the high end iMac was faster and much less expensive than the Mac Pro. Mark R. Mark Sharp, Ph.D. msh...@txbiomed.org > On Feb 25, 2015, at 1:50 PM, Dan Murphy wrote: > > I am possibly in the market for a new laptop. Predominantly

Re: [R] Best Mac for R

2015-02-25 Thread Bert Gunter
What does this have to do with R? Does the answer not depend on what you intend to do with your laptop, e.g the sorts of data you deal with, of which we have no idea? Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowled

[R] Best Mac for R

2015-02-25 Thread Dan Murphy
I am possibly in the market for a new laptop. Predominantly a Windows user, I owned a macbook pro 10 years ago and am considering going that route again. Does the standard advice still hold: Get the most powerful processor (i7), most ram (16GB), and largest internal storage (512GB), if affordable?

Re: [R] Getting Rmarkdown to generate custom LaTEX environment

2015-02-25 Thread Duncan Murdoch
On 25/02/2015 1:53 PM, Thierry Onkelinx wrote: This has nothing to do with *r*markdown but with the markdown language itself. Markdown has the concept of a figure caption. Hence fig.cap in Rmarkdown can work. But rmarkdown is based on knitr, which is very flexible. Presumably it is possible (

Re: [R] Getting Rmarkdown to generate custom LaTEX environment

2015-02-25 Thread Thierry Onkelinx
This has nothing to do with *r*markdown but with the markdown language itself. Markdown has the concept of a figure caption. Hence fig.cap in Rmarkdown can work. Op 25 feb. 2015 18:42 schreef "Huan Truong" <_...@tnhh.net>: > Hi Thierry, > > Thanks for the quick and informative answer. I understand

Re: [R] Getting Rmarkdown to generate custom LaTEX environment

2015-02-25 Thread Huan Truong
Hi Thierry, Thanks for the quick and informative answer. I understand that rmarkdown doesn't know the concept of figure*. However, I wonder why it knows that I could pass fig.cap fine, but not fig.env? Where in the code of rmarkdown does it take care of that fig.cap handling, so I can patch it to

[R] text miner error: Error in UseMethod("meta", x)

2015-02-25 Thread Sun Shine
Hi list I've been working my way through a tutorial on text mining ( http://onepager.togaware.com/TextMiningO.pdf ) and all was well until I came across this problem using tm (text miner): ++code+++ > docs <- tm_map(docs, content_transformer(tolower)) Warning messages:

Re: [R] plotting multiple time series under one panel

2015-02-25 Thread Jeff Newmiller
This is a plain text mailing list, and HTML gets munged on the list. It doesn't help your cause when you don't follow the Posting Guide (or my previous recommendations). >From the attached image, you do seem to want separate panels/facets. That is >accomplished with the facet_wrap function with

Re: [R] Robust GAM that covers Gaussian Distributions

2015-02-25 Thread Simon Wood
The 'scat' (scaled t) family in mgcv does allow for much heavier tails than Gaussian, but it may not be robust enough for you. On 25/02/15 15:27, Ilaria Prosdocimi wrote: Ilaria Prosdocimi ceh.ac.uk> writes: Christos Giannoulis gmail.com> writes: Dear All, I was looking the r-archives

Re: [R] help on improving the efficiency of the codes

2015-02-25 Thread Ivan Calandra
By the way, do not post the same topic twice, especially with different subject lines! It's counter-productive -- Ivan Calandra, ATER University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Roland Garros 51100 Reims, France +33(0)3 26 77 36 89 ivan.calan...@univ-reims.fr https

Re: [R] use R in a web interface

2015-02-25 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of hamid- > reza kadkhodazadeh > Sent: Wednesday, February 25, 2015 5:55 AM > To: c...@r-project.org; r-help@r-project.org > Subject: [R] use R in a web interface > > hi; > > *Is there a possibility to use

Re: [R] How to avoid two for loops?

2015-02-25 Thread Ivan Calandra
Hi Tammy, I think you're looking for aggregate() or something similar (from package plyr for example). Something along those lines: aggregate(DisplaySize~Brand, data=cl, FUN=sum) HTH, Ivan -- Ivan Calandra, ATER University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Rolan

Re: [R] How to avoid two for loops?

2015-02-25 Thread PIKAL Petr
Hi It seems to me that it is work for aggregate. Your code is not reproducible so we cannot test it. > temp<-read.table("clipboard", header=T) > temp Country Product Brand Year_Month DisplaySize OperationSystem 1 AE 120 201204 1 1 2 AE 5

[R] Help with nonlinear least squares regression curve fitting

2015-02-25 Thread Corey Callaghan
Hi everyone. This is my first post to this forum and I'm hoping someone can help. I'm trying to finish up some analysis for my thesis and this is the last problem I have. I have calculated data for 15 different species of birds; below is an example of one species and what the data might look like.

[R] ts converting

2015-02-25 Thread Temel İspanyolca
Hello I have problem with ts converting process. You can see my "y. txt" file in annex. my codes irpf <- read.table("y.txt", skip = 1, col.names = c(" time", "irpf")) irpf1 <- ts(irpf[, 2], start = c(1995, 1), frequency = 12) When I try to draw my data, result is following (annex: Captura) R is

[R] How to avoid two for loops?

2015-02-25 Thread conglan
HI, I have the following large data set: the sample is as the following: Country Product Brand Year_Month DisplaySize OperationSystem AE 1 20201204 1 1 AE 5 20201204 1 1

[R] help on improving the efficiency of the codes

2015-02-25 Thread conglan
HI, I have the following large data set: the sample is as the following: Country Product Brand Year_Month DisplaySize OperationSystem AE 1 20201204 1 1 AE 5 20201204 1 1

Re: [R] Robust GAM that covers Gaussian Distributions

2015-02-25 Thread Ilaria Prosdocimi
Ilaria Prosdocimi ceh.ac.uk> writes: > > Christos Giannoulis gmail.com> writes: > > > > > Dear All, > > > > I was looking the r-archives and crantastic...for a package that has a > > robust approach to generalized additive models. I found two packages > > "robustgam" and "rgam" but their im

[R] use R in a web interface

2015-02-25 Thread hamid-reza kadkhodazadeh
hi; *Is there a possibility to use R in a web interface (asp.net ) without the need to install it?* thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.e

Re: [R] Apply t-test on list in R

2015-02-25 Thread Zilefac Elvis via R-help
Many thanks, Petr.You solved my problem.AT. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proje

Re: [R] plotting multiple time series under one panel

2015-02-25 Thread Jeff Newmiller
Your request is confusing. You first say "trying to plot ... together in the same panel" and then complain "all graphs in one panel which did not help". For ggplot at least, melting seems likely to help, so this would really be a good time for you to follow the request included in every message o

Re: [R] dplyr: producing a good old data frame

2015-02-25 Thread Hadley Wickham
Hi John, Just printing the result gives a good indication where the problem lies: > frm %>% rowwise() %>% do(MM=max(as.numeric(.))) Source: local data frame [6 x 1] Groups: MM 1 2 3 4 5 6 do() is designed to produce scalars (e.g. a linear model), not vectors, so it doesn't join t

[R] plotting multiple time series under one panel

2015-02-25 Thread Raghuraman Ramachandran
Dear guRus I have data frame as: str(voldf) 'data.frame': 130 obs. of 8 variables: $ Date: Date, format: "2014-08-01" "2014-08-05" "2014-08-08" ... $ kc : num 0.453 0.424 0.468 0.481 0.485 ... $ sb : num 0.1128 0.123 0.1272 0.1128 0.0949 ... $ qc : num 0.0626 0.0661 0.0777 0.0765 0.0763

[R] Stats course: GAM and GAMM in Genoa, Italy

2015-02-25 Thread Highland Statistics Ltd
Apologies for cross-posting We would like to announce the following statistics course: Course: Introduction to GAM and GAMM with R Location: University of Genoa, Italy Date: 11 - 15 May 2015. Price: 425 GBP Course website: http://www.highstat.com/statscourse.htm Course flyer: htt

[R] Stats course: GAM and GAMM in Genoa, Italy

2015-02-25 Thread Highland Statistics Ltd
Apologies for cross-posting We would like to announce the following statistics course: Course: Introduction to GAM and GAMM with R Location: University of Genoa, Italy Date: 11 - 15 May 2015. Price: 425 GBP Course website: http://www.highstat.com/statscourse.htm Course flyer: htt

Re: [R] from expand.grid to a list (lapply)

2015-02-25 Thread Gerrit Eichner
Hie Alaiso, try to simply apply lapply() to your data frame. It should work w/o any further operation since data frames are lists (check with is.list()). Hth -- Gerrit On Wed, 25 Feb 2015, Alaios via R-help wrote: Hi all,I would like to use an expand.grid functionality that would give me

Re: [R] Getting Rmarkdown to generate custom LaTEX environment

2015-02-25 Thread Thierry Onkelinx
Dear Huan, Markdown doesn't know the concept of figure*. So you can't generate it with native Markdown markup. If you really need figure*, then the only option in markdown is to generate the LaTeX code yourself. Note that is will break conversion to formats that don't handle LaTeX code. Best rega

[R] from expand.grid to a list (lapply)

2015-02-25 Thread Alaios via R-help
Hi all,I would like to use an expand.grid functionality that would give me at the end a listso far my code looks like:  sigma_max_On_seq<-seq(0.05,100,length.out=1) mean_max_On_seq<-seq(2,1),length.out=1) expandMeanSigmaOn<-expand.grid(mean_max_On_seq,mean_max_On_seq,sigma_max_On_seq,s

Re: [R] Apply t-test on list in R

2015-02-25 Thread PIKAL Petr
Hi I did not seen any answer so I try one. If you have data frames organised in list I would use a for cycle. If your list is named mylist something like result <- list() k=0 for(i in n:m) { k=k+1 result[[k]] <- t.test(mylist[[x]], mylist[[i]]) } where x is a number for the one data frame you