similar to: error message + boot library

Displaying 20 results from an estimated 20000 matches similar to: "error message + boot library"

2006 Nov 29
3
R2.4 xyplot + panel.number problem
Hi all; I'm trying to display a 2 panel plot for the Puromycin data from R with 2 different non-linear models fitted to each group. The problem is that as far as I know panel.number doesn't work in the latest version of R. Can anyone give a hint how to solve this? Here is the code that I used before and now doesn't work xyplot(rate ~conc| state,Puromycin,
2016 Apr 02
3
apply mean function to a subset of data
Dear all; This must have a rather simple answer but haven't been able to figure it out: I have a data frame with say 2 groups (group 1 & 2). I want to select from group 1 say "n" rows and calculate the mean; then select "m" rows from group 2 and calculate the mean as well. So far I've been using a for loop for doing it but when it comes to a large data set is
2004 Mar 12
6
still spss
hi again, i still cannot open the file in spss :( i type: library(foreign) read.spss("H:\\Desktop\\bd1\\experiencia1") and the error comes: Error in read.spss("H:\\Desktop\\bd1\\experiencia1") : unable to open file can you help me? margarida,portugal
2016 Apr 03
1
apply mean function to a subset of data
Here are several ways to get there, but your original loop is fine once it is corrected: > for (i in 1:2) smean[i] <- mean(toy$diam[toy$group==i][1:nsel[i]]) > smean [1] 0.271489 1.117015 Using sapply() to hide the loop: > smean <- sapply(1:2, function(x) mean((toy$diam[toy$group==x])[1:nsel[x]])) > smean [1] 0.271489 1.117015 Or use head() > smean <- sapply(1:2,
2016 Apr 02
0
apply mean function to a subset of data
Hi Pedro, This may not be much of an improvement, but it was a challenge. selvec<-as.vector(matrix(c(nsel,unlist(by(toy$diam,toy$group,length))-nsel), ncol=2,byrow=TRUE)) TFvec<-rep(c(TRUE,FALSE),length.out=length(selvec)) toynsel<-rep(TFvec,selvec) by(toy[toynsel,]$diam,toy[toynsel,]$group,mean) Jim On 4/3/16, Pedro Mardones <mardones.p at gmail.com> wrote: > Dear all; >
2007 Jun 14
4
question about formula for lm
Dear all; Is there any way to make this to work?: .x<-rnorm(50,10,3) .y<-.x+rnorm(50,0,1) X<-data.frame(.x,.y) colnames(X)<-c("Xvar","Yvar") Ytext<-"Yvar" lm(Ytext~Xvar,data=X) # doesn't run lm(Yvar~Xvar,data=X) # does run The main idea is to use Ytext as input in a function, so you just type "Yvar" and the model should fit....
2008 Oct 09
1
YALAQ - Yet Another LApply Question
Hello, Two lapply questions (system info and sample data below): 1) Why does the first form of command1 add the name of y _after_ the str() output rather than before as does the second (preferred) form? # command1 version1 invisible(lapply(ls(pattern='bn'), function(y) cat(y, "\n", str(get(y)), "\n") )) # command1 version2 (preferred output)
2007 May 11
3
how to get column/row info from a dist object?
Dear R users; Is it possible to get the row and column number of a particular entry in a dist object? Let's say that I want to find the position of the value 1.1837 (the last entry on the dist object below), that is [6,3]. Can I get those values without transforming the object to a matrix?, i.e. working with the dist object only. 1 2 3 2 0.23935864
2011 Sep 20
5
help in interpreting paired t-test
Dear all; A very basic question. I have the following data: ************************************************************************************ A <- 1/1000*c(347,328,129,122,18,57,105,188,57,257,53,108,336,163, 62,112,334,249,45,244,211,175,174,26,375,346,153,32, 89,32,358,202,123,131,88,36,30,67,96,135,219,122, 89,117,86,169,179,54,48,40,54,568,664,277,91,290,
2010 Apr 03
2
Using ifelse and grep
Good Morning, I am trying to create a new column of character strings based on the first two letters in a string in another column. I believe that I need to use some combination of ifelse and grep but I am not totally sure how to combine them. I am not totally sure why the command below isn't working. Obviously it isn't finding anything that matches my criteria but I am not sure why. Any
2004 Mar 12
6
spss
hi, i can?t download a file in access. when i type: > library(foreign) > read.spss("H:\Desktop\bd1\experiencia1") comes the error: Error in read.spss("H:Desktop\bd1experiencia1") : unable to open file do you know what is the problem? can you help me? margarida,porto,portugal
2009 Mar 14
4
persp plot + plotting grid lines
Dear all; Does anyone know how to add grid lines to a persp plot? I've tried using lines(trans3d..) but the lines of course are superimposed into the actual 3d surface and what I need is something like the plot shown in the following link: http://thermal.gg.utah.edu/tutorials/matlab/matlab_tutorial.html I'll appreciate any ideas Thanks PM
2009 Jan 18
2
don't print object attributes on screen
Dear all; I have a function written in R that returns as a list of values as output that has associated some user defined attributes to it. How can hide these attributes when printing the output on screen? I'm using R-2.8.1 on WinXP....it's like hiding the attr of the output from the scale function.... Thanks in advance PM
2013 Mar 13
1
calculating column difference in a matrix
Dear R users; Consider the following toy example: a <- matrix(c(2,3,4,NA,NA,5,8,NA,8,NA), 5, 2) b <- cbind(a,apply(a, 1, diff, na.rm = TRUE)) What I would like be able to get is: c <- matrix(c(2,3,4,NA,NA,5,8,NA,8,NA,3,5,-4,8,NA), 5, 3) i.e., for each row if both values (column 1 and 2) are NA then the difference must return NA, but if any of those two values is different from NA
2006 Dec 26
2
sequential row selection in dataframe
Dear all; I'm wondering if there is any 'efficient' approach for selecting a sample of 'every nth rows' from a dataframe. For example, let's use the dataframe GAGurine in MASS library: > length(GAGurine[,1]) [1] 314 # select an 75% of the dataset, i.e. = 236 rows, every 2 rows starting from row 1 > test<-GAGurine[seq(1,314,2),] > length(test[,1]) [1] 157 #
2008 Apr 08
1
plot function / par() settings
Dear all; I'm trying to create a 2 x 3 plot (something I know like lattice can do better) using the plot function. However; I'm not sure how to make the width of the plots to be the same on each column. I guess the answer maybe obvious but I haven't been able to figure it out. I'll appreciate any suggestion. Here is the (highly inefficient) code for the first row: par(mfrow =
2007 Nov 06
2
translating R code to C code
I would like to try to implement a big series of nested loops in a C code and then call it from R; however I'm not familiar with C programming. Does anyone know about some sort of reference I can use that help me to translate my code to C? (I'm thinking on something like to Octave to R reference posted in CRAN) thanks PM
2008 Jun 23
1
levelplot question
Dear all; I have a data set with 3 groups and 2 response variables, say z1 and z2, and I would like to create a single plot (using the levelplot function) showing on the first row the leveplots for z1 for each group and on the second row levelplots for z2 for the same groups. I tried plot.trellis using the split option and it's OK but what I would like to achieve is something similar to what
2006 Oct 22
1
least median squares
Does anyone can provide a code to implement least median squares regression in R (not using the lqs function or calling C functions)? Reason: teaching/learning purposes Thanks PM
2012 Sep 16
1
trying to obtain same nls parameters as in example
Dear R-users; I'm working with a a dataset that was previously used to fit a nonlinear model of the form: Y ~ a * (1 + b * log(1 - c * X^d)) The parameters published elsewhere are: a = 1.758863, b = .217217, c = .99031, and d = .054589 However, there is no way I can replicate this result. I've tried several options (including SAS) w/o success. The data is: X <-