Re: [R] Discriminant of a cubic polynomial

2024-10-10 Thread Leo Mada via R-help
Dear Thomas, Unfortunately, I do not know if any packages implement this functionality. Though, it is a topic that interests me. Unlike the "classic discriminant", I prefer to work with the reduced polynomial. This "discriminant" is generalizable to a superset of Chebysev polynomials (which I

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-05 Thread Leo Mada via R-help
number. Which R actually does for these very particular cases; but not when only Im(x) is Inf. Sincerely, Leonard From: Bert Gunter Sent: Friday, September 6, 2024 1:12 AM To: Duncan Murdoch Cc: Leo Mada ; r-help@r-project.org Subject: Re: [R] BUG: atan(1i) / 5

[R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-05 Thread Leo Mada via R-help
Dear R Users, Is this desired behaviour? I presume it's a bug. atan(1i) # 0+Infi tan(atan(1i)) # 0+1i atan(1i) / 5 # NaN+Infi There were some changes in handling of complex numbers. But it looks like a bug. Sincerely, Leonard [[alternative HTML version deleted]] __

Re: [R] Tools to modify highlighted areas in pdf documents?

2024-06-03 Thread Leo Mada via R-help
PM To: Leo Mada via R-help Cc: Leo Mada Subject: Re: [R] Tools to modify highlighted areas in pdf documents? � Sat, 1 Jun 2024 16:16:23 +0000 Leo Mada via R-help �: > When highlighting pdf-documents with Microsoft Edge, the bounding box > is sometimes misplaced, and quite ugly so. It als

Re: [R] R code for overlapping variables -- count

2024-06-02 Thread Leo Mada via R-help
Correcting a small glitch - see new code. From: Leo Mada Sent: Sunday, June 2, 2024 8:34 PM To: Shadee Ashtari Cc: r-help@r-project.org Subject: [R] R code for overlapping variables -- count Dear Shadee, If you have a data.frame with the following columns: n

[R] R code for overlapping variables -- count

2024-06-02 Thread Leo Mada via R-help
Dear Shadee, If you have a data.frame with the following columns: n = 100; # population size x = data.frame(   Sex = sample(c("M","F"), n, T),   Country = sample(c("AA", "BB", "US"), n, T),   Income = as.factor(sample(1:3, n, T)) ) # Dummy variable ONE = rep(1, nrow(x)) r = aggrega

Re: [R] Tools to modify highlighted areas in pdf documents?

2024-06-01 Thread Leo Mada via R-help
pick up this task. Sincerely, Leonard From: Bert Gunter Sent: Saturday, June 1, 2024 9:23 PM To: Leo Mada Cc: r-help@r-project.org Subject: Re: [R] Tools to modify highlighted areas in pdf documents? Search! on rseek.org<http://rseek.org>, the query &qu

[R] Tools to modify highlighted areas in pdf documents?

2024-06-01 Thread Leo Mada via R-help
Dear R-Users, Are there any packages that enable the modifications of highlighted areas / annotations in pdf documents? It seems feasible - I have explored some R code (see below). However, I would rather avoid to reinvent the wheel. The problem: When highlighting pdf-documents with Microsoft

Re: [R] Clustering Functions used by Reverse-Dependencies

2024-02-29 Thread Leo Mada via R-help
f code. On the other hand, the help page for codetools::checkUsage is quite cryptic. But it's good to know at least where to look. Sincerely, Leonard From: Ivan Krylov Sent: Wednesday, February 28, 2024 10:36 AM To: Leo Mada via R-help Cc: Leo Mada Su

[R] Clustering Functions used by Reverse-Dependencies

2024-02-23 Thread Leo Mada via R-help
Dear R Users, Are there any tools to extract the function names called by reverse-dependencies? I would like to group these functions using clustering methods based on the co-occurrence in the reverse-dependencies. Utility: It may be possible to split complex packages into modules with fewer

[R] Optimal use of optim?

2024-02-13 Thread Leo Mada via R-help
Dear R-Users, I am interested in the optimal strategy for optim: Q: How to formulate the optimization problem? Q1: Are there benefits for abs(f(x)) vs (f(x))^2? Q2: Are there any limitations for using abs(...)? Regarding point 1: my feeling is that the gradients should be more robust with the a

Re: [R] Skip jumps in curve

2024-02-13 Thread Leo Mada via R-help
. Sincerely, Leonard From: Duncan Murdoch Sent: Tuesday, February 13, 2024 6:05 PM To: Leo Mada ; r-help@r-project.org Subject: Re: [R] Skip jumps in curve On 13/02/2024 10:29 a.m., Leo Mada via R-help wrote: > Dear R-Users, > > Is there a way to skip ove

[R] Skip jumps in curve

2024-02-13 Thread Leo Mada via R-help
Dear R-Users, Is there a way to skip over without plotting the jumps/discontinuities in curve()? I have not seen such an option, but maybe I am missing something. plot.gamma = function(xlim = c(-6, -1), ylim = c(-1,3), hline = NULL, n = 1000) { curve(gamma(x), from = xlim[1], to = xlim[2],

Re: [R] Use of geometric mean for geochemical concentrations

2024-01-30 Thread Leo Mada via R-help
Dear Rich, It depends how the data is generated. Although I am not an expert in ecology, I can explain it based on a biomedical example. Certain variables are generated geometrically (exponentially), e.g. MIC or Titer. MIC = Minimum Inhibitory Concentration for bacterial resistance Titer = di

[R] Fit NLE - was: computer algebra in R

2023-12-04 Thread Leo Mada via R-help
Fit NLE - was: [R] computer algebra in R Original post: https://stat.ethz.ch/pipermail/r-help/2023-November/478619.html Dear Kornad, I think I have started to understand what you try to achieve. The problem is to fit a NLE and compute the parameters of the NL-Eq. I have included the R Help-list

[R] computer algebra in R

2023-11-29 Thread Leo Mada via R-help
Dear Konrad, I presume that the system can be written as follows, where h0, d0, ga0, kga and kd are given: err1 = h + hd + hga - h0; err2 = d + hd - d0; err3 = ga + hga - ga0; err4 = hga - kga*h*ga; err5 = hd - kd*h*d; All error terms should be zero. Do you need (a) the symbolic solution or (b

[R] Extract cells and their adjacent cells that may appear anywhere in a dataframe.

2017-05-08 Thread Brian Leo
Hello, I have a dataframe that contains information about vegetation cover and percent coverage, collected using a quadrat. The dataframe is set up so that each row represents a single quadrat. If there are multiple species within one quadrat, they are all listed within the same row with respect

[R] Forging an R enthusiast meeting at EGU 2017

2016-11-02 Thread Leo Leo via R-help
At the European Geosciences Union Meeting (Spring 2017 in Vienna) there will be an interactive sessionthat aims to bring together scientists that share a common indispensable tool: the statistic software R. http://meetingorganizer.copernicus.org/EGU2017/session/24971 We have the feeling that R us

Re: [R] Order of formula terms in model.matrix

2016-01-18 Thread Guelman, Leo
Thanks Peter. That make sense. Nevertheless, what comes at a surprise to me (and maybe to others) is that one can potentially get different fits by simply swapping the terms in the model formula. Best, Leo. -Original Message- From: peter dalgaard [mailto:pda...@gmail.com] Sent: 2016

Re: [R] Order of formula terms in model.matrix

2016-01-18 Thread Guelman, Leo
Is it really the same model? Following the example provided by Lars: set.seed(1) x1 <- rnorm(100) f1 <- factor(sample(letters[1:3], 100, replace = TRUE)) trt <- sample(c(-1,1), 100, replace = TRUE) y <- factor(sample(c(0,1), 100, T)) df <- data.frame(y=y, x1=x1, f1=f1, trt=trt) fit1 <- glm(y ~ x

[R] Order of factor levels

2016-01-11 Thread Guelman, Leo
;- paste(letters[1:nlevels(xc)], levels(xc), sep=":") as.character(xc) } res <- main_fun(df) levels(res$x1) levels(res$x1) [1] "a:[-3.01,-1.34]""b:(-1.34,-0.882]" "c:(-0.882,-0.511]" "d:(-0.511,-0.296]" "e:(-0.296,-0.0353]" [6] &qu

[R] How best to model these datasets

2014-10-12 Thread Brian Leo
Hello, I am a stats novice and I was wondering what kind of model would work best with the two datasets that are displayed. The graphs show an incremental area analysis for two feral cat home ranges where area increases with increasing number of GPS fixes. Thanks, Brian -- Brian Leo School

Re: [R] Reading specific rows and columns xlsx file: Error in strsplit(names(res), "\\.") : non-character argument

2014-08-03 Thread Margherita Di Leo
Ahem.. solved. I had switched between rows and columns.. Sorry for the noise. Best, m On Sun, Aug 3, 2014 at 6:33 PM, Margherita Di Leo wrote: > Hi, > > I am trying to read specific rows and columns from a xlsx file using the > following commands: > > # Read rows 18-23 and

[R] Reading specific rows and columns xlsx file: Error in strsplit(names(res), "\\.") : non-character argument

2014-08-03 Thread Margherita Di Leo
atform: x86_64-pc-linux-gnu (64-bit) I'm on debian Jessie. Disclaimer: this is a homework. Thank you in advance -- Best regards, Dr. Margherita DI LEO Scientific / technical project officer European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I

[R] (Seismic) signal deconvolution with R

2014-03-24 Thread Leo Leo
Has anybody (successfully) tried to deconvolve a seismic signal (time series in general) using R and package signal? I have the Matlab routines: [bb,aa] = zp2tf(zero,pole',gain); [bb,aa] = bilinear(bb,aa,df); transfer = freqz(bb,aa,f,df); But the (apparent) equivalents of R produce quite differen

[R] Call for papers: Geospatial Semantic Array Programming

2014-01-09 Thread Margherita Di Leo
pdf> -- Best regards, Dr. Margherita DI LEO Scientific / technical project officer European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP 261 Tel. +39 0332 78 3600 margherita.di-...@jrc.ec.europa.eu Disclaimer: The v

Re: [R] forecasting accuracy problem in R

2012-12-16 Thread Leo
Thanks. Could be the following reason given in the changelog. " accuracy() can now figure out overlapping times for x and f." best regards Leo On Mon, Dec 17, 2012 at 10:11 AM, Jeff Newmiller wrote: > Please read the posting guide. Packages have their own developers, as well as

[R] forecasting accuracy problem in R

2012-12-16 Thread Leo
,test[1:30]) and it worked. (I was checking the accuracy of 30 forecasted values). Is there some change in the forecast package or did I do something wrong? regards Leo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Forecast Package: Draw two lines on the same plot

2012-11-13 Thread Leo
Hi, How is it possible to draw to different data on the same graph using forecast package? The first is the observed data and the second set is the fitted values. I want the observed data to show as solid line while the fitted values to show as dashed or dotted line. regards Leo

[R] formula method with "special" characters

2012-06-20 Thread Guelman, Leo
owever, the section of code below (as an example extracted from the gam package) gives me an error as shown at the end. Evidently I'm missing something here...any help is much appreciated. Thanks, Leo. "gam2.slist" <- c("s", "lo", "random") "gam2&q

Re: [R] smooth scatterplot and geo map

2011-07-28 Thread Leo Guelman
check smooth.ppp{spatstat} which performs spatial smoothing based on a Gaussian kernel...it has a plot method that may do what you are looking for hope this helps, Leo. On Thu, Jul 28, 2011 at 4:09 PM, marco wrote: > Hello everybody, > I'm trying to understand how to draw

Re: [R] Simple example of using a closure in R to manage bank accounts?

2011-07-25 Thread Leo Guelman
something like this maybe? account <- function (balance=0) { function (d = 0,w = 0) { newbal <- balance + d - w balance <<- newbal newbal } } John <- account(100) John John(d=100,w=50) John() Leo <- account(1000) Leo Leo(d=1000,w=5

Re: [R] Help with contrasts

2011-05-11 Thread Guelman, Leo
Or alternatively (though very similar to Peter's idea) you can do ci <- contrasts formals(ci)$contrasts <- FALSE dd <- data.frame(a = gl(3,4), b = gl(4,1,12)) mm <- model.matrix(~ a + b, dd, contrasts = list(a=ci(dd$a), b=ci(dd$b))) Best, Leo. -Original Message- From:

Re: [R] Reproducibility issue in gbm (32 vs 64 bit)

2011-02-28 Thread Guelman, Leo
I'm guessing this has something to do with numerical precision on the two platforms. Leo. - Original Message - From: Joshua Wiley To: Axel Urbiz Cc: R-help@r-project.org ; Ridgeway, Greg Sent: Fri Feb 25 22:16:02 2011 Subject: Re: [R] Reproducibility issue in gbm (32 vs 64 bit

[R] New R User Group in Toronto

2010-10-12 Thread Guelman, Leo
s from all levels are welcome. Special thanks to Revolution Analytics to help us get started and sponsor the group. Kind Regards, Leo Guelman. ___ This e-mail may be privileged and/or confidential, and the sender does not waive a

[R] Can this code be written more efficiently?

2010-09-30 Thread Guelman, Leo
2 <- prediction(predictions=attr(pred.step1,"probabilities")[,1], labels=myvaliddata$churn) pred.step3[i] <- performance(pred.step2, "auc")@y.values[[1]] } pred.step3 End Code Thanks, Leo. ___

Re: [R] TM Package - Corpus function - Memory Allocation Problems

2010-08-17 Thread Guelman, Leo
way to solve this memory problem other than increasing a physical RAM? Thanks in advance for any help, Leo. ___ This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligation

[R] different outcomes of P values in SPSS and R

2010-08-13 Thread Leo Vorthoren
I have been using generalized linear models in SPSS 18, in order to build models and to calculate the P values. When I was building models in Excel (using the intercept and Bs from SPSS), I noticed that the graphs differed from my expectations. When I ran the dataset again in R, I got totally diff

[R] fit data with y = x^-1

2010-06-07 Thread Leo Leo
Dear list, I am getting weired with fitting data with a 1/x-polynomial. Suggest I have the following data: x <- c(1,2,3,4,5,6,7) y <- c(100,20,4,2,1,.3,.1) I may fit this with a linear model fit1 = lm(y ~ I(x)) Getting plot out of this model I applied library(polynom) pol1 = polynomial(fit1$co

[R] Linear Contrasts in GLM - Query

2009-09-04 Thread Leo Guelman
=b, (iii) a=b+d, etc... Thanks in advance for your help! Leo. [[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

Re: [R] Grouping data in a data frame: is there an efficient way to do it?

2009-09-02 Thread Leo Alekseyev
seconds. For the sake of comparison, I did write the "counting up rows with common values" function using a Perl hash (it's only 5 lines of Perl) and it takes 15 seconds to run -- a 2x speedup. Not yet sure if it's worth the hassle. --Leo On Wed, Sep 2, 2009 at 4:28 PM, David

[R] Grouping data in a data frame: is there an efficient way to do it?

2009-09-02 Thread Leo Alekseyev
I have a data frame with about 10^6 rows; I want to group the data according to entries in one of the columns and do something with it. For instance, suppose I want to count up the number of elements in each group. I tried something like aggregate(my.df$my.field, list(my.df$my.field), length) but

Re: [R] read floats from file into array

2009-07-21 Thread leo mueller
big thanks to all, the x[[1]] worked fine! :) 2009/7/21 Duncan Murdoch : > On 21/07/2009 6:09 AM, leo mueller wrote: >> >> hi all, >> >> i have a simple question. instead of defining my measurements in a >> static way like ... >> >> x <- c(-0.475, -

[R] read floats from file into array

2009-07-21 Thread leo mueller
hi all, i have a simple question. instead of defining my measurements in a static way like ... x <- c(-0.475, -1.553, -0.434, -1.019, 0.395) ... i'd like them to be read from a file ... x <- read.table("07a673ac0cb1f7f8fa293860566f633c/1/raw0.txt", header=FALSE) d1 <- density(x, kernel = "gauss

[R] R Courses in Toronto

2009-06-11 Thread Leo Guelman
Dear R users, Does anybody know if there any good R courses within the Toronto area? Thanks! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

Re: [R] Vim R plugin-2

2009-05-09 Thread Leo
> Any alternative ways of sending info both ways from R to any open > process (vim) > in windows? On windows, I'd rather use ole automation. A few years ago I successfully used this plugin: http://www.vim.org/scripts/script.php?script_id=889 I haven't used it since though. _

[R] Rdonlp2 -Query

2009-03-07 Thread Leo Guelman
Hi, Did anyone used this package? Could you please share your thought on it? Thanks! L. [[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 ht

[R] p(H0|data) for lm/lmer-objects R

2008-12-25 Thread Leo Gürtler
cover that topic. Thanks a lot, best, leo gürtler __ 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

[R] GMM estimation

2008-05-27 Thread Leo Correia
unsucessful. That´s why I had decided to ask to this forum. Hope that anyone could help me! I know that such emails might bother you guys at all... but I dont know where to search for help about this issue. Many thanks!!! hope to hear from you soon! Leo! [[alternative HTML version deleted

[R] Help with simulation of heteroskedasticity

2008-04-26 Thread Leo Correia
Hello guys! Sorry to bother with such a question I was trying to generate a monte carlo simulation with heteroskedasticity errors. but I am not sure if the command line that I had wrote is quite correct. the type of heteroskedasticity that I want to create is such as var(e) = var(x^4) I began my