[R] De-serialization vulnerability?

2024-05-01 Thread Howard, Tim G (DEC) via R-help
he release info. Thanks, Tim __ 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-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] Missing shapes in legend with scale_shape_manual

2023-10-31 Thread Howard, Tim G (DEC) via R-help
) + geom_hline(yintercept = 130) + scale_shape_manual(name = "Conditions", labels = c("Missed meds", "Missed exercise"), values = c(20, 4) ) Note that this method then gets very close wi

Re: [R] win110 + R 4.3.0 dowload only when method = "wininet"

2023-05-12 Thread Howard, Tim G (DEC) via R-help
e bug and the patch. https://bugs.r-project.org/show_bug.cgi?id=18379 If you are in this situation, the fix is to add a new User Environment Variable: R_LIBCURL_SSL_REVOKE_BEST_EFFORT and set it to TRUE Tim >>>>>> Date: Thu, 11 May 2023 09:39:25 +0300 From: Ivan Krylov

Re: [R] Regex Split?

2023-05-05 Thread Howard, Tim G (DEC) via R-help
If you only want the character strings, this seems a little simpler: > strsplit("a bc,def, adef ,,gh", "[ ,]+", perl=T) [[1]] [1] "a""bc" "def" "adef" "gh" If you need delime

Re: [R] R version 4.2.1 install.packages does not work with IE proxy setting

2022-10-06 Thread Howard, Tim G (DEC) via R-help
in R-4.2.1 Patched (I don't know if it has made it out to the full distribution) and works in my 'corporate' environment. Perhaps it also applies to your environment. Tim Date: Wed, 5 Oct 2022 10:34:02 + From: PIKAL Petr To: Ivan Krylov Cc: r-help mailing list Subj

[R] Formula compared to call within model call

2021-08-11 Thread Tim Taylor
Manipulating formulas within different models I notice the following: m1 <- lm(formula = hp ~ cyl, data = mtcars) m2 <- update(m1, formula. = hp ~ cyl) all.equal(m1, m2) #> [1] TRUE identical(m1, m2) #> [1] FALSE waldo::compare(m1, m2) #> `old$call[[2]]` is a call #> `new$call[[2]]` is an S3 objec

[R] Potential Bug: file.show does not support double-byte characters in the file path

2021-06-17 Thread Tim via R-help
ers if the file paths do not. For example, the content for "C:\Test\test.txt" can be "Testing 123 测试". file.show("C:\\Test\\test.txt") would open this file and display its content correctly without specifying the encoding parameter. Thanks, Tim [[alternative H

[R] [R-pkgs] weibulltools version 2.0.0 released on CRAN

2021-01-14 Thread Hensel, Tim-Gunnar
. The previously used vector-based approach has been largely preserved but is no longer recommended. Examples for the usage of the new interface, the documentation of all functions, as well as further changes can be found at https://tim-tu.github.io/weibulltools/ If you notice a bug

Re: [R] understanding as.list(substitute(...()))

2020-10-06 Thread Tim Taylor
Cheers Denes, That's useful to know. I'll stick with the match.call version instead. Interestingly I initially tried to post to R-devel (as I thought it may involve something internal) but was asked to post here instead. Best Tim On Tue, 6 Oct 2020 at 08:22, Dénes Tóth wrote:

Re: [R] understanding as.list(substitute(...()))

2020-10-05 Thread Tim Taylor
. dots <- function (...) { exprs <- substitute(list(...)) as.list(exprs[-1]) } In the original, dots <- function(...) as.list(substitute(...())), Does ...() get parsed in a special way? Tim On Tue, 6 Oct 2020 at 05:30, Bert Gunter wrote: > > You need to understand

[R] understanding as.list(substitute(...()))

2020-10-05 Thread Tim Taylor
Could someone explain what is happening with the ...() of the following function: dots <- function(...) as.list(substitute(...())) I understand what I'm getting as a result but not why. ?dots and ?substitute leave me none the wiser. reg

[R] Compositional Data Analysis

2020-07-22 Thread Tim Locke
Hi All, I am currently working on a project examining the health effects of physical activity using a compositional data (CoDa) approach. I am using a linear regression to measure the effect of physical activity. What I want to do is predict an outcome, e.g. body mass index, based on the mean phys

Re: [R] project path in Rmd (Ivan Calandra)

2020-04-02 Thread Howard, Tim G (DEC) via R-help
You also should be able to reference locations from the 'root' of your project using the here() package. https://here.r-lib.org/ Best, Tim Howard > Date: Thu, 2 Apr 2020 10:21:47 +0100 > From: Rui Barradas > To: Ivan Calandra > Cc: "r-help@r-project.org&qu

Re: [R] substr gives empty output

2018-01-22 Thread Howard, Tim G (DEC)
In y <- substr(x, i, 1) your third integer needs to be the location not the number of digits, so change it to y <- substr(x, i, i) and you should get what you want. Cheers, Tim > Date: Sun, 21 Jan 2018 10:50:31 -0500 > From: Ek Esawi > To: Luigi Marongiu , r-hel

[R] Interesting behavior of lm() with small, problematic data sets

2017-09-05 Thread Glover, Tim
perfect fit, but a p-value of 0.3112 doesn’t seem reasonable. As a side note, the various r^2 values seem odd too. Tim Glover Senior Scientist II (Geochemistry, Statistics), Americas - Environment & Infrastructure, Amec Foster Wheeler 271 Mill Road, Chelmsford, Massachusetts, USA 01824-4105 T

Re: [R] CRAN I-MR / Xbar-R / Xbar-S control chart package ?

2017-07-09 Thread Tim Smith
Interesting, thanks for that. I came accross qcc but my quick scan of the docs is that it only did xbars but maybe I need to re-read the docs, I guess it does the individual plot versions (I-MR) too. Tim On 8 July 2017 at 20:53, Rui Barradas wrote: > Hello, > > I have no experience

[R] CRAN I-MR / Xbar-R / Xbar-S control chart package ?

2017-07-08 Thread Tim Smith
Hi, I've had a quick look through the package list, and unless I've missed something, I can't seem to find anything that will do I-MR / Xbar-R / Xbar-S control charts ? Assuming there is something out there, can anyone point me in the right direction ?

[R] [R-pkgs] CRAN updates: rpg and odeintr

2017-02-20 Thread Tim Keitt
rpg is a package for working with postgresql: https://github.com/thk686/rpg odeintr is a package for integrating differential equations: https://github.com/thk686/odeintr Cheers, THK http://www.keittlab.org/ [[alternative HTML version deleted]] __

[R] Problem installing/loading packages from Africa

2016-04-22 Thread Tim Werwie
insight would be very helpful. See error messages below. Thanks -- Tim - When attempting to install, the print-out I get in the Console in RStudio is any length of: > install.packages("swirl") % Total% Received % Xferd Average Speed TimeTime Time Current

Re: [R] How to conduct a PERMANOVA using a dissimilarity matrix

2015-12-23 Thread Tim Richter-Heitmann
O", "0.479", "0.399", "0.374", "0.348", "0.354", "0.365", "0.371", "0"), .Dim = c(9L, 9L), .Dimnames = list(NULL, c("V1", "V2", "V3", "V4", "V5", "V6", "V

[R] Regular R freezes

2015-12-22 Thread Tim Richter-Heitmann
hooting or finding out who the culprit is? Thanks. -- Tim Richter-Heitmann (M.Sc.) PhD Candidate International Max-Planck Research School for Marine Microbiology University of Bremen Microbial Ecophysiology Group (AG Friedrich) FB02 - Biologie/Chemie Leobener Straße (NW2 A2130) D-28359 Bremen Tel.:

Re: [R] How to find out if two cells in a dataframe belong to the same pre-specified factor-level

2015-09-29 Thread Tim Richter-Heitmann
r all groups specifically in the x,y-scatterplot. Thus, i need an R translation for: final$group <- If (final$Var1 and final$Var2) belong to the same group as specified in species, then assign the species group here, else do nothing or assign NA

[R] Download showing as exploit

2015-09-21 Thread Tim Kingston
Hi , I work for the NHS, and our IT service has been unable to download as its anti-virus software says it contains an exploit. Is this normal? Is there a way around this? Kind regards, Tim Kingston Sent from my HTC [[alternative HTML version deleted

Re: [R] Cross correlation between two time series over nested time periods?

2015-05-14 Thread Tim via R-help
ation between two time series over nested time periods? Date: Thursday, May 14, 2015, 6:14 AM On 2015-05-14 , at 02:11, Tim via R-help wrote: Hello Tim, Re: > I have two time series > > > Calculate and plot cross correlation between two time series over nested time pe

[R] Cross correlation between two time series over nested time periods?

2015-05-13 Thread Tim via R-help
maximum lag), and plot A and B in a single plot? Thanks and regards, Tim __ 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-project.org/posting

Re: [R] Split a dataframe by rownames and/or colnames

2015-02-23 Thread Tim Richter-Heitmann
rom list2env? Thank you very much! Thanks, On 20.02.2015 20:36, David Winsemius wrote: On Feb 20, 2015, at 9:33 AM, Tim Richter-Heitmann wrote: Dear List, Consider this example df <- data.frame(matrix(rnorm(9*9), ncol=9)) names(df) <- c("c_1", "d_1", "e_

[R] Split a dataframe by rownames and/or colnames

2015-02-20 Thread Tim Richter-Heitmann
"_")), envir=.GlobalEnv) However, i changed my mind and want to do it now by rownames. Exchanging colnames with rownames does not work, it gives the exact same output (9 rows x 3 columns). I could do as.data.frame(t(df_x), but maybe that is not elegant. What would be the solution for spli

[R] read.table with missing data and consecutive delimiters

2015-02-11 Thread Tim Victor
34 22 NA NA5 3 NA NA NA6 What am I missing? Thanks, Tim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

[R] Network graph google maps‏

2014-12-16 Thread Tim de Wolf
al? Any help is much appreciated! Tim [[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 th

[R] rtmvnorm {tmvtnorm} seems broken

2014-12-09 Thread Tim Benham
General linear constraints don't seem to work. I get an error message if I have more constraint equations than variables. E.g. executing the following code print(R.version) library('tmvtnorm') cat('tmvtnorm version ') print(packageVersion('tmvtnorm')) ## Let's constrain our sample to the dwarfed h

[R] Creating submatrices from a dataframe, depending on factors in sample names

2014-12-01 Thread Tim Richter-Heitmann
df[temp, temp] }) unique_values <- lapply(sub.matrices, function(x) x[upper.tri(x)]) names(unique_values) <- unique(indx) This code needs to be expanded to form sub.matrices for any combination of unique indices in temp. Thank you so much! -- Tim Richter-H

[R] big datasets for R

2014-10-28 Thread Tim Hoolihan
Another source of large datasets is the Public Data Sets on AWS http://aws.amazon.com/public-data-sets/ Tim Hoolihan @thoolihan http://linkedin.com/in/timhoolihan On Oct 28, 2014, at 7:00 AM, r-help-requ...@r-project.org wrote: > -- > > Message: 2 > D

Re: [R] How can I overwrite a method in R?

2014-10-09 Thread Tim Hesterberg
thz.ch > > Subject: Re: [R] How can I overwrite a method in R? > > > > This is usually ill-advised, but I think it's the right solution for > > your problem: > > > > assignInNamespace("plot.histogram", function(...) plot(1:10), "graphics") > > hi

[R] [vegan] Error in as.vector(x, mode) : , cannot coerce type 'builtin' to vector of type 'any' when performing anova on CCA objects

2014-10-09 Thread Tim Richter-Heitmann
his could happen? I am sorry for not providing data for reproduction, as the data sets are pretty large. -- Tim Richter-Heitmann (M.Sc.) PhD Candidate International Max-Planck Research School for Marine Microbiology University of Bremen Microbial Ecophysiology Group (AG Friedrich) FB02 - Biolog

[R] How can I overwrite a method in R?

2014-10-08 Thread Tim Hesterberg
How can I create an improved version of a method in R, and have it be used? Short version: I think plot.histogram has a bug, and I'd like to try a version with a fix. But when I call hist(), my fixed version doesn't get used. Long version: hist() calls plot() which calls plot.histogram() which fa

[R] gplot heatmaps: clustering according to rowsidecolors + key.xtickfun

2014-09-04 Thread Tim Richter-Heitmann
.9), seq(82.0,86.4), seq(86.5, 94.5), seq(94.5,100.0)) Is it possible to pass this sequential ordering to key.xtickfun? May i ask for an example code? Thank you very much! -- Tim Richter-Heitmann (M.Sc.) PhD Candidate International Max-Planck Research School for Marine Microbiolo

[R] [vegan]Envfit, pvalues and ggplot2

2014-08-11 Thread Tim Richter-Heitmann
The list contains a vector called $pval containing the pvalues. So, i need to reduce the list created by envfit to rows meeting a criterion in $pval (via "unlist" and "which", i suppose). However, i have difficulties to work out the correct code. Any help is much appr

[R] problem with labeling plots, possibly in font defaults

2014-08-07 Thread Tim Blass
Hello, I am using R 3.1.1 on a (four year old) MacBook, running OSX 10.9.4. I just tried making and labeling a plot as follows: > x<-rnorm(10) > y<-rnorm(10) > plot(x,y) > title(main="random points") which produces a scatter plot of the random points, but without the title and without any numbe

[R] Problems with read.table and data structure

2014-07-11 Thread Tim Richter-Heitmann
ld need the levels, though! I suspect excel to mess up the "save as tab-delimited text", but the text file seems fine with me on surface (i dont know how the numbers are stored internally). I just see correct numbers, also the View command yields the correct content. Anyone knows he

[R] x,y scatterplots, with averaging by a column

2014-06-30 Thread Tim Richter-Heitmann
with lines. Also of interest would be annotating the whispers with their sample ID (because the whiskers basically represent the values for y1,2 (11,12; 21,22)). Any help is welcome! I am new to R, so please bear with me. Thank you! -- Tim Richter-Heitmann (M.Sc.) PhD Candidate International

[R] Large matrices and pairs/ggpairs

2014-05-20 Thread Tim Richter-Heitmann
lly my questions are not too stupid. -- Tim Richter-Heitmann (M.Sc.) PhD Candidate International Max-Planck Research School for Marine Microbiology University of Bremen Microbial Ecophysiology Group (AG Friedrich) FB02 - Biologie/Chemie Leobener Straße (NW2 A2130) D-28359 Bremen Tel.: 0049(0)421

Re: [R] ggplot2: using coord_trans for logit -> probability

2014-04-16 Thread Tim Marcella
Sorry I jumped the gun. That does not provide you with the same plot as gg2 that you are aiming for. -T On Wed, Apr 16, 2014 at 7:37 PM, Tim Marcella wrote: > I think all you have to do is add type="response" to your call for the > predictions. > > Does this work fo

Re: [R] ggplot2: using coord_trans for logit -> probability

2014-04-16 Thread Tim Marcella
brary(scales) # plot on logit scale gg <- ggplot(pred, aes(x=Age, y=fit)) + geom_line(size = 2) + theme_bw() + geom_ribbon(aes(ymin = fit - 1.96 * se.fit, ymax = fit + 1.96 * se.fit,), alpha = 0.2, color = "transparent") + labs(x = "Age", y = "Log odds

[R] Plot mlogit object

2014-04-14 Thread Tim Marcella
Hi, I cannot figure out how or if I even can plot the results from a nested multinomial logit model. I am using the mlogit package. Does anyone have a lead on any tutorials? Both of the vignettes are lacking plotting instructions. Thanks, Tim -- Tim Marcella [[alternative HTML

[R] Time interactions for coxph object

2014-04-07 Thread Tim Marcella
ic formula CSHR.shore.fly <- coxph(Surv(entry, exit, to == 1) ~ shore.cat, data glba.mod) My variable shore.cat is violating the proportional hazards assumption so I am trying to add in an interaction with time. Do I interact exit? entry? or the range of the two? Thanks, Tim -- Tim Marcella

[R] Nested Logit Model

2014-04-03 Thread Tim Marcella
fferent modeling approach? I am mainly interested in the probability of choosing to react (fly or dive) or not, and then once a reaction has been made, which one is chosen and how these decisions relate to perpendicular distance to the ship's pat

[R] multicore - handling a list of return values

2014-03-18 Thread Tim Smith
Hi, I was trying to gather/combine the results returned from the mclapply function. This is how I do it if only one data object is returned: #= This works fine === library(multicore) frandom1 <- function(iter,var1 = 3,var2 =2){     mat <- matrix(rnorm(var1*var2),nrow=var1,ncol=var2)  

[R] Coding for segmented regression within a hurdle model

2014-03-15 Thread Tim Marcella
? If no then I guess I would not have to worry about this and can just report the original std.errors and associated p values from the segemented object in the pub. Question # 2: If the count model uses the std.errors, how can I reformulate this equation to generate the original std.errors. Thanks,

[R] Negative binomial models and censored observations

2014-03-13 Thread Tim Marcella
this be accounted for in the hurdle() function? Thanks, Tim [[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

[R] Calculating RMSE in R from hurdle regression object

2014-03-12 Thread Tim Marcella
Hi, My data is characterized by many zeros (82%) and overdispersion. I have chosen to model with hurdle regression (pscl package) with a negative binomial distribution for the count data. In an effort to validate the model I would like to calculate the RMSE of the predicted vs. the observed values

[R] ifelse...

2014-01-16 Thread Tim Smith
Hi, Sorry for the newbie question! My code: x <- 'a' ifelse(x == 'a',y <- 1, y <- 2) print(y) Shouldn't this assign a value of 1? When I execute this I get: > x <- 'a' > ifelse(x == 'a',y <- 1, y <- 2) [1] 1 > print(y) [1] 2 Am I doing something really daft??? thanks! > sessionInfo() R ve

[R] set new path for package installation, because In normalizePath(path.expand(path), winslash, mustWork) :

2014-01-15 Thread Tim Richter-Heitmann
, a few users having this problem: Whenever i am starting R, i am welcomed with: "Warning message: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="//x/home$/tim/Documents/R/win-library/3.0": Access is denied" And i am not allowed to install packages or mani

Re: [R] Append text to panels of lattice::barchart()

2013-11-26 Thread Tim Sippel
looking for. I'll look into trellis.focus to see if the light bulb comes on in my head. I'd still appreciate a more efficient way to do this given the number of plots and panels I need. Thanks, Tim On Tue, Nov 26, 2013 at 2:08 PM, Duncan Mackay wrote: > Hi > > Try > >

[R] Append text to panels of lattice::barchart()

2013-11-26 Thread Tim Sippel
I could use a little help writing a panel function to append text to each panel of a lattice::barchart(). Below is a modified version of the barley dataset to illustrate. data(barley) # add a new variable called samp.size barley$samp.size<-round(runif(n=nrow(barley), min=0, max=50),0) # Below is

Re: [R] spsurvey analysis

2013-11-01 Thread Tim Howard
d two classes (!). I was worried it was detecting and treating polygons as classes, somehow (ecoregions in example below). I had already reached out to Kincaid and Olsen but had not received an answer yet so I moved on to R-help. I'll go back to them. Thanks again. Best, Tim >>

[R] spsurvey analysis

2013-11-01 Thread Tim Howard
ear=as.list(framesize))) warnprnt() ## how many records have values greater than zero, by year? Probably irrelevant! notZero <- dat[dat$count > 0,] table(notZero$grp) ### end > sessionInfo() R version 3.0.2 (2013-09-25) Platform: i386-w64-mingw32/i386 (32-bit) locale: [1] LC_COLLAT

[R] Selecting maximums between different variables

2013-10-17 Thread Tim Umbach
) attach(oil2) oil2[c(oil_2012 == max(oil_2012)),] Any help is much appreciated. Thanks, Tim Umbach [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

Re: [R] update.packages fails on pdf write - CSAgent

2013-10-03 Thread Tim Howard
) y <- list.files(pattern = ".zip") install.packages(pkgs = y, repos = NULL, lib = "C:/pathToLocationWhereWritesAreAllowed") #now manually copy the folders to the R installation and overwrite the existing ones. Tim >>>>>>>>>>>>>>>>> Dat

[R] update.packages fails on pdf write - CSAgent

2013-10-02 Thread Tim Howard
ited States.1252 LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and

[R] GGally installation problems

2013-06-12 Thread Tim Smith
Hi, I was trying to install the GGally package, but was getting errors. Here is what I get: > install.packages("GGally") Installing package(s) into ‘/Users/ts2w/Library/R/2.15/library’ (as ‘lib’ is unspecified) Warning in install.packages :   package ‘GGally’ is not available (for R

[R] #Keeping row names when using as.data.frame.matrix

2013-05-17 Thread Tim
#question I have the following data set: Date<-c("9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/8/2010") EstimatedQuantity<-c(3535,2772,3279,3411,3484,3274,3305) ScowNo<-c("4001","3002","4002","BR 8","4002","BR 8","4001") dataset<- data.frame(EstimatedQuantity,Date,ScowNo)

Re: [R] read.csv quotes within fields

2013-01-28 Thread Tim Howard
Yes! This does this trick. Thank You! Tim >>> peter dalgaard 1/26/2013 11:49 AM >>> On Jan 26, 2013, at 16:32 , Tim Howard wrote: > Duncan, > Good point - I guess I am expecting too much. I'll work on a global replace > before import or chopping with str

Re: [R] read.csv quotes within fields

2013-01-26 Thread Tim Howard
ction=showCaseDownloadForm (see off-airport AEA 2005 for a csv with issues.) Thank you for the help. I really do appreciate the suggested solutions. Also, thanks to John Kane for the link to csvEdit. Tim >>> Duncan Murdoch 01/25/13 6:37 PM >>> On 13-01-25 4:37 PM, Tim Howard wrote: > Da

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
x27;s the case, I'd think there would be a solution within read.csv() ... or perhaps scan()?, I just can't figure it out. best, Tim >>> David Winsemius 1/25/2013 4:16 PM >>> On Jan 25, 2013, at 11:35 AM, Tim Howard wrote: > Great point, your fix (quote="

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
nd* quotes with the escape character within a single string. Tim >>> David Winsemius 1/25/2013 2:27 PM >>> On Jan 25, 2013, at 10:42 AM, Tim Howard wrote: > All, > > I have some csv files I am trying to import. I am finding that quotes inside > strings are e

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
C=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base >>> Tim Howard 1/25/2013 1:42 PM >>> All, I have some csv files I am trying to import. I am finding that quotes inside str

[R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
test string","final string" "3","3","third row","last \" col" # this breaks read.csv: > read.csv("test.csv") X X1 X2 X3 1 1

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-21 Thread Tim Howard
-c("high","low") width<-c("slim","wide") l <- vector("list",length(height)) names(l) <- height for(i in 1:length(l)){ l[[i]] <- vector("list",length(width)) names(l[[i]]) <- width } Best Tim Date: Fri, 21 Dec 20

Re: [R] boot() with glm/gnm on a contingency table

2012-09-12 Thread Tim Hesterberg
>Le mercredi 12 septembre 2012 à 07:08 -0700, Tim Hesterberg a écrit : >> One approach is to bootstrap the vector 1:n, where n is the number >> of individuals, with a function that does: >> f <- function(vectorOfIndices, theTable) { >> (1) create a new table with

Re: [R] boot() with glm/gnm on a contingency table

2012-09-12 Thread Tim Hesterberg
of interest on the new table. } When f is called with 1:n, the table it creates should be the same as the original table. When called with a bootstrap sample of values from 1:n, it should create a table corresponding to the bootstrap sample. Tim Hesterberg http://www.timhesterberg.net (resampl

Re: [R] Histogram to KDE

2012-09-06 Thread Tim Hesterberg
bootstrap and jackknife methods won't work right. Tim Hesterberg http://www.timhesterberg.net New: Mathematical Statistics with Resampling and R, Chihara & Hesterberg >On Fri, Aug 31, 2012 at 12:15 PM, David L Carlson wrote: > >> Using a data.frame x with columns bin

[R] need help reshaping table using aggregate

2012-06-20 Thread Tim
I am trying to learn how to reshape my data set. I am new to R, so please bear with me. Basically, I have the following data set: site<-c("A","A","B","B") bug<-c("spider","grasshopper","ladybug","stinkbug") count<-c(2,4,6,8) myf <- data.frame(site, bug, count) myf site bug count 1

Re: [R] ggplot2: legend for geom_rug() ..?

2012-06-07 Thread Tim Smith
Hi, Here is the corrected code: library(ggplot2) ids <- paste('id_',1:3,sep='') before <- sample(9) after <- sample(1:10,9) dat <- as.matrix(cbind(before,after)) rownames(dat) <- rep(ids,3) position <- c(rep(10,3),rep(13,3),rep(19,3)) mdat <- cbind(melt(dat),position) colnames(mdat) <- c('ID','T

[R] [R-pkgs] dataframe package

2012-05-23 Thread Tim Hesterberg
cing an illegal data frame * round(a data frame with numeric and factor columns) rounds the numeric columns and leaves the factor columns unchanged, rather than failing. Tim Hesterberg NEW! Mathematical Statistics with Resampling and R, Chihara & Hesterberg http://www.amazon.com/Mathematic

[R] Possible artifacts in cross-correlation function ("ccf")?

2012-05-11 Thread Tim Dorscheidt
a very good statistical explanation, but one that unfortunately is not dawning on me. Sincerely, Tim Dorscheidt __ 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] suggested method to transform list to a matrix

2012-04-19 Thread Tim Stutt
5 What is the suggested method to do this for 1 million rows, with 12 variables and ~ 4,000 unique users? Thank you, Tim Stutt t...@ischool.berkeley.edu [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] [BioC] Read .idat Illumina files in R

2012-04-11 Thread Tim Triche, Jr.
Unfortunately, this won't help for expression arrays. Last time I checked, those IDATs appeared to be encrypted. crlmm, methylumi, and minfi can all read IDAT files... *if* they are "version 3" or later (e.g. genotyping, methylation, etc). Otherwise you are probably stuck with GenomeStudio if it

Re: [R] detecting noise in data?

2012-01-24 Thread HARROLD, Tim
within each group there's a reasonable level of homogeneity. Then from there, you can do a basic inference test for group means to detect whether there are significant differences detected between groups. Cheers, Tim -Original Message- From: r-help-boun...@r-project.org [mailto:r-hel

Re: [R] bootstrap means by strata

2011-10-13 Thread Tim Howard
Answering my own question. ?sample (!) y <- by(x, x$TrSeasYr, function(x) mean(sample(x[,1], size=999, replace = TRUE))) >>> Tim Howard 10/13/2011 9:42 AM >>> All - I have an uneven set of replicates and would like to sample from this set X number of times to gen

[R] bootstrap means by strata

2011-10-13 Thread Tim Howard
.frame") #get into R by pasting the above after "x<-" or dget("clipboard") # my grouping var is col 2, data are in col 1 # my attempt using boot library(boot) mn <- function(d,f) { mean(d[,1] * f[d[,1]]) } b1 <- boot(data = x, mn, R=99, stype = "f", stra

Re: [R] Permutation or Bootstrap to obtain p-value for one sample

2011-10-09 Thread Tim Hesterberg
there could be 0, 1, 2, The permutation test answers the question - given that there is exactly 1 outlier in my combined data, what is the probability that random chance would give a difference as large as I observed. The bootstrap would answer some other question. Tim Hesterberg NEW! Mathematic

[R] Can R be installed in a Hyper-V environment?

2011-09-20 Thread McDonough, Tim
We are contemplating the installation of R on a Windows server with Hyper-V but we can't find any information on whether it can be done. This transmission is intended solely for the person or organization to whom it is addressed and it may contain privile

[R] ggplot2 freqpoly() layers..?

2011-09-08 Thread Tim Smith
Hi, I was trying to overlay/combine two freqpoly plots. The sample code below illustrates the problem. Essentially, I want to do is: 1. Have the same colour for all the lines in 'Plot 1' (and 'Plot 2'). Currently, all the lines in Plot 1 have different colours and all the lines in Plot 2 have

[R] hide row and column-names in cat()

2011-08-24 Thread Tim Haering
   FraClay   pH [2,]  (kg.kg-1) (kg.kg-1) (kg.kg-1) (-) [3,] 1    19    60    21    7.1 [4,] 2    35    53    11    7.7 What I want to have is this:  Nr   FraSand   FraSilt   FraClay   pH   (kg.kg-1) (kg.kg-1) (kg.kg-1) (-)  1    19    60    21    7.1  2

Re: [R] Extracting components from a 'boot' class output in R

2011-07-24 Thread Tim Hesterberg
'print.boot' is not an exported object from 'namespace:boot'"). Tim Hesterberg >Do > names(bootObj) >to find out what the components are, and use $ or [[ to extract >components. >Do > help(boot) >for a description of components of the object (look in th

Re: [R] Extracting components from a 'boot' class output in R

2011-07-23 Thread Tim Hesterberg
(), return lists with a class added, and you can operate on the object as a list using names(), $, etc. Tim Hesterberg >Dear R user, > >I used the following to do a bootstrap. > > >>bootObj<-boot(data=DAT, statistic=Lp.est, >R=1000,x0=3) > >I have the following output f

Re: [R] Pulling data from remote MySQL database

2011-06-21 Thread HARROLD, Tim
Agree - I started with RMySQL but eventually changed over to RODBC when I realised some of the additional functionality it contains and the fact that I needed to access different types of RDBMSs (e.g. acquire data from a Microsoft access database file). Cheers, Tim -Original Message

Re: [R] Sorting a data frame with values of different lengths

2011-06-07 Thread Tim Smith
William, I think to convert to numeric, you might need to do something like: as.numeric(as.character()) ## and not just as.numeric() As it stands, it would appear that it is still being read as a character string. From: William Armstrong To: r-help

Re: [R] Question on approximations of full logistic regression model

2011-05-16 Thread Tim Hesterberg
s for the bootstrap biases, see e.g. Hesterberg, Tim C. (2004), Unbiasing the Bootstrap-Bootknife Sampling vs. Smoothing, Proceedings of the Section on Statistics and the Environment, American Statistical Association, 2924-2930. http://home.comcast.net/~timhesterberg/articles/JSM04-bootknife.pdf And

Re: [R] memory and bootstrapping

2011-05-05 Thread Tim Hesterberg
efficients estimated from the original data. And, you can compute the model matrix once and resample rows of that along with y, rather than computing a model matrix from scratch each time. Tim Hesterberg >The only reason the boot package will take more memory for 2000 >replications than 10 is

Re: [R] Simple Missing cases Function

2011-04-19 Thread Tim Elwell-Sutton
Thanks Tyler This function has some useful features Tim From: Tyler Rinker [mailto:tyler_rin...@hotmail.com] Sent: Tuesday, April 19, 2011 3:52 PM To: tesutton; r-help@r-project.org Subject: RE: [R] Simple Missing cases Function I use the following code/function which gives me some

Re: [R] Simple Missing cases Function

2011-04-19 Thread Tim Elwell-Sutton
Dear Petr Thanks so much. That is a LOT more efficient. Tim -Original Message- From: Petr PIKAL [mailto:petr.pi...@precheza.cz] Sent: Tuesday, April 19, 2011 3:37 PM To: tesutton Cc: r-help@r-project.org Subject: Odp: [R] Simple Missing cases Function Hi Hi try colSums(is.na(data.m

[R] Simple Missing cases Function

2011-04-19 Thread Tim Elwell-Sutton
. Can anyone see a more efficient way to get the same results? Or is there existing function which does this? Thanks for your help Tim Function: miss <- function (data) { miss.list <- list(NA) for (i in 1:length(data)) { miss.list[[i]] <- table(is.

Re: [R] Bootstrap 95% confidence intervals for splines

2011-03-27 Thread Tim Hesterberg
terval is the range of the middle 95% of the recorded differences. Tim Hesterberg P.S. I think you're mixing up the response and explanatory variables. I'd think of eating hot dogs as the cause (explanatory variable), and waistline as the effect (response, or outcome). P.P.S. I don't

Re: [R] assign factor levels based on list

2011-02-10 Thread Tim Howard
t;fig", "banana")) > y[ , names(my.factor.defs)] <- lapply(names(my.factor.defs), function(x) { +y[[x]] <- factor(y[[x]] , levels= my.factor.defs[[x]])}) > str(y) 'data.frame': 3 obs. of 3 variables: $ colOne : Factor w/ 6 levels "1",

[R] assign factor levels based on list

2011-02-09 Thread Tim Howard
$name,sep="")), levels = factor.defs[2][[1]]$lvl))) ##Error in function (x = character(), levels, labels = levels, exclude = NA, : ## object 'y$colTwo' not found Any help or perspective (or better way from the beginning!) would be greatly appreciated. Thanks in advance!

[R] Passing formula as an agrument

2011-01-23 Thread Tim Smith
Hi, I had a function that looked like: diff <- lm(x ~ y + z) How can I pass the argument to the 'lm' function on the fly? E.g., if I pass it in as a string (e.g. "x ~ y + z"), then the lm function treats it as a string and not a proper argument. many thanks [[alternative HTML

Re: [R] legend not appearing in Word document

2010-12-12 Thread Tim Clark
Thanks, I will take it up with MS.  I just downloaded their latest converter and that hasn't fixed the issue.  Hopefully they will have additional advice. Aloha, Tim Tim Clark Marine Ecologist National Park of American Samoa Pago Pago, AS 96799

[R] legend not appearing in Word document

2010-12-12 Thread Tim Clark
d pdf files. Thanks, Tim   library(plotrix)   Satelite.Palette <- colorRampPalette(c("blue3","cyan","aquamarine","yellow","orange","red"))   mycol<-Satelite.Palette(ceiling(5000+1))#Max relative angle multiplied by

Re: [R] apply over list of data.frames

2010-11-24 Thread Tim Howard
Fabulous! I'll start with trying out Reduce, and then explore do.call or converting it to an array if I need to. Thank you Dimitris, Baptiste, and Josh for the very quick help! Best, Tim >>> Dimitris Rizopoulos 11/24/2010 2:43 PM >>> try this: DF.lis <- list(

  1   2   3   4   >