similar to: How to keep the same class?

Displaying 20 results from an estimated 700 matches similar to: "How to keep the same class?"

2010 Sep 10
1
lme, groupedData, random intercept and slope
Windows Vista R 2.10.1 Does the following use of groupedData and lme produce an analysis with both random intercept and slope, or only random slope? zz<-groupedData(y~time | Subject,data=data.frame(data), labels = list( x = "Time", y = "y" ), units = list( x = "(yr)", y = "(mm)") ) plot(zz)
2012 Oct 10
2
lm on matrix data
Hi, I have a question about using lm on matrix, have to admit it is very trivial but I just couldn't find the answer after searched the mailing list and other online tutorial. It would be great if you could help. I have a matrix "trainx" of 492(rows) by 220(columns) that is my x, and trainy is 492 by 1. Also, I have the newdata testx which is 240 (rows) by 220 (columns). Here is
2005 Jun 01
7
Which variable exist after random
Dear R-helper, How could I count only some variable was exist after running sample (random) function. For example, > testx <- factor(c("Game","Paper","Internet","Time","Money")) > for(i in 1:2) { + x <- sample(testx,replace=TRUE) + print(x) + } [1] Money Money Time Internet Time Levels: Game Internet
2012 Mar 21
2
glmnet: obtain predictions using predict and also by extracting coefficients
All, For my understanding, I wanted to see if I can get glmnet predictions using both the predict function and also by multiplying coefficients by the variable matrix. This is not worked out. Could anyone suggest where I am going wrong? I understand that I may not have the mean/intercept correct, but the scaling is also off, which suggests a bigger mistake. Thanks for your help. Juliet Hannah
2012 May 16
1
survival survfit with newdata
Dear all, I am confused with the behaviour of survfit with newdata option. I am using the latest version R-2-15-0. In the simple example below I am building a coxph model on 90 patients and trying to predict 10 patients. Unfortunately the survival curve at the end is for 90 patients. Could somebody please from the survival package confirm that this behaviour is as expected or not - because I
2011 Jul 09
3
Using str() in a function.
Using str() in a function. I am in the early phase of learning R, and I find I spend a lot of time trying to figure out what is actually in objects I have created or read in from a file. I'm trying to make a simple little function to display a couple of things about a object, let's say the summary() and the str(), sequentially, preferably without a bunch of surplus lines between them. I
2006 Dec 13
2
persp() problem
Dear list, I have a problem on persp() x <- u1data #first coloum in attached data y <- u2data #second coloum in attached data f <- function(x,y){qgev(pnorm(rhoF*qnorm(pnorm((qnorm(y)-rho2*qnorm(x)/sqrt(1-rho2^2)))) +sqrt(1-rhoF^2)*qnorm(0.95)),-0.3935119, 0.4227890, 0.2701648)} z <- outer(x,y,f) persp(x,y,z) The R will display: "Error in persp.default(x, y,
2016 Sep 18
2
Problem Samba 4.5
thanks for your attention. temporarily with the following script I'm looking at myself. #!/bin/bash INTERVAL=180 LOG=true function log { if $LOG; then echo $1 fi } while true; do testx=`ps -auxw | grep "smbd" | wc -l` testy=`netstat -ap | grep samba | grep sock | wc -l` if test "$testx" -gt "50" -a "$testy" -gt "50" ;then echo "samba
2009 Jun 08
3
caret package
Hi all I am using the caret package and having difficulty in obtaining the results using regression, I used the glmnet to model and trying to get the coefficients and the model parameters I am trying to use the extractPrediction to obtain a confusion matrix and it seems to be giving me errors. x<-read.csv("x.csv", header=TRUE); y<-read.csv("y.csv", header=TRUE);
2013 Feb 18
2
mtext unicode failure
Readers, How to solve this unicode input error please? > postscript("~/tmp/test.eps",width=100/25.4,height=100/25.4,horizontal=FALSE,onefile=TRUE,paper="special") > testx<-seq(1:5) > testy<-seq(1:5) > plot(testy~testx) > mtext('text (O?)\n more text',side=3,line=1) Warning messages: 1: In mtext("text (O?)\n more text", side = 3, line =
2005 Feb 01
2
assign connections automatically
Hi all, I am trying to create a function that will open connections to all files of one type within the working directory. I've got the function to open the connections, but I am having a bugger of a time trying to get these connections named as objects in the workspace. I am at the point where I can do it outside of the function, but not inside, using assign. I'm sure I'm
2004 Jul 12
6
proportions confidence intervals
Dear R users this may be a simple question - but i would appreciate any thoughts does anyone know how you would get one lower and one upper confidence interval for a set of data that consists of proportions. i.e. taking a usual confidence interval for normal data would result in the lower confidence interval being negative - which is not possible given the data (which is constrained between
2012 Jun 05
1
Do YOU know an equation for splines (ns)?
Hi, I am looking at the change in N concentration in plant roots over 4 time points and I have fit a spline to the data using ns and lme: fit10 <- lme( N~ns(day, 3), data = rcn10G) I may want to adjust the model a little bit, but for now, let's assume it's good. I get output for the fixed effects: Fixed: N ~ ns(day, 3) (Intercept) ns(day, 3)1 ns(day, 3)2 ns(day, 3)3
2011 Sep 08
0
Consistently printing the name of an object passed to a function; & a data-auditing question
Dear folks-- I always seem to find that I spend more than half my time making sure my input date is in the right form, properly aligned, with no bizarre features. You know the drill: five kinds of missing values, three of them documented. An alpha mistype in one numeric field turns 30,000 numbers into factor levels. SPSS conversion turns 250 factors nicely into R factors, except 3 have levels
2002 May 30
1
hclust.identify problem
Having some problems with using hclust.identify on my data, I revert to trying it out on the example in the help manual. My result is still the same (as with my own data): data(iris) hci <- hclust(dist(iris[,1:4])) plot(hci) testx<-identify.hclust(hci) Error in rect.hclust(x, k = k, x = x$x, cluster = cluster[, k - 1], border = "red") : k must be between 2 and 0
2012 Sep 14
0
[LLVMdev] Problem using llvm::cl::bits class with gcc 4.7
Hi, I'm currently working on the KLEE tool that uses LLVM (2.9 because that's what KLEE currently uses) and in particular I'm having an unexpected problem with the llvm::cl::bits class. I try something like this... enum testx { A,B }; cl::bits<testx> queryLoggingOptions("option",cl::values( clEnumVal(A,"this is a"),
2013 Mar 08
2
Unexpected behaviour of apply()
Hello everyone, Considering the following code sample : ---- indexes <- function(vec) { vec <- which(vec==TRUE) return(vec) } mat <- matrix(FALSE, nrow=10, ncol=10) mat[1,3] <- mat[3,1] <- TRUE ---- Issuing apply(mat, 1, indexes) returns a 10-cell list, as expected. Now if I do: ---- mat[1,3] <- mat[3,1] <- FALSE apply(mat, 1, indexes) ---- I would expect a
2008 Oct 10
0
Problems and bugs in vgam()
Hello R-Users, I have recently run into several problems using vgam() in the VGAM package. I am hoping someone might have some solutions... Briefly, I have been trying to fit GAM models for zero-altered negative binomial models. 1. When fitting smoothed parameters (e.g. s(X, df=2)) changing the degrees-of-freedom has no effect on the level of smoothing (e.g. number of knots for the
2011 Mar 13
4
readMat - how to retrieve the variables
Hello I have a matlab MAT file that contains one single variable: a. The structure of a is as follows: a.river1.flow (flow values) a.river1.date_flow (date) a.river1.precip (precipitation values) a.river1.date_precip a.river2.flow a.river2.date_flow a.river2.precip a.river2.date_precip I have used readMat to load the variable a in R, however I have no idea how readMat translates a. I managed
2011 Sep 15
2
Returning the name of an object passed directly or from a list by lapply
Dear folks: Let?s suppose I want a function to print return the name of the object passed to it. > myname <- function(object) {out<-deparse(substitute(object)); out} This works fine on a single object: > O1 <-c(1:4) > myname(O1) [1] "O1" However it does not work if you use lapply to pass it the same object from a list: > O2 <-c(1:4) > object.list <-