similar to: environment question: changing variables from a formula through model.frame?

Displaying 20 results from an estimated 800 matches similar to: "environment question: changing variables from a formula through model.frame?"

2011 Jan 26
1
boxplot - code for labeling outliers - any suggestions for improvements?
Hello all, I wrote a small function to add labels for outliers in a boxplot. This function will only work on a simple boxplot/formula command (e.g: something like boxplot(y~x)). Code + example follows in this e-mail. I'd be happy for any suggestions on how to improve this code, for example: - Handle boxplot.matrix (which shouldn't be too hard to do) - Handle cases of complex
2005 Jul 25
5
passing formula arguments cv.glm
I am trying to write a wrapper for the last example in help(cv.glm) that deals with leave-one-out-cross-validation (LOOCV) for a logistic model. This wrapper will be used as part of a bigger program. Here is my wrapper funtion : logistic.LOOCV.err <- function( formu=NULL, data=NULL ){ cost.fn <- function(cl, pred) mean( abs(cl-pred) > 0.5 ) glmfit <- glm(
2004 Jul 13
2
help with as.function
HI, sorry but i don't understand how to make a function with as.function() formula<-"2+3*x" formu<-as.symbol(formula) > formu 2+3*x formul<-as.function(alist(x=,formu)) curve(formul,1,5,col="blue") Error in xy.coords(x, y, xlabel, ylabel, log) : x and y lengths differ > typeof(formul) [1] "closure" and not plot the curve function, Why?
2004 Jul 15
2
formula and lm
Hi, don' t understand why the function fomula have this error, i enclose the parameter "a" with the function I() Thank Ruben x<-1:5 y<-c( 2 ,4 , 6 , 8 ,11) formu<-y~I(a*x) form<-formula(formu) dummy<-data.frame(x=x,y=y) fm<-lm(form,data=dummy) Error in unique(c("AsIs", oldClass(x))) : Object "a" not found
2005 Nov 30
1
multinom crashes (when I do something stupid) (PR#8358)
Full_Name: Rob Foxall Version: 2.2.0 OS: Windows XP Submission from: (NULL) (149.155.96.5) I was using multinom from nnet package, when I did something stupid -- I entered in an incorrect factor variable as response. This factor had only one level. Instead of R telling me not to be so dumb, it crashed, clicking on debug coming up with the message "An exception 'Unhandled Win32
2004 Jul 15
5
formula
Hi, i 'dont understand how to take a general formula, view this: x<-1:5 y<-c(0,1,1.7,2,2.1.4) dummy<-data.frame(x=x,y=y) formula<-"y~A*log(x)/log(2)" formu<-as.formula(formula) fm<-lm(formu,data=dummy) Error in eval(expr, envir, enclos) : Object "A" not found but A is the parameter of fitting, why is this?Thanks Ruben
2003 Oct 03
2
how to get condition number from lm output
Dear r-help, I ran output <- lm(formu, data=mydata) I want to look at the condition number (to see if the matrix is near singular). How? Also, I use the function stepAIC from MASS to select models, how can I see the condition numbers in each step? While I am at it. I find a minor bug: R 1.7.1 on window XP, when you copy and paste by click one button, then the input stopped, until you
2012 Feb 17
1
como instalar plugin R en tiki
Estamos haciendo algunas pruebas pero no damos con la tecla, alguien tiene una idea de como instalarlo? Muchas gracias! Edwin Aguiar Desarrollo y Bases de Datos TICS EEA Corrientes INTA <v:f eqn="prod @7 21600 pixelHeig</v:formu [[alternative HTML version deleted]]
2017 Oct 20
3
nls() and loop
Hello I?m need fitt growth curve with data length-age. I want to evaluate which is the function that best predicts my data, to do so I compare the Akaikes of different models. I'm now need to evaluate if changing the initial values changes the parameters and which do not allow to estimate the model. To do this I use the function nls(); and I randomize the initial values (real positive number).
2012 Feb 14
1
como pasar una variable como parametro en consulta query
Buenas tardes a todos. Tengo una duda sobre como programar en R el siguiente codigo: #marcador 1 del mes 1 mes="abril" P1 <- sqlQuery(ch, as.is=TRUE, paste("SELECT `value_DE` FROM `de` WHERE `month_DE`=''abril'' and `icg_DE`= 1")) print(P1) Mi problema es que debo crear una serie de querys que llamen a 13*60 datos, por lo cual la variable "mes" (en
2010 Sep 16
1
The permutation of one vector into another
Dear R-help-list I have two character vectors a <- c("A", "B", "C") b <- c("A", "C", "B") Then sapply(a, function(i) grep(i, b)) computes the permutation of the entries in 'b' needed to bring 'b' into the same order as 'a'. I have searched around, but haven't been able to find any existing function
2011 Apr 22
1
Seeking help re: ? single apply command or an alternative
Dear R-help list, Sorry to trouble everyone. This seems like it could be achieved with a single command (? variant of apply), but I am not quite seeing it. I am trying to multiply one vector (a1 below) by corresponding values in a3 (as determined by matching element in a vector a2). The example below might be clearer. a1 <- c(4,3,4,6,8,9,2,3,4,6,7,4) a2 <-
2017 Oct 20
0
nls() and loop
?tryCatch -- Sent from my phone. Please excuse my brevity. On October 20, 2017 7:37:12 AM PDT, Evangelina Viotto <evangelinaviotto at gmail.com> wrote: >Hello I?m need fitt growth curve with data length-age. I want to >evaluate >which is the function that best predicts my data, to do so I compare >the >Akaikes of different models. I'm now need to evaluate if changing the
2010 Aug 26
1
Passing arguments between S4 methods fails within a function:bug? example with raster package.
Dear all, This problem came up initially while debugging a function, but it seems to be a more general problem of R. I hope I'm wrong, but I can't find another explanation. Let me illustrate with the raster package. For an object "RasterLayer" (which inherits from Raster), there is a method xyValues defined with the signature
2011 Apr 17
5
cube root
This is some interesting: > -8^(1/3) [1] -2 > x=(-8:8) > y=x^(1/3) > y [1] NaN NaN NaN NaN NaN NaN NaN NaN 0.000000 1.000000 [11] 1.259921 1.442250 1.587401 1.709976 1.817121 1.912931 2.000000 So, can anybody explain this?! (Why is x[1]^(1/3)=y[1]=NaN, but -8^(1/3)=-2?) Thx!!! [[alternative HTML version deleted]]
2010 Aug 26
3
Using termplot() with transformations of x
Hi all I was playing with termplot(), and came across what appears to be an inconsistency. It would appreciate if someone could enlighten me: > # First, generate some data: > y <- rnorm(100) > x <- runif(length(y),1,2) > # Now find the log of x: > logx <- log(x) > > # Now fit two models that are exactly the same, but specified differently: > m1 <-
2010 Sep 30
4
interactive session
Hi guys, My concern is to create an automated process from the beginning to the end. I want to copy all my code together in one piece and paste it to R console and sit back and relax :) except one moment in which the program should ask me to enter a number.. and only then (only after getting a valid number from me) it should continue to read and process the rest of the code. I tried lots of
2012 Dec 28
3
Merging data tables
Hi all, I am trying to merge several data sets and end up with a long data format by date & time so I can run correlations and plots. I am using Deducer as an R GUI but can just use the R console if easier. The data sets are weather with wind speed, relative humidity and temperatures by date and minute and bat activity with date, time, label, and an activity index number. The bat
2007 Apr 10
7
Error from boot .img can not run from protected enviornment
I set up a bios update option on a PXE server, when it boots and starts to run the exe for the bios I get the error: Can not run from protected enviornment. Can any one help me reconcile this issue so I can get the bios update .img to work correctly. Thanks for any help guys. Thank You BP Computer Consultants Bryan Pershall (MCSE, Dell Certified) IT Consultant ------ Office: 281-469-6456 Cell:
2007 Dec 09
0
Iconv enviornment variable missing????
I am getting the following message: /reformatting crontab(1), please wait.../ /conv: conversion from utf8 unsupported/ I used crontab merely as an example on the command line. It is not directly a wine problem, but it does affect my operation of the wine package. I remember a few weeks ago someone posted a set of enviornment variables to set -- to instruct iconv to translate from all