similar to: problem using model.frame()

Displaying 20 results from an estimated 5000 matches similar to: "problem using model.frame()"

2005 Aug 16
4
as.character and a formula
Dear list, given this formula: > fmla <- formula(y1 ~ spp1 + spp2 + spp3 + spp5) > fmla[[3]] spp1 + spp2 + spp3 + spp5 is this the intended behaviour of as.character: > as.character(fmla[[3]]) [1] "+" "spp1 + spp2 + spp3" "spp5" ? Where does the extra "+" come from? > as.character(fmla) [1] "~"
2010 Jan 13
3
counting the number of times a string appears
Hi all, I have a vector of strings and need to count the number of times a string appears in the vector. eg: [1] spp6 spp10 spp6 spp6 spp4 spp2 spp9 spp10 spp5 spp2 spp2 spp3 [13] spp4 spp3 spp6 spp10 spp6 spp4 spp9 spp3 spp6 spp1 spp10 spp8 [25] spp2 spp10 spp9 spp7 spp1 spp3 spp8 spp6 spp3 spp8 spp6 spp5 [37] spp5 spp9 spp3 spp1 spp4 spp5 spp9 spp3
2004 Mar 10
3
Center labels on a boxplot
Suppose that I have data on three species for a variable and datasets from two time periods. I want to make a boxplot of the first dataset and then add the second using 'at = ' and 'add = T' as in the example for 'boxplot.' Since the boxes are paired by species, I want to do is have the x labels be centered between the boxes. I'm doing this now with mtext and entering
2005 Aug 02
1
problem using evaluating a formula
##data y1 <- matrix(c(3,1,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1), nrow = 5, byrow = TRUE) y2 <- matrix(c (3,0,10,3,3,0,0,1,1,0,0,0,0,0,1,0,1,0,0,2,1,0,1,1,0,2,1,1,4,1), nrow = 5, byrow = TRUE) y1 <- as.data.frame(y1) y2 <- as.data.frame(y2) rownames(y1) <- rownames(y2) <- paste("site", 1:5, sep = "") colnames(y1) <-
2004 Jul 16
3
Strange (non-deterministic) problem with strsplit
I'm having an odd problem with strsplit (well I think it's strplit that's causing the problem). When I run the code below as follows: str(parseFormulaMin(y +x +d ~ b +d +e| a * b)) I expect to get List of 3 $ y: chr "y+x+d" $ x: chr "b+d+e" $ g: chr "a*b" But about half the time I get List of 3 $ y: chr "y+x+d" $ x: chr
2004 Jul 16
3
Strange (non-deterministic) problem with strsplit
I'm having an odd problem with strsplit (well I think it's strplit that's causing the problem). When I run the code below as follows: str(parseFormulaMin(y +x +d ~ b +d +e| a * b)) I expect to get List of 3 $ y: chr "y+x+d" $ x: chr "b+d+e" $ g: chr "a*b" But about half the time I get List of 3 $ y: chr "y+x+d" $ x: chr
2010 Apr 19
3
nls for piecewise linear regression not converging to least square
Hi R experts, I'm trying to use nls() for a piecewise linear regression with the first slope constrained to 0. There are 10 data points and when it does converge the second slope is almost always over estimated for some reason. I have many sets of these 10-point datasets that I need to do. The following segment of code is an example, and sorry for the overly precise numbers, they are just
2017 Oct 18
4
Crear lista con data frames
Hola, estoy buscando la manera de crear una lista que contenga una serie de data frames (un número que puede variar con el tiempo pero que siempre van a tener un nombre con una pauta definida). La lista debe estar nombrada con el nombre de cada data frame. Quiero evitar esto: # ------- lista <- list(df1 = df1, df2 = df2, dfn = dfn) # ------- ya que como no sé cuantos data frames voy a tener
2017 Apr 07
3
Distribuir intervalo de días entre meses
Hola, Partiendo de un data frame con 2 variables de fecha (inicio y fin): df <- data.frame(inicio = c(as.Date("2016-01-01"), as.Date("2016-02-14")), fin = c(as.Date("2016-02-01"), as.Date("2016-02-29"))) Necesitaría crear 12 nuevas columnas adicionales, una
2010 Apr 19
2
nls minimum factor error
Hi, I have a small dataset that I'm fitting a segmented regression using nls on. I get a step below minimum factor error, which I presume is because residual sum of square is still "not small enough" when steps in the parameter space is already below specified/default value. However, when I look at the trace, the convergence seems to have been reached. I initially thought I might
2017 Jan 09
4
Asignar número de semana
Hola a todos. Estoy tratando de asignar el número de semana del año a una serie de fechas y me encuentro con que el paquete lubridate considera como día de inicio de la semana el domingo en lugar del lunes. Lo que se me ha ocurrido es crear una tabla auxiliar de fechas con los campos: 'Fecha desde', 'Fecha hasta' y 'Semana ISO' tal que así: 'Fecha desde', 'Fecha
2017 Apr 28
2
ggplot dentro de una función
Hola a todos, Partiendo de: library(ggplot2); library(data.table) datos <- data.table(Date = seq.Date(as.Date("2017-01-01"), as.Date("2017-01-10"), by = "day"), V1 = rnorm(10), V2 = rnorm(10)) Quiero crear una función para pintar un gráfico cuyos argumentos sean
2002 Jan 18
2
length of dimnames???
Hi: I have made a lot of progress reading and manipulating large data files, thanks to the help of several of you. I am now stuck with writing the final file with the following error (see also the full transcript below): Error in as.matrix.data.frame(x) : length of dimnames[2] not equal to array extent I do not know what it means and could not find how to get around that in the manual nor
2005 Aug 03
1
deparse(substitute(x)) and S3 methods
Dear List, I have the following function: coca <- function(x, ...) { if(is.null(class(x))) class(x) <- data.class(x) UseMethod("coca", x) } and a default method coca.default <- function(x, y, method = c("predictive", "symmetric"), reg.method = c("simpls", "eigen"), weights = NULL,
2005 Aug 17
3
do glm with two data sets
I have two data sets: File1.txt: Name id1 id2 id3 ... N1 0 1 0 ... N2 0 1 1 ... N3 1 1 -1 ... ... File2.txt: Group id1 id2 id3 ... G1 1.22 1.34 2.44 ... G2 2.33 2.56 2.56 ... G3 1.56 1.99 1.46 ... ... I like to do: x1<-c(0,1,0,...) y1<-c(1.22,1.34, 2.44, ...)
2006 Jul 07
4
How to change the type of segments ends?
Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal if the confidence interval segment can be drawn with little vertical bars at both ends. I have tried very hard to change the type of ends by using 'lend' arguments, but cannot make it. I even tried 'arrows()', but still failed. Following is the code I use:
2009 Jan 24
1
Help with dudi.pca
Dear R-helpers, I have two data frames, op and em4: > str(op) 'data.frame': 37 obs. of 5 variables: $ m : num 0.202 0.336 0.122 0.139 0.14 ... $ lln : num 0.798 0.643 0.863 0.835 0.823 ... $ rrn : num 0.789 0.702 0.894 0.895 0.923 ... $ asym2: num 0.177 0.304 0.108 0.187 0.274 ... $ asym3: num 0.0755 0.0975 0.0818 0.0651 0.13 ... > str(rownames(op)) chr
2004 Apr 19
0
Seeking help with multcomp
Hello R users, I am having difficulting getting multcomp to run. I have a dataframe attached with a numeric variable q12a and a numeric variable quota (which is really a classification variable). quota has 10 levels and unequal sample sizes. a12a has some missing data. I am interested in doing pairwise testing across the 10 quota groups on q12a. Using the ctest package the following code
2011 Oct 02
1
R Studio and Rcmdr/RcmdrPlugins
Dear R People: Hope you're having a great weekend! Anyhow, I'm currently experimenting with R Studio on a web server, which is the best thing since sliced bread, Coca Cola, etc. My one question: there is a way to show plots. is there a way to show Rcmdr or its Plugins, please? I tried, but it doesn't seem to work. Thanks so much, Sincerely, Erin -- Erin Hodgess Associate
2009 Mar 09
2
path analysis (misspecification?)
hi, I have following data and code; cov <- c (1.670028 ,-1.197685 ,-2.931445,-1.197685,1.765646,3.883839,-2.931445,3.883839,12.050816) cov.matrix <- matrix(cov, 3, 3, dimnames=list(c("y1","x1","x2"), c("y1","x1","x2"))) path.model <- specify.model() x1 -> y1, x1-y1 x2 <-> x1, x2-x1 x2 <->