Re: [R] R facets including two kinds of charts

2024-08-01 Thread phil
Thank you. That approach could work and I might use it, but a complication is that the 100 facets must be in a specified order and that order mixes charts of type A and B/C in an unsystematic way. I suppose I could write two functions, use them to create all the plots and then join them togethe

Re: [R] R facets including two kinds of charts

2024-08-01 Thread phil
Thanks for the suggestion, but this does not give me what I want. Each chart needs its own unique scale on the y-axis. Philip On 2024-08-01 15:08, Rui Barradas wrote: Às 19:01 de 01/08/2024, p...@philipsmith.ca escreveu: I am asking for help with a ggplot2 program that has facets. There are

[R] R facets including two kinds of charts

2024-08-01 Thread phil
I am asking for help with a ggplot2 program that has facets. There are actually 100 facets in my program, but in the example below I have limited the number to 3. There are two kinds of charts among the facets. One kind is a simple line plot with all of the y-values greater than zero. The facet

[R] package sare not loading and/or installing

2023-01-31 Thread Phil Smith via R-help
ne: Error in library(quantmod) : there is no package called ‘quantmod’ How do I install and load these packages successfully? Thank you! Phil Smith Sent with [Proton Mail](https://proton.me/) secure email. [[alternative HTML version deleted]] __ R

[R] getDividents() doesn't work

2022-09-20 Thread Phil Smith via R-help
Hi R-Help People! I'm using the current version of R for Ubuntu: R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid." I'm using the quantmod package and am having difficulty with the getDividends() function from the quantmod package. Here is my code: > library(quantmod) > > getDividends( "VO

Re: [R] Putting colours in ggplot facets

2021-10-26 Thread phil
Thanks for this. I was unable to install the gggrid package apparently because it is unavailable for my version of R (4.1.1 (2021-08-10)). But I found it here https://github.com/pmur002/gggrid/releases/tag/v0.1-0, copied the code into your code, and it worked very well. On 2021-10-26 19:18, Pa

Re: [R] Putting colours in ggplot facets

2021-10-25 Thread phil
Thanks for the suggestions. As it happens, I just a moment ago found a solution. By adding the lines: ct$date <- 1 and ct$vari <- 1 everything works as I want it to. Philip On 2021-10-25 22:37, Ben Tupper wrote: Hi, I don't quite follow what you want to achieve - colored backgrounds for each

[R] Putting colours in ggplot facets

2021-10-25 Thread phil
I am using ggplot2 and I want to use different colours for some facets. Here is a reprex: library(tidyverse) date <- as.numeric(c(2017,2017,2017,2017,2017,2017,2018,2018, 2018,2018,2018,2018,2019,2019,2019,2019,2019,2019)) vari <- as.numeric(c(4.8,3.3,4.2,5.2,4.8,5.7,5.4,3.1,5.7,4.1, 3.1,1.5

Re: [R] ggplot geom_line problem

2021-08-29 Thread phil
Thank you Jeff. This solves my problem. On 2021-08-28 21:54, Jeff Newmiller wrote: Maybe you will find that coord_cartesian( ylim=c(-30,30) ) works better since it doesn't filter out data before rendering. On August 28, 2021 6:45:11 PM PDT, p...@philipsmith.ca wrote: I am preparing a time serie

[R] ggplot geom_line problem

2021-08-28 Thread phil
I am preparing a time series plot using the ggplot function. It includes an area plot outlined at its edges with a line plot. For some reason the line plot, drawn with geom_line(), has some broken portions where the line does not appear, although the filled geom_area() part of the plot is shown

[R] Writing a function that calls the gt() function

2021-04-25 Thread phil
frames, I get stuck trying to blank-out the first column name and make the other column names bold. How can I refer to the columns properly in the cols_label() function in a general way? Any help much appreciated. Phil \library(gt) library(tidyverse) # Create example data frame blank <

Re: [R] R-help Digest, Vol 217, Issue 25

2021-03-25 Thread phil
Thank you, Messrs Barradas and Gross, for your very helpful advice. Philip Message: 21 Date: Wed, 24 Mar 2021 22:41:25 -0400 From: "Avi Gross" To: Subject: Re: [R] Including a ggplot call with a conditional geom in a function Message-ID: <07e801d72120$59e5c720$0db15560$@verizon.net>

[R] Including a ggplot call with a conditional geom in a function

2021-03-24 Thread phil
How can I write an R function that contains a call to ggplot within it, with one of the ggplot geom statements being conditional? In my reprex, I want the plot to contain a horizontal zero line if the y values are both positive and negative, and to exclude the horizontal line if all of the y va

Re: [R] Problem with the str_replace function

2021-03-17 Thread phil
Your help is much appreciated. I now understand what my problem was and can move forward. Philip On 2021-03-17 01:19, Hervé Pagès wrote: Hi, stringr::str_replace() treats the 2nd argument ('pattern') as a regular expression and some characters have a special meaning when they are used in a r

[R] Problem with the str_replace function

2021-03-16 Thread phil
I have a problem with the str_replace() function in the stringr package. Please refer to my reprex below. I start with a vector of strings, called x. Some of the strings contain apostrophes and brackets. I make a simple replacement as with x1, and there is no problem. I make another simple rep

Re: [R] Gradient plots in ggplot2

2021-03-09 Thread phil
Thank you for your suggestions. I found, after much experimentation, that scale_fill_gradientn did indeed provide a good solution, as below. library(ggplot2) a <- c(rep(1,6),rep(2,6),rep(3,6),rep(4,6)) b <- c(0.1, 0.5,-0.3, 1.2,-0.4,-1.2, 0.7, 0.8,-1.2,-0.5,10.0, 0.3, 0.2,-0.4,-15.

[R] Gradient plots in ggplot2

2021-03-08 Thread phil
I am having trouble with a gradient fill application in ggplot2, caused by outlier values. In my reprex, most of the values are between 2 and -2, but there are two outliers, 10 and -15. The outliers stand out well, which is good, but all the other numbers show almost no colour variation. I woul

Re: [R] Difficulty using the tryCatch() function

2021-02-07 Thread phil
Thanks so much for your speedy replies. Yes, removing those brackets did the trick. I was relying on an example in Stackoverflow at https://stackoverflow.com/questions/12193779/how-to-write-trycatch-in-r Philip On 2021-02-07 14:36, Jeff Newmiller wrote: Too many curly braces. warning and error

[R] Difficulty using the tryCatch() function

2021-02-07 Thread phil
I need help using the tryCatch function. I have a function and I want to surround it with tryCatch to catch errors and thereby avoid stopping execution of my program if the function fails. In my reproducible example below I have used a very simply function that just adds two numbers together. M

Re: [R] Showing error distributions in a point plot

2021-01-11 Thread phil
Yes, geom_violin does the trick. Thanks for your fast and useful reply, Bert. Philip On 2021-01-11 11:05, Bert Gunter wrote: Search for "violin plots" at rseek.org [1]. There is a whole package devoted to them, many packages provide them, and there is a geom_violin in ggplot2. Don't know if

[R] Showing error distributions in a point plot

2021-01-11 Thread phil
I have a point plot where the estimated points have normally distributed errors and I want to plot not just the estimated points, but also an indication of the range of uncertainty in each case. The usual way of doing this, I believe, is with geom_pointrange, as shown in my reprex. However, thi

Re: [R] Data transformation problem

2020-11-12 Thread phil
Thank you so much for this elegant solution, Jeff. Philip On 2020-11-12 02:20, Jeff Newmiller wrote: I am not a data.table afficiando, but here is how I would do it with dplyr/tidyr: library(dplyr) library(tidyr) do_per_REL <- function( DF ) { rng <- range( DF$REF1 ) # watch out for missing

[R] Data transformation problem

2020-11-11 Thread phil
I am stuck on a data transformation problem. I have a data frame, df1 in my example, with some original "levels" data. The data pertain to some variable, such as GDP, in various reference periods, REF, as estimated and released in various release periods, REL. The release periods follow after t

Re: [R] Chart will not display

2020-06-02 Thread phil
Thanks Bert. That did it. Philip On 2020-06-02 22:02, Bert Gunter wrote: In a function you must explicitly print/plot the ggplot() object, I assume. i.e. plot(ggplot(...)) etc. I do not use ggplot, so if I'm wrong, sorry. But try it. Hopefully someone else will get it right if it doesn't do

[R] Chart will not display

2020-06-02 Thread phil
I have made what must be a simple mistake, but I have not been able to find it. I create a function to plot a chart for a single variable. I want to display separate charts for several variables, one after another, with "Press [enter] to continue" in between. The function works fine for a sin

Re: [R] Duplicate names in the pivot column

2020-03-29 Thread phil
Thank you very much, Jim and Jeff. Both of your solutions work splendidly. Philip On 2020-03-29 02:25, Jim Lemon wrote: Hi Phil, Sorry it's not in the environment you are using, but perhaps this will help: taby<-table(df$y) ynames<-names(taby) for(yval in 1:length(taby)) { i

[R] Duplicate names in the pivot column

2020-03-28 Thread phil
I have a problem involving inefficient coding. My code works, but in my actual application it takes a very long time to execute. I have included a reprex here that uses the same code, but with a much smaller-scale application. The data frame I am working with (df in my reprex) is in long form

Re: [R] Plotting confidence intervals

2019-12-08 Thread phil
Thanks so much Jim. Yes, this is giving me what I want. Philip On 2019-12-08 05:00, Jim Lemon wrote: Hi Philip, This may be a starter: attach(airquality) heights <- tapply(Temp,Month,mean) temp_sd<-tapply(Temp,Month,sd) lower <- tapply(Temp,Month,function(v) t.test(v)$conf.int[1]) upper <- tap

Re: [R] Plotting confidence intervals

2019-12-08 Thread phil
Thanks for these helpful suggestions. These options don't work in my case because I don't know the individual observations (the dots). A statistical agency collects the observations and keeps them confidential. It provides the mean value and the standard deviation, plus the fact that the obser

[R] Plotting confidence intervals

2019-12-07 Thread phil
I want to show little bell curves on my bar chart to illustrate the confidence ranges. The following example from Paul Teetor's "R Cookbook" does what I want, but shows I-beams instead of bell curves. The I-beams suggest uniform, rather than normal distributions. So I am looking for a way to pl

Re: [R] " Error in firstnonmiss:lastnonmiss : argument of length 0 "

2019-10-31 Thread phil
I finally got it to work, drawing on your advice William. I extracted the time vector (REF_DATE) from the data frame (vseries) so the latter was numeric only, and I converted the resulting data frame to a matrix. I also converted the dts data frame to a matrix. Now it works properly. Your help

Re: [R] " Error in firstnonmiss:lastnonmiss : argument of length 0 "

2019-10-30 Thread phil
Thanks for your suggestions. I have tried them all, with no success. William's looked quite promising. I put in the stopifnot(is.numeric(x), NCOL(x)==1, length(x)>dt2) statement and it detected the problem: length(x) > dt2 is not TRUE Then I changed all the references to vseries to the [[j]] nota

Re: [R] " Error in firstnonmiss:lastnonmiss : argument of length 0 "

2019-10-30 Thread phil
Thanks for the suggestion Rui, but no, this will not remove the error. In fact, if I drop the second term entirely as in: if ( (!is.na(dts[1,j-1])) ) { then I still get the error. I have been unable to find a work-around. Philip On 2019-10-30 05:17, Rui Barradas wrote: Hello, Is this as si

[R] " Error in firstnonmiss:lastnonmiss : argument of length 0 "

2019-10-29 Thread phil
I am having a problem that generates the error message: " Error in firstnonmiss:lastnonmiss : argument of length 0 ". There is an article on this in stackoverflow, but I have been unable to understand it well enough to solve my problem. Essentially, I have a data frame with 41 indicator series

Re: [R] Colouring selected columns in a facetted column chart

2019-08-25 Thread phil
.1, 0.3, 1.1, 0.4, 0.2, 0.1, 0, 0.6, 0.6, 0.8, 0.7, 0.7, 0.7, 0.2, 0.2, 0.3, 0.4, 0.3, 0.2, 0.4, 1.2, 0.6, 0.9, 0.7, 0.1, 0.4, -0.1, 0.2, 0.4, -0.1, 0.9, 0.2, 1.1, 1.2, 1.1, 1, 0.4, 0.7, 1, 1.2, 0.3, 0.5, 0.6, 0.4, 0.4, 0.4, 0.2, 0, -0.1, -0.1, 0.1, 0, 0.2, 0.9, 0.4, 0.7, 0.3

Re: [R] Colouring selected columns in a facetted column chart

2019-08-24 Thread phil
, 0.4, 0.3, 0.2, 0.4, 1.2, 0.6, 0.9, 0.7, 0.1, 0.4, -0.1, 0.2, 0.4, -0.1, 0.9, 0.2, 1.1, 1.2, 1.1, 1, 0.4, 0.7, 1, 1.2, 0.3, 0.5, 0.6, 0.4, 0.4, 0.4, 0.2, 0, -0.1, -0.1, 0.1, 0, 0.2, 0.9, 0.4, 0.7, 0.3, -0.1, 0.4, -0.5, 0.4, 0.7, 0.4, 0.8, 0.9, 0.5, 1.5, -0.1, 1, 0.6, 0.5, 0.9, -0

[R] Colouring selected columns in a facetted column chart

2019-08-24 Thread phil
I am having difficulty with a chart using ggplot. It is a facetted column chart showing GDP growth rates by country. The columns are coloured navyblue, except that I want to colour the most recent columns, for 2019-Q1 and 2019-Q2, red. For some countries data are available up to 2019-Q2 while f

[R] [R-pkgs] Update for R package KScorrect for K-S goodness-of-fit tests

2019-07-05 Thread Phil Novack-Gottshall
k-gottshall/KScorrect. We hope you find the functions useful when conducting goodness-of-fit tests using the K-S test. Sincerely, Phil Novack-Gottshall and Steve Wang -- ~~~~~ Phil Novack-Gottshall Associate Professor Department of Biological S

Re: [R] Colour for unique label with ggplot

2019-06-20 Thread phil
Thank you so much Eric. I had tried searching stackoverflow too, but I could not find the right way to word the query. Philip On 2019-06-20 04:03, Eric Berger wrote: Hi Phil, Try this library(tidyverse) # Test data dta <- data.frame(dta_names=c("Series 1","Series 2&quo

[R] Colour for unique label with ggplot

2019-06-19 Thread phil
# RStudio version 1.1.463 # sessionInfo() # R version 3.5.1 (2018-07-02) # Platform: x86_64-apple-darwin15.6.0 (64-bit) # Running under: macOS 10.14.5 # I am constructing a bar chart using ggplot, as in the example below. # I want to highlight "Series 2" by colouring the bar red, # with the othe

Re: [R] Tidyverse data frame conversion from monthly to annual

2019-03-03 Thread phil
summarise_all() does the trick. Thanks very much for the help. Philip On 2019-03-03 22:14, p...@philipsmith.ca wrote: I have a data frame in which the first column is a sequence of monthly dates and the other columns are variables. There are a great many variables. I want to create another data

[R] Tidyverse data frame conversion from monthly to annual

2019-03-03 Thread phil
I have a data frame in which the first column is a sequence of monthly dates and the other columns are variables. There are a great many variables. I want to create another data frame similar to the first one, but with annual values instead of monthly, created by summing the months within each

Re: [R] Plotting quarterly time series

2018-01-29 Thread phil
Gentlemen, Thank you so much for your help. You have solved my problem. > Using Achim's d this also works to generate z where FUN is a function used > to transform the index column and format is also passed to FUN. > > z <- read.zoo(d, index = "time", FUN = as.yearqtr, format = "Q%q %Y") > > On S

[R] Plotting quarterly time series

2018-01-28 Thread phil
I have a data set with quarterly time series for several variables. The time index is recorded in column 1 of the dataframe as a character vector "Q1 1961", "Q2 1961","Q3 1961", "Q4 1961", "Q1 1962", etc. I want to produce line plots with ggplot2, but it seems I need to convert the time index from

Re: [R] Wrong results from anova

2015-04-14 Thread Phil Spector
1 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 summary(fit.Y) Df Sum Sq Mean Sq F valuePr(>F) sample.Y 3 2202.70 734.23 190706 < 2.2e-16 *** Residuals80.030.00 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Re: [R] DIF

2014-12-10 Thread Phil Chalmers
As well, the mirt package contains a function for DIF using likelihood ratio tests via multiple-group estimation methods (the multiple group estimation generally goes beyond simply testing for DIF), as well Wald tests if the information matrix was computed. Hope that helps. Phil On Wednesday

Re: [R] {car} outlierTest looses p/q values

2014-10-21 Thread Phil
6.0306110 6.4618792 7.1932613 7.7595619 x4 x6 7.8394477 9.9437848 As you see the glm calculates residuals for x82 (which is in fact 1.314) but the outlierTest does not assign a p/q value to it. Does anyone know why? Thanks in advance, Phil On 10/17/2014 08:54 PM, John

[R] {car} outlierTest looses p/q values

2014-10-17 Thread Phil
ached): [1] colorspace_1.2-4 compiler_3.1.1 digest_0.6.4 grid_3.1.1 [5] gtable_0.1.2 labeling_0.3 MASS_7.3-33 munsell_0.4.2 [9] nnet_7.3-8 plyr_1.8.1 proto_0.3-10 Rcpp_0.11.2 [13] reshape2_1.4 scales_0.2.4 stringr_0.6.2tools_3.1.1 Any help is highly appreciated. T

Re: [R] Plot regression results with various predictors.

2014-05-29 Thread phil
Thanks a lot for your input. -- View this message in context: http://r.789695.n4.nabble.com/Plot-regression-results-with-various-predictors-tp4691307p4691416.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] Plot regression results with various predictors.

2014-05-28 Thread phil
Sorry for not explaining it further. plm() is the regression command for panel data, i.e., similar to lm() for simple linear regressions. I run the plm() and get an output which I call here POLS. Next I simply use plot(POLS) which looks like

[R] Plot regression results with various predictors.

2014-05-27 Thread phil
plot=(POLS) adding further the regression line to illustrate the results graphically. Any help is highly appreciated. Thanks in advance. Phil -- View this message in context: http://r.789695.n4.nabble.com/Plot-regression-results-with-various-predictors-tp4691307.html Sent from the R help

[R] panel data: variable selection AND multicollinearity

2014-05-03 Thread phil
)" of the car-package. What is the respective command for regression on panel data? Help is really appreciated. Looking forward to your answers. Thank you very much in advance. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/panel-data-variable-selection-AN

Re: [R] Tobit model with panel data

2014-05-01 Thread phil
n dependent and independent variable(s) is not adequate. Haven't thought about that... I think you will see it the same way. Thanks in advance. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Tobit-model-with-panel-data-tp4689760p4689847.html Sent from the R help

Re: [R] Tobit model with panel data

2014-05-01 Thread phil
Hi Arne, thanks a lot for your reply, it was really helpful! Now, after having managed to apply the censReg to my data, I get the following error message when I enter the command "summary()": Error in printCoefmat(coef(x, logSigma = logSigma), digits = digits) : 'x' must be coefficient matrix

[R] Tobit model with panel data

2014-04-30 Thread phil
Hi all, I just started to work with R a couple of weeks ago. Right now I would like to regress an independent variable on a couple of explanatory variables. The dependent variable is left censored in the sense that all negative values and zero are set equal to one. This is done because I want to t

Re: [R] Capturing output of a C executable

2014-02-03 Thread Phil Spector
://www.stat.berkeley.edu/classes/s243/calling.pdf - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

[R] coxph with time-dependent covariates

2014-01-13 Thread Phil Stevenson
event due to the missing time-dependent covariate at day 6. Is there a way I can keep this event without filling in a covariate value at day 6? -Phil [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] Extracting Numeric Columns from Data Fram

2013-02-16 Thread Phil Spector
Barry = Suppose your data frame is called "mydat". Then something like mydat[,sapply(mydat,class) %in% c('numeric','integer')] might do what you want. - Phil On Sat, 16 Feb 2013, Barry DeCicco wrote:

Re: [R] help with calculation from dataframe with multiple entries per sample

2012-09-17 Thread Phil Spector
pecial characters like dashes in variable names. Hope this helps. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] How to adjust the start of a series to zero? (i.e. subtract the first value from the sequence)

2012-06-30 Thread Phil Spector
your data. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.be

Re: [R] need help reshaping table using aggregate

2012-06-20 Thread Phil Spector
Tim - Another approach to your problem is to use xtabs: xtabs(count~site+bug,data=myf) bug site grasshopper ladybug spider stinkbug A 4 0 20 B 0 6 08 - Phil Spector

Re: [R] Using Sub

2012-06-19 Thread Phil Hurvitz
Possibly overkill, I use a Windows batch file that calls a perl script. Both the bat and pl files need to be in the executable path. Open a command prompt, type `pwd ' and then drag the file or folder from the Windows Explorer to the cmd. The script will return the file with backslashes convert

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Phil Spector
et 25 rows.) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

[R] Round down to earliest hour or half hour

2012-06-08 Thread Phil Hurvitz
I wanted to round rather than truncate timestamps # create a data set to work with s <- 30 * rnorm(10, 1, 0.1) gps.timestamp <- Sys.time() + s*1:10 gps.timestamp <- c(round(gps.timestamp[1], "min"), gps.timestamp, as.POSIXct("2012-06-08 17:32:59"), as.POSIXct("2012-06-08 17:32:30")) f <- funct

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
Iain - Do you see the same behaviour if you use z <- unz(pathToZip, 'x.txt') instead of z <- unz(pathToZip, 'x.txt','r') - Phil Spector

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
#x27;t reproduce the exact error which you saw.) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] SAS Import with sas.get {Hmisc} - status 127 error

2012-03-28 Thread Phil Spector
I've found the keep,log=TRUE option of sas.get to be useful in cases like this. There's also a log.file= option if you don't want the default location for the log file. - Phil Spector Statistical Com

Re: [R] obtaining a true/false vector with combination of strsplit, length, unlist,

2012-02-11 Thread Phil Spector
It sounds like the problem boils down to counting the number of "_"s in the WELLID variable, and seeing if there are two: nchar(gsub('[^_]','',edm$WELLID)) == 2 [1] FALSE FALSE TRUE TRUE TRUE TRUE FALSE

Re: [R] apply pairs function to multiple columns in a data frame

2012-02-10 Thread Phil Spector
reproducible example goes a long way towards getting a good answer. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Rearanging Data

2012-02-09 Thread Phil Spector
Try sub <- subset(Claims, Year==Y1) In R, the equality test is performed by two equal signs, not one. - Phil Spector Statistical Computing Facility Department

Re: [R] Subsetting for the ten highest values by group in a dataframe

2012-01-27 Thread Phil Spector
sing=TRUE)[1:10],]) should give you what you want. In this simple case, you could also use do.call(rbind,by(df,df$z,function(dat)dat[order(dat$x,decreasing=TRUE)[1:10],])) from base R to get the same result. Hope this helps.

Re: [R] Using !is.na() in a HAVING clause in sqldf() XXXX

2012-01-17 Thread Phil Spector
Dan - Try using "having Premie not null" instead of "having !is.na(Premie)" . - Phil Spector Statistical Computing Facility Depa

[R] Difference across the Nth dimension of an array

2012-01-08 Thread Phil Wiles
thought was thorough) search. Thanks in advance, Phil. [[alternative HTML version deleted]] __ 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-gu

[R] OPeNDAP access with R

2011-12-13 Thread Phil Wiles
ommon requirement, particularly among earth scientists - perhaps they are all still using Matlab. Does anyone have have a solution? Or maybe I am just not proficient enough at finding solutions on the R-network... Thanks in advance for your time, Phil. [[alternative HTML version de

[R] Combining Venn Diagrams

2011-08-15 Thread Phil Schnarrs
Hi All, Is there anyway to combine vennDiagrams with venneuler commands so I can have both of the diagrams as one? venneuler gives me proportionate circles but without numbers and veenDiagrams gives me numbers without proportionate circles. Thanks, Phil [[alternative HTML version

[R] rJava and error messages

2011-08-15 Thread Phil Schnarrs
r 'rJava' Can anyone help? Thanks, Phil [[alternative HTML version deleted]] __ 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.h

[R] Venn Diagrams

2011-08-15 Thread Phil Schnarrs
Hello All, I am currently using the vennDiagram function in the limma pkg to construct venn diagrams. I would like to change the size of the circles based upon the n of each set (if that makes sense). Does anyone have any ideas of how to do this? Thanks, Phil [[alternative HTML

Re: [R] Deleting rows and store the deleted rows in new data frame

2011-07-24 Thread Phil Spector
There's no need to use sapply or loops with grep -- it's already vectorized. So you can find the rows you're interested in with wh = grep('^[.,]+$',df[,9]) store them with sf = df[wh,] and delete them with df = df[-wh,]

Re: [R] list.files recursively to find files in a specific way...

2011-07-19 Thread Phil Spector
e=TRUE) should give you what you want. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] cbind 3 or more matrices

2011-06-04 Thread Phil Spector
[,7] [,8][,9] [1,] -1.7481451 0.4467964 -0.41358420 [2,] -0.2882922 1.0243662 -0.48263684 [3,] 0.9402479 0.5467952 -0.01922035 [4,] 0.6795783 1.4560765 -0.23013826 [5,] 0.9800312 -1.3462175 -0.77064872 - Phil Spector

Re: [R] how to combine two data frames via factors (or somehow else)

2011-05-29 Thread Phil Spector
Philipp - I believe you're looking for the merge function. If you need more guidance, please provide a meaningful reproducible example. - Phil Spector Statistical Computing Fac

Re: [R] Oddity: I seem to have a variable in a dataframe that doesn't show in colnames() - can anyone advise?

2011-05-29 Thread Phil Spector
'PHQ'] Error in `[.data.frame`(x, , "PHQ") : undefined columns selected x[['PHQ']] NULL So if you don't want this "feature", you can use brackets instead of the dollar sign for extraction.

Re: [R] Installing package rgdal

2011-05-28 Thread Phil Spector
s. Hope this helps. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.b

Re: [R] Arrange a multi-level list to a one-level list

2011-05-27 Thread Phil Spector
00 [2,]10 [[2]] [,1] [,2] [1,]32 [2,]32 [[3]] [,1] [,2] [,3] [1,]101 [2,]010 [[4]] [,1] [,2] [,3] [1,]222 [2,]223 - Phil Spec

Re: [R] Count of rows while looping through data

2011-05-27 Thread Phil Spector
reproducible example. - Phil On Fri, 27 May 2011, Jeanna wrote: I may have prematurely excited... I ended up using the split method since my family indicators are alphanumeric so my issue is as follows. I'm applying this to different subsets of my

Re: [R] Applying "toupper" to only portions of text strings

2011-05-26 Thread Phil Spector
27;,'\\U\\1\\2\\L\\3',TEXT,perl=TRUE) [1] "" "BBB|cc" "|ddd" - Phil Spector Statistical Computing Facility

Re: [R] Trouble Combining With Paste

2011-05-25 Thread Phil Spector
John - Try infert[,toolong] = sapply(infert[,toolong],cut2,g=10,levels.mean=TRUE) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Count of rows while looping through data

2011-05-24 Thread Phil Spector
= subset(x,seq == use) Hope this helps. Take a look at the help page for the ave function to understand how it works. - Phil Spector Statistical Computing Facility

Re: [R] Extracting day of month from Date objects

2011-05-24 Thread Phil Spector
< 10 < 11 < 12 < 13 < ... < 31 Notice that it returns the days as factors. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Multiple count if style "queries"

2011-05-20 Thread Phil Spector
1 1 result[['Biak-Numfoor rain forests']]$Genus Bromheadia Homalomena 1 1 Hope this helps. - Phil Spector Statistical Computing Facility

Re: [R] trouble with summary tables with several variables using aggregate function

2011-05-19 Thread Phil Spector
1 S1 T1 2 2 2 S2 T1 2 2 3 S1 T2 2 2 7 S2 T2 NA 4 - Phil Spector Statistical Computing Facility

Re: [R] File to MYSQL

2011-05-16 Thread Phil Spector
t of the final query. You might also familiarize yourself with dbGetQuery, which may be more suited to your needs. - Phil Spector Statistical Computing Facility Depar

Re: [R] Creating dataframes

2011-05-13 Thread Phil Spector
with the data frames you're creating. - Phil On Fri, 13 May 2011, Woida71 wrote: I would like to create a certain number of dataframes out of one dataframe where each of the dataframes is related to a factor. This should be possible with

Re: [R] about vector to the power of a decimal

2011-05-12 Thread Phil Spector
lex number (-2)^2.1 [1] NaN complex(real=-2)^2.1 [1] 4.077269+1.324785i - Phil Spector Statistical Computing Facility Department of

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread Phil Spector
John - In your example, the misclassified observations (as defined by your predict.function) will be kyphosis[kyphosis$Kyphosis == 'absent' & prediction[,1] != 1,] so you could start from there.

Re: [R] help with mysql and R: partitioning by quintile

2011-05-08 Thread Phil Spector
One way to get the ratings would be to use the ave() function: rating = ave(x$freq,x$track, FUN=function(x)cut(x,quantile(x,(0:5)/5),include.lowest=TRUE)) - Phil Spector Statistical Computing Facility

Re: [R] simulate AR(1) process

2011-05-05 Thread Phil Spector
?arima.sim - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Help converting a data.frame to ordered factors

2011-05-02 Thread Phil Spector
creating the 96x34 array, there might be a better solution. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Regression Summary for a List

2011-04-29 Thread Phil Spector
Ryan - summary expects an lm object, and fit is a list. So you need to use something like lapply(fit,summary) to pass each list element to the summary function. - Phil Spector Statistical Computing Facility

Re: [R] How to define specially nested functions

2011-04-28 Thread Phil Spector
Here's one possibility: funmaker = function(x,y,z)function(z)x + y + (x^2 - z) uniroot(funmaker(1,3,z),c(0,10))$root [1] 5 uniroot(funmaker(5,2,z),c(30,40))$root [1] 32 (The third argument to the function doesn't really do anything.) - Ph

  1   2   3   4   5   >