Re: [R] txtProgressBar()

2016-07-21 Thread tom
You may like to look at ?suppressMessages P.S. sorry for posting in HTML, new laptop and it’s next on my list of things to fix. From: Ivan Calandra [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE a

Re: [R] Issue with Transform function in R

2016-07-21 Thread tom
Not sure I can translate the format of your Date column correctly, however the command DF1$Date <- as.Date(DF1$Date, format=’formatstr’) Will convert the dates into a format correctly handled by R. ?strptime Should give you an idea of what formatstr should look like. I.e. if date = 160721 as.

Re: [R] Creating a GUI based workflow

2013-04-11 Thread Tom
Or red-r.org.. Tom Sent from my iPhone On Apr 11, 2013, at 9:14 AM, Sarah Goslee wrote: > You might look into Kepler: > https://kepler-project.org/ > > Sarah > > On Thu, Apr 11, 2013 at 8:09 AM, Ravishankar Rajagopalan > wrote: >> Hello R-users, >> >>

[R] Boxplot has only one whisker

2010-10-13 Thread tom
.5) http://r.789695.n4.nabble.com/file/n2993262/boxplot_with_one_whisker.png Thanks! Tom -- View this message in context: http://r.789695.n4.nabble.com/Boxplot-has-only-one-whisker-tp2993262p2993262.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Boxplot has only one whisker

2010-10-13 Thread tom
xplots missing his whisker? I use the same data for both boxplots. thx, tom -- View this message in context: http://r.789695.n4.nabble.com/Boxplot-has-only-one-whisker-tp2993262p2993335.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Boxplot has only one whisker

2010-10-14 Thread tom
using different quantile computation methods. Thanks a lot to everybody for the quick answers! Tom -- View this message in context: http://r.789695.n4.nabble.com/Boxplot-has-only-one-whisker-tp2993262p2994962.html Sent from the R help mailing list archive at Nabb

Re: [R] gsub and regex to tidy comma-limited values

2009-03-14 Thread Tom
sub(",$","",gsub("^,*|,*$|(,)*", "\\1", ",,,apple,,orange,lemon,strawberry")) It may not be the best solution, but it was my first thought Tom - Original Message - From: "Daren Tan" To: Sent: Saturday, Marc

[R] Using Tobit and SUR in Systemfit in R

2018-05-10 Thread Tom Kopp
unrelated regression ("SUR") specification. However, I consider it more appropriate to estimate the cost function via OLS and the cost share equations via TOBIT due to some peculiarities of the data (but still as SUR). I am looking forward to your replies!! Warm regards, Tom (I have

Re: [R] legend order in ggplot2

2018-05-27 Thread Tom Hopper
, "name_b", "name_a", "name_c”)) my_lines <- c(name_a = "solid", name_b = "dotted", name_c = "twodash") ggplot(my_df, aes(x = x, y = val, linetype = var)) + geom_line() + scale_linetype_manual(values = my_lines) Regards, Tom >

Re: [R] ggplot2 not displaying graph in RH7 RStudio Server 3.2.3

2016-05-19 Thread Tom Wright
I just tested your code on my debian install with no problems. RStudio server logs messages to /var/log/messages (on redhat). Does running: $ cat /var/log/messages |grep rsession $ cat /var/log/messages |grep rserver in the shell give any clues? R version 3.2.5 (2016-04-14) Platform: x86_64-p

Re: [R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Tom Wright
Using dplyr $ library(dplyr) $ x<-data.frame(Length=c(321,350,340,180,198), ID=c(rep('A234',3),'B123','B225') ) $ x %>% group_by(ID) %>% summarise(m=mean(Length)) On Tue, May 24, 2016 at 3:46 PM, Matthew wrote: > I have a data frame with 10 columns. > In the last colum

Re: [R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Tom Wright
Don't see that as being a big problem. If your data grows then dplyr supports connections to external databases. Alternately if you just want a mean, most databases can do that directly in SQL. On Tue, May 24, 2016 at 4:17 PM, Matthew wrote: > Thank you very much, Tom. > This gets

Re: [R] strange error

2016-05-25 Thread Tom Wright
It may not be the problem, but with RStudio this error pops up when the area reserved for plotting is too small. Typically this area is in the right hand column, if you have this minimised (perhaps to maximise space for typing) you will hit this problem. Try making it bigger. Edit: Just ran your c

Re: [R] Shaded areas in R

2016-05-26 Thread Tom Wright
Hi Óscar, Not really sure what you mean by the time variable being a "character" vector. Unless you are plotting a barchart or boxplot (or similar), I don't this this makes sense. If you can post a sample of your data, preferably using the dput() command we can probably help more. On Thu, May 26,

Re: [R] How to import sensitive data when multiple users collaborate on R-script?

2016-05-31 Thread Tom Wright
My general approach to this is to put the function for loading data into a separate file which is then sourced in the main analysis file. Occasionally I'll use a construct like: if file.exists("loadData_local.R") { source("loadData_local.R") }else{ source("loadData_generic.R") } Whe

Re: [R] Problem loading aplpack library

2016-06-09 Thread Tom Wright
Assuming you are on a mac this link may be of assistance: http://tips.tutorialhorizon.com/2015/10/01/xcrun-error-invalid-active-developer-path-library-developer-commandline-tools-missing-xcrun/ On Wed, Jun 8, 2016 at 7:14 PM, David Howell wrote: > I am having trouble running aplpack on my Mac. It

Re: [R] VIM package

2016-06-09 Thread Tom Wright
Did you install the package before loading it? install.packages("VIM") On Thu, Jun 9, 2016 at 1:19 PM, Ayyappa Chaturvedula wrote: > Dear R users, > I am trying to use VIM (Visualization and Imputation of Missing Values) > package in R. When I try to install the VIM library (library(VIM)), I am

Re: [R] Closing FTP sessions with RCurl

2016-06-14 Thread Tom Wright
No expert here, and this isn't tested. It seems you can set the forbid.reuse option which will cause curl to shutdown the connection after transfer is complete. if(url.exists("http://www.omegahat.net/RCurl/index.html";)) { curl <- getCurlHandle() curlSetOpt(.opts=list(forbid.reuse=1),curl=cu

Re: [R] strange error message when using rnorm and rbinom

2016-06-14 Thread Tom Wright
As you probably already guessed we are going to need to see the contents of nref, mu.m2 and disp.m2 to help. dput(nref) dput(mu.m2) dput(disp.m2) k might help too. On Tue, Jun 14, 2016 at 2:06 PM, JI Cho wrote: > Dear R users, > > I have been using rnorm, rbinom and have been getting the followi

Re: [R] Building a binary vector out of dichotomous variables

2016-06-16 Thread Tom Wright
Does this do what you want? as.numeric(with(ds_example,paste(1,year2013,year2014,year2015,sep=''))) On Thu, Jun 16, 2016 at 8:57 AM, wrote: > Hi All, > > I need to build a binary vector made of a set of dichotomous variables. > > What I have so far is: > > -- cut -- > > ds_example <- > struct

Re: [R] Excluding coordinates that fall within a circle

2016-06-17 Thread Tom Wright
I'm no expert here but I have recently been playing with the package 'geosphere' it contains plenty of options to calculate distance between two coordinates specified as lat and long. install.packages('geosphere') # only needed once library(geosphere) coord1 <- c(43.60923,-79.322799) coord2 <- c(

[R] daily means, follow-up

2016-07-17 Thread Tom Mosca
Solved it myself: aggregate(mydata, by=mydata[c("MM","DD")], FUN=mean) Thank you. # - My dataframe looks like this: > mydata X.YY MM DD hh WDI R.WSP D.GST PRES ATMP DEWP 12015 1 1 0 328 3.6 4.5 102

[R] means by year, month and day

2016-07-17 Thread Tom Mosca
3.0 10 2015 1 1 9 272 8.8 9.6 1025.4 3.2 -3.3 � The first four columns are year, month, day, hour (0 � 23). I wish to take the means of the next six columns (WDIR, WSPD, GST, PRES, ATMP and DEWP) by year, month and day. That is, I want daily averages. Please help. Thank you.

Re: [R] means by year, month and day

2016-07-18 Thread Tom Mosca
do want to develop better form. So, I'll keep working on it. Thank you for your kind response and examples. I will study them. Sincerely, Tom From: jim holtman [jholt...@gmail.com] Sent: Sunday, July 17, 2016 7:14 PM To: Jianling Fan Cc: Tom Mosca;

Re: [R] means by year, month and day

2016-07-18 Thread Tom Mosca
Dear William, The line of code you composed works perfectly, as you knew it would. Thank you for your kind response. I will now endeavor to forget that other function exists. Sincerely, Tom From: William Dunlap [wdun...@tibco.com] Sent: Monday, July 18

[R] Geom_smooth

2016-07-20 Thread Tom Subia
Default level = 0.95. Does this mean +/- 0.025 from estimate? [[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

Re: [R] Date Time in R

2016-07-26 Thread Tom Wright
Hi again Shiva, I think what we need to see is the output from: str(eid$date) and perhaps head(eid$date) If you can send this information before doing any processing on the date (i.e. before the as.Date() function) we may be able to help. -Original Message- From: R-help [mailto:r-help

Re: [R] Date Time in R

2016-07-26 Thread Tom Wright
- wday(a1$date) # note can’t have spaces in variable names week_names <- wday(a1$date, label=TRUE) *From:* Shivi Bhatia [mailto:shivipm...@gmail.com] *Sent:* July 26, 2016 12:16 PM *To:* Tom Wright *Cc:* David L Carlson ; r-help *Subject:* Re: [R] Date Time in R Hello Tom, Please

Re: [R] R3.3.1 - Windows10 OS - Overriding default Legend title with user specified title

2016-07-26 Thread Tom Wright
A quick google for "ggplot2 change legend text" turns up several hits. This stackexchange question has several recipes. http://stats.stackexchange.com/questions/5007/how-can-i-change-the-title-o f-a-legend-in-ggplot2 including the correct use of the labs() function; labs(aesthetic='BrandValue in B

[R] Same code on Mac?

2016-09-01 Thread Tom Mosca
Using a PC I have written the R code for my elementary statistics students. One of the students has a Mac. Should the same lines of code work on a Mac? Where can the student find support for R on her Mac? I don't know anything about them, and have never used one. Thank you. [[al

Re: [R] [R-sig-Fedora] Building R-3.2.0 from source.

2015-05-10 Thread Tom Callaway
I just landed in Paris, and haven't read backwards in this thread, but I've done 3.2.0 builds for all current Fedora releases, they're all in updates-testing (I think the Fedora 22 builds are in updates stable now). The thing that changed is that R doesn't bundle a number of libraries like it u

Re: [R] [R-sig-Fedora] Building R-3.2.0 from source.

2015-05-11 Thread Tom Callaway
'm building anything for end-of-lifed Fedora releases, though I understand your predicament. That said, I am still building for EL5, which is older than Fedora 17, so you could try to rebuild the R src.rpm from koji. If it does not work properly, let me know, and I will try to

[R] Problem accessing xslx on CRAN mirrir

2015-07-14 Thread Knox, Tom
message: In open.connection(con, "r") : cannot open: HTTP status was '0 (nil)' I do not seem to be able to get past this issue, though am able to load the mh1823 POD package successfully from local zip file Regards, Tom Tom Knox NDE Subject Matter Expert Upstream Engineering

[R] trojan with R download

2015-07-31 Thread tom walk
I am working in China for a month and needed to download an earlier version of R in order to use Deseq2 and its requirements. The download got to the last few seconds and hung up. A trojan was found. It could be coincidence that it happened when I was downloading R, or perhaps a man in the mi

[R] ggplot with sparse layout

2015-01-06 Thread Tom Wright
ill I need to craft something using grid? Thanks for any ideas. Tom [[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 postin

Re: [R] ggplot with sparse layout

2015-01-07 Thread Tom Wright
x27;,'c'),each=3)), x=runif(18,0,10), y=rnorm(18,0,1)) I would like the first row to contain plots for id=1 & id=2, the second row plots for id=3 and the third row for id=4:6 On Tue, Jan 6, 2015 at 5:58 PM, ONKELINX, Thierry wrote: > Dear Tom, > &

Re: [R] using png and identify commands

2015-02-02 Thread Tom Wright
replacing png(...) and dev.off() with dev2bitmap('test.png') seems to work. On Mon, 2015-02-02 at 15:56 -0200, Antonio Silva wrote: > Hi R users > > I want to save a plot after using the command identify. > > I use identify to place labels manually near the points in order to avoid > overlapping

[R] collapse a list of dataframes

2015-02-02 Thread Tom Wright
Hi all, I'm trying to avoid loops (no real reason, just as an exercise). Given a list: list(data.frame(a=1:3,b=letters[1:3]),data.frame(x=1:5,b=LETTERS[1:5])) Is there an easy way to collapse this to a single dataframe result<-data.frame(a=c(1:3,1:5),b=c(letters[1:3],LETTERS[1:5])) Thanks _

Re: [R] collapse a list of dataframes

2015-02-02 Thread Tom Wright
uot;A","B");return(x)}) > do.call(rbind,t) > > > On Mon, Feb 2, 2015 at 4:00 PM, Tom Wright wrote: > Hi all, > > I'm trying to avoid loops (no real reason, just as an > exercise). > > Given a list: >

[R] Still trying to avoid loops

2015-02-04 Thread Tom Wright
ld like to generate another column giving the visit number R=c(2,1,1,1,2,3) My current solution uses nested loops and is slow and ugly. I've looked at by() but can't see how to keep the order of R correct. Thanks, Tom __ R-help@r-project.org

Re: [R] Teaching materials for R course

2015-02-04 Thread Tom Wright
For the introduction to R I strongly suggest you look at the materials published by software-carpentry www.software-carpentry.org. The lessons are all open-source, hosted on github and are under active development. On Tue, 2015-02-03 at 12:08 +0100, Michael Haenlein wrote: > Dear all, > > I am Pr

Re: [R] Still trying to avoid loops

2015-02-04 Thread Tom Wright
,'b','c'), not c('b', 'a', 'c'), then the following will do > the job. > > unname(unlist(tapply(dat$D, dat$S, order))) > > > Hope this helps, > > Rui Barradas > > Em 04-02-2015 19:34, Tom Wright escreveu: > > G

Re: [R] Still trying to avoid loops

2015-02-04 Thread Tom Wright
> > > Aren't the levels of your example wrong? If the levels are > > levels=c('a','b','c'), not c('b', 'a', 'c'), then the following will do the > > job. > > > > unname(unlist(tapply(dat$D, dat$S, or

Re: [R] Still trying to avoid loops

2015-02-04 Thread Tom Wright
; S D visit > 1 a 5 1 > 2 a 1 2 > 3 b 3 1 > 4 c 2 1 > 5 c 3 2 > 6 c 4 3 > > > > > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. &

Re: [R] Still trying to avoid loops

2015-02-04 Thread Tom Wright
> -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Tom Wright > Sent: Wednesday, February 4, 2015 2:08 PM > To: Rui Barradas > Cc: r-h...@stat.math.ethz.ch > Subject: Re: [R] Still trying to avoid loops > > Thanks, I was not aware of

Re: [R] problem with function that adds rows to dataframe based on conditional statement

2015-03-06 Thread Tom Wright
If all you want is to add a row of na's could you just do something like: nExpectedRows<-length(unique(animals)) * length(unique(animalYears)) * 2 newDf<-data.frame(animals=rep(NA,nExpectedRows-nrow(comAn)), animalYears=rep(NA,nExpectedRows-nrow(comAn)), animal

Re: [R] plotting the one-dimensional density of events in time

2015-03-06 Thread Tom Wright
plot(density(as.numeric(dd)), axes=FALSE, xlim=c(as.numeric(as.Date("2014-01-01")), as.numeric(as.Date("2014-12-30"))) rug(as.numeric(dd)) axis(side=1, at=seq(from=as.numeric(as.Date('2014-01-01')), to=as.numeric(as.Date('2014-12-1')),length.out=12), lab

Re: [R] Requesting function for A/B testing

2015-03-06 Thread Tom Wright
I can answer this: sample(c(0,1),1) On Fri, 2015-03-06 at 15:04 +0530, Namratha K wrote: > Dear Sir/Madam, > I am a student pursuing MCA .As i am doing an project using R language .I > want to implement A/B testing using R language.I am searching in google > from past few days and not able to imp

Re: [R] reading multiple text files from web

2015-03-18 Thread Tom Wright
I think you need to use a loop to iterate through each of the items in getlinks for(link in getlinks) { url<-paste0('http://spec.org/jEnterprise2010/results/',link) output<-readfiles(url) } You're probably also going to need to add some error handling when your sea

Re: [R] summary.formula()

2015-03-18 Thread Tom Wright
First you need to make the data pbc available, perhaps by: data(pbc, package="survival") Then the line: sf2<-summary(... looks wrong, usually you would use the summary() function to look at the output from a function, seems to me you are missing the function here. I have no idea what this functi

Re: [R] Randomly interleaving data frames while preserving order

2015-03-31 Thread Tom Wright
samples<-sample(c(rep(1,10),rep(2,10),rep(3,10)),30) samples[samples==1]<-1001:1010 samples[samples==2]<-2001:2010 samples[samples==3]<-3001:3010 fullDf<-rbind(df1,df2,df3) fullDf[sort(order(samples),index.return=TRUE)$ix,] On Tue, 2015-03-31 at 13:05 -0400, Kevin E. Thorpe wrote: > Hello. > >

Re: [R] data.frame: data-driven column selections that vary by row??

2015-03-31 Thread Tom Wright
Nice clean-up!!! On Tue, 2015-03-31 at 14:19 -0400, Ista Zahn wrote: > library(tidyr) > library(dplyr) > bw <- gather(bw, key = "tmp", value = "value", > matches("^d[a-z]+[0-9]+")) > bw <- separate(bw, tmp, c("disc", "var"), "_", extra = "merge") > bw <- spread(bw, var, value) ___

Re: [R] data.frame: data-driven column selections that vary by row??

2015-03-31 Thread Tom Wright
Not entirely sure I understand your problem here (your first email was a lot of reading). Would it make sense to add an extra column device_name Thus ending up with something like: Host Device Type host_Aada0ssd host_Aada1ssd host_Aada2hdd ... host_Nda3 ssd

Re: [R] How to obtain a cross tab count of unique values

2015-03-31 Thread Tom Wright
table(unique(df)$PROJECT) On Tue, 2015-03-31 at 14:51 -0500, Walter Anderson wrote: > I have a data frame that shows all of the parks (including duplicates) > that are impacted by a projects 'footprint': > > PROJECT PARKNAME > A PRK A > A PRK B > A PRK A > B PRK C > B

[R] Trying to fix code that will find highest 5 column names and their associated values for each row in a data frame in R

2018-12-17 Thread Tom Woolman
I have a data frame each with 10 variables of integer data for various attributes about each row of data, and I need to know the highest 5 variables related to each of row in this data frame and output that to a new data frame. In addition to the 5 highest variable names, I also need to kn

[R] regex pattern assistance

2014-08-15 Thread Tom Wright
both nearly work. I expected I would use something like: > str_match(x,"\\/mnt\\/AO\\/AO Data\\/([\\w -]+)\\/+") but I don't seem able to get the square bracket grouping to work correctly. Can someone please show me where I am going wrong? Thanks, Tom

Re: [R] regex pattern assistance

2014-08-15 Thread Tom Wright
ort still works, not everything has moved to linkedin and stackoverflow. Thanks again, Tom On Fri, 2014-08-15 at 12:18 -0400, Tom Wright wrote: > Hi, > Can anyone please assist. > > given the string > > > x<-"/mnt/AO/AO Data/S01-012/120824/" > > I would lik

[R] ggplot - boxplot and points split by two factors

2014-09-08 Thread Tom Wright
geom_boxplot() + geom_point() Obviously I'd also like to separate the points to overlay the relevant boxplots. Any hints gratefully received. Thanks, Tom __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] ggplot - boxplot and points split by two factors

2014-09-08 Thread Tom Wright
ggplot(data,aes(x = z1, y = x, fill=x2)) + geom_boxplot() + geom_point(alpha=0.5, position=position_jitterdodge(jitter.width=0.1), aes(group=x2)) On Mon, 2014-09-08 at 13:10 -0400, Tom Wright wrote: > Hi, > I'm trying to create a boxplot overlayed with points where

Re: [R] plot

2014-09-19 Thread Tom Wright
plot(x=range(x),y=range(c(y1,y2,y3.y4),type='n') lines(x=x,y=y1,lty=1) lines(x=x,y=y2,lty=2) lines(x=x,y=y3,lty=3) lines(x=x,y=y4,lty=4) legend('bottomright',c('Y1','Y2','Y3','Y4','Y5'),lty=1:4) or something like that. On Fri, 2014-09-19 at 14:11 -0500, Marc Schwartz wrote: > On Sep 19, 2014,

[R] ggplot - start axis label with superscript

2014-10-14 Thread Tom Walker
C", sep = ""))) Any help on this issue would be much appreciated! Many thanks, Tom __ 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.org/posting-guid

Re: [R] Sum of two consecutive number in dataset.

2014-10-15 Thread Tom Wright
A couple of observations: 1) I'm not sure what the variable i is doing, looks like you are trying to loop through years but perhaps you left that bit of code out for clarity. 2) On the first loop of i you are assigning the values of Samaru56[sow_day,] to all values in Samaru56. For future loops all

[R] Presentation tables in R (knitr)

2014-11-25 Thread Tom Wright
Hi, This problem has me stumped so I thought I'd ask the experts. I'm trying to create a pretty summary table of some data (which patients have had what tests at what times). Ideally I'd like to knitr this into a pretty PDF for presentation. If anyone has pointers I'll be grateful. require(tables)

Re: [R] Presentation tables in R (knitr)

2014-11-25 Thread Tom Wright
| 1 | 1 | 1 | 1 Currently I'm using markdown in r-studio. And yes, I know the same information is in the dcast solution but I'm trying to convince people R is an alternative to excel. On Tue, Nov 25, 2014 at 3:37 PM, Mark Sharp wrote: > Tom, > > If you are wanting

Re: [R] Presentation tables in R (knitr)

2014-11-25 Thread Tom Wright
Thanks Duncan, Dropping the extra columns might be the way forward. I'm sure I can work out how to embed latex into a markdown document ;-) On Tue, Nov 25, 2014 at 4:37 PM, Duncan Murdoch wrote: > On 25/11/2014 3:12 PM, Tom Wright wrote: > >> Hi, >> This problem has me s

Re: [R] R-help Digest, Vol 141, Issue 29

2014-11-29 Thread Tom Keller
http://www.bioperl.org/wiki/HOWTOs On Nov 29, 2014, at 3:00 AM, r-help-requ...@r-project.org wrote: Subject: Re: [R] perl On Friday, November 28, 2014, Noha Osman mailto:nmo_...@usc.edu>> wrote: Hi Folks Iam a new user in perl and I have two questions .Hopefully I get any help [[

Re: [R] how to find the mean and sd :(

2015-09-11 Thread Tom Wright
On Fri, 2015-09-11 at 07:48 -0700, massmatics wrote: > AM.warpbreaks<=30 The above command is not returning what you expected, what part of the AM.warpbreaks dataframe is expected to be <= 30? Effectively you are using a two stage process. 1) Create a logical vector identifying rows in the datafr

[R] Unequal column lengths

2016-04-14 Thread Tom Mosca
to do is generate a table containing mean, median, mode, standard deviation, min, max and count, all per column. Thank you, Tom Example data Dat1 Dat2 Dat3 1154 2779 3335 42 NA 5 59 NA NA [[alternative HTML version deleted

Re: [R] Problem with X11

2016-04-19 Thread Tom Wright
I don't have my debian box available so can't confirm. But I would try $apt-get install libpng On Tue, Apr 19, 2016 at 11:23 AM, Lorenzo Isella wrote: > Dear All, > I have never had this problem before. I run debian testing on my box > and I have recently update my R environment. > Now, see what

Re: [R] Finding Highest value in groups

2016-04-22 Thread Tom Wright
Assuming your dataframe is in a variable x: > require(dplyr) > x %>% group_by(ID) %>% summarise(maxVal = max(Value,na.rm=TRUE)) On Fri, 2016-04-22 at 13:51 +, Saba Sehrish via R-help wrote: > Hi > > > I have two columns in data frame. First column is based on "ID" assigned to > each grou

Re: [R] Error using RPostgreSQL

2016-04-22 Thread Tom Wright
On heroku the database uri is stored in an environment variable. > db_uri = Sys.getenv(''DATABASE_URL') I'm not sure if you can use that directly or if you will need to parse it for username, password etc. On Thu, 2016-04-21 at 16:49 +0100, Izaak Rogan wrote: > Hi, > > I'm having trouble connec

Re: [R] Removing NAs from dataframe (for use in Vioplot)

2016-04-30 Thread Tom Wright
Never let it be said there's only one way to do a thing: require(ggplot2) require(dplyr) #create a sample dataset dat <- data.frame(y1=sample(c(1:10,NA),20,replace=TRUE), y2=sample(c(1:10,NA),20,replace=TRUE), y3=sample(c(1:10,NA),20,replace=TRU

Re: [R] how to use AND in grepl

2016-04-30 Thread Tom Wright
subset(df,grepl("t2|pd",x$Command)) On Sat, Apr 30, 2016 at 2:38 PM, ch.elahe via R-help wrote: > Hi all, > > I have one factor variable in my df and I want to extract the names from > it which contain both "t2" and "pd": > > 'data.frame': 36919 obs. of 162 variables >$TE:

Re: [R] how to use AND in grepl

2016-04-30 Thread Tom Wright
$Command) On Sat, Apr 30, 2016, 7:07 PM Tom Wright wrote: > subset(df,grepl("t2|pd",x$Command)) > > > On Sat, Apr 30, 2016 at 2:38 PM, ch.elahe via R-help > wrote: > >> Hi all, >> >> I have one factor variable in my df and I want to extract the names

Re: [R] row names, coulmn names

2016-05-01 Thread Tom Wright
I think what you ask isn't ideal.Each column in a dataframe should be the same data type. While column names are stored in the first row when the df is exported to CSV, they are not stored as columns in the data frame. Instead the column names are stored as a separate attribute of the df. This is w

Re: [R] inserting row(column) in array or dataframe at specified row(column)

2016-05-01 Thread Tom Wright
If you can address your columns by name then order shouldn't matter. If the column order does matter, perhaps a matrix is a better structure to use? On Sun, May 1, 2016, 10:56 AM Jan Kacaba wrote: > Hello dear R users, > > Is there a function or package which can insert row, column or array in >

Re: [R] how to use AND in grepl

2016-05-02 Thread Tom Wright
e size is not 0. It seems that this AND does not work. > > > On Monday, May 2, 2016 5:05 AM, peter dalgaard wrote: > > On 02 May 2016, at 12:43 , ch.elahe via R-help > wrote: > > > Thanks for your reply tom. After using > Subset(df,grepl("(.*t2.*pd.*)|(.*pd.*t2.*)"

Re: [R] how to use AND in grepl

2016-05-02 Thread Tom Wright
PDT2')// I create a vector with these conditions > str_extract(df$Command,paste(v1,collaps='|')) //returning patterns, > using stringr library > > here I see no pattern named PDT2 but there are only PD and t2 patterns. > On Monday, May 2, 2016 8:18 AM, Tom Wright wro

Re: [R] how to use AND in grepl

2016-05-02 Thread Tom Wright
o change this behaviour. On Mon, May 2, 2016 at 11:01 AM, wrote: > I just changed all the names in Command to lowercase, then this > str_extract works fine for "pd" and "t2", but not for "PDT2". Do you have > any idea how I can bring PDT2 also in str_ext

Re: [R] Create a new variable and concatenation inside a "for" loop

2016-05-02 Thread Tom Wright
As pointed out somewhere in the replies to this you can always use the exists() function. for(i in 1:5){ if(exists(output)){ output <- c(output, i ) }else{ output <- i } } On Wed, Apr 27, 2016, 11:15 AM Gordon, Fabiana < fabiana.gor...@imperial.ac.uk> wrote: > Hello, > >

Re: [R] Warning when running R - can't install packages either

2016-05-12 Thread Tom Hopper
setInternet2() first thing after launching R might fix that. > On May 12, 2016, at 07:45, Alba Pompeo wrote: > > Hello. > > I've tried to run R, but I receive many warnings and can't do simple > stuff such as installing packages. > > Here's the full log when I run it. > > http://pastebin.com

[R] Euler & Runge-Kutta

2016-11-07 Thread Tom Mosca
Can someone help me with R code to perform approximations to second order differential equations and systems of first order differential equations using Euler's method and Runge-Kutta? I am not a student and this is not for a test or graded assignment. Examples (unrelated to each other): h =

[R] Partial Fraction Decomposition

2016-11-26 Thread Tom Mosca
ction decomposition of P/Q? For example: Given (3x^3+x^2-8x+6)/(x^2)(x-1)^2 Return 4/x + 6/x^2 � 1/(x-1) + 2/(x-1)^2 Thank you, Tom [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] help with durbin.watson

2008-07-27 Thread tom soyer
correlation, or is it telling me that the DW statistics is not the appropriate statistics to use here? Thanks, -- Tom [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] [lme4]Coef output with binomial lmer

2008-08-08 Thread Tom Cameron
random effect My hunch is that it refers to the Coefficients with (=TRUE) and without (=FALSE) the random effects? Any help appreciated .... Dr Tom C Cameron Genetics, Ecology and Evolution IICB, University of Lee

Re: [R] [lme4]Coef output with binomial lmer ~ nested random effects

2008-08-08 Thread Tom Cameron
Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Tom Cameron > Sent: Friday, August 08, 2008 11:47 AM > To: r-help@r-project.org; [EMAIL PROTECTED] > Subject: [R] [lme4]Coef output with binomial lmer > > Dear R users > > I have built the follow

[R] ggplot facet: change layout of panels

2008-08-23 Thread Tom Boonen
arranged nicely 5 in each row to overall the plots is a nice 5 by 5 rectangular grid. Is there any way to adjust this in gplot? Thank you very much. Best, Tom __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] font size on graphics

2009-08-19 Thread Tom Willems
Dear R users, My question is about finding the proper font size for graphics. For this i had written a code that creats 4 diferent graphics and saves them as a png file. >From these PNG.graphics , i select one of the proper size and past it to a word document. I have experimented with lots of

[R] font size on graphics question (correction in example,sorry)

2009-08-19 Thread Tom Willems
Dear R users, My question is about finding the proper font size for graphics. For this i had written a code that creats 4 diferent graphics and saves them as a png file. >From these PNG.graphics , i select one of the proper size and past it to a word document. I have experimented with lots of

Re: [R] how to rearrange a dataframe

2010-02-23 Thread Tom Short
] This creates an indexing vector that identifies which rows to swap, then the 6:4 flips around the fourth through sixth columns. - Tom On Tue, Feb 23, 2010 at 5:27 PM, Laura Rodriguez Murillo wrote: > Hi all, > > I'd appreciate if anyone can help me with this... > > I have

Re: [R] how to fast extract values from different list elements

2010-02-25 Thread Tom Short
methods. Does > anybody know an EFFICIENT or FAST way extract the values from L using the > values from A and B? Instead of L[[A[i]]][B[i]], try L[A][B] - Tom __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] dramatic speed difference in lapply

2010-02-26 Thread Tom Short
32000 4 180 [5,] 32000 5 181 [6,] 32000 6 222 > head(ret3) D Fid V1 1 32000 1 175 2 32000 2 222 3 32000 3 221 4 32000 4 134 5 32000 5 253 6 32000 6 194 - Tom On Fri, Feb 26, 2010 at 2:58 PM, Rob Forler wrote: > So I have a function that does lapply's for me

[R] Netlogit and large networks

2010-02-28 Thread Tom Brökel
or of size... MB". Is there any possibility to reduce the RAM usage of that procedure? Can I store the data differently than in an Array(), which might use too much RAM? Thanks in advance for your help. Tom -- Dr. Tom Broekel Department of Economic Geography Faculty of Geosciences Utrecht

Re: [R] data.table evaluating columns

2010-03-02 Thread Tom Short
SE] (the answer is a list, not a vector). Normally, it's easier to use [[]] or $ indexing to get this. Also, fname[i,j] <- something assignment is still a bit buggy for data.tables. - Tom Tom Short __ 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.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Calculating home ranges using mcp in adehabitat

2009-06-25 Thread Tom Mason
RY XDRY XDRY XDRY XDRY XDRY XDRY [12] XDRY XDRY XDRY XDRY XDRY XDRY XDRY XDRY Levels: XDRY > mcp(xy,id,percent=95) Error in apply(xy, 2, mean) : dim(X) must have a positive length > xy1<-xy[1:19,] > id1<-id[1:19] > mcp(xy1,id1,percent=95) Error in apply(xy, 2, mean) : dim(X) must

[R] Combine two matricies

2009-07-13 Thread Tom Liptrot
2 [3,]552 I want an automatic way of doing this as my actual application is a much larger matrix. Thanks in advance Tom _ [[elided Hotmail spam]] [[alternative HTML v

[R] Add grand mean to every entry in a matrix

2009-07-13 Thread Tom Liptrot
uch appreciated. Thanks Tom _ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

[R] Change data frame column names

2009-07-15 Thread Tom Liptrot
s) [1] TRUE names(df)<-coltitles names(df) [1] "1" "1" "1" "1" ###again not what I wanted How can I convert the column names? Thanks in advance, Tom Beyond Hotmail - see what else you can do with Windows Live. Find out more. _

Re: [R] Change data frame column names

2009-07-15 Thread Tom Liptrot
Thanks all, I used Gavins approach - unlisting the titles and the replacing names, as my titles were stored as factors in the data frame as that was the way they were imported... Tom > Subject: Re: [R] Change data frame column names > From: gavin.simp...@ucl.ac.uk > To

Re: [R] Getting file name from pdf device?

2009-08-01 Thread Tom Short
to see the embedded graphic } My use case was that plots would be inserted where I used "show" as follows: plot(sin) show()# < plot inserted into transcript here plot(cos) show("cos.png") # this time, a named local file instead of a temp file - Tom _

  1   2   3   4   5   6   7   >