[R] Consistently printing the name of an object passed to a function; & a data-auditing question

2011-09-07 Thread andrewH
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

Re: [R] Searching the console

2011-09-07 Thread andrewH
Thanks, Josh! I'm using TINN-R now, but I have been thinking of switching to ESS. Though perhaps TINN-R has a similar function -- I had been looking for consol functions, rather than editor functions. andrewH -- View this message in context: http://r.789695.n4.nabble.com/Searching-the-console-

Re: [R] Searching the console

2011-09-07 Thread Joshua Wiley
Hi Andrew, If you use http://ess.r-project.org/ just go to the R buffer and type: C-s (CTRL + s) which will let you search through the console. You can use C-M-s (CTRL + ALT + s) if you want to search using regular expressions. Cheers, Josh On Wed, Sep 7, 2011 at 10:03 PM, andrewH wrote: > Is

[R] Searching the console

2011-09-07 Thread andrewH
Is there any way to search the console during an interactive session? I've looked and looked, and can not find one. In some add-on package, maybe? Sorry to be so basic, but help would be greatly appreciated. andrewH -- View this message in context: http://r.789695.n4.nabble.com/Searching-the-c

Re: [R] Seasonal and 11-day subset for zoo object

2011-09-07 Thread Gabor Grothendieck
On Wed, Sep 7, 2011 at 9:59 PM, Katrina Bennett wrote: > I have a zooreg object and I want to be able to generate a value for seasons > and 11-day composites paste it onto my zoo data frame, along with year, > month and days. > > Right now I have the following to work from: > > eg. dat.zoo.mdy <-

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread zhenjiang xu
hmm, frustrating. BTW, unique() works alright. It seems not using deparse() or using it differently On Wed, Sep 7, 2011 at 11:27 PM, William Dunlap wrote: > I don't think you can increase width.cutoff above 500 and > > it isn't an argument to as.character or match. The best > > solutio

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread William Dunlap
I don't think you can increase width.cutoff above 500 and it isn't an argument to as.character or match. The best solution would be to avoid the internal use of deparse when using match() or unique() on lists and to hash the list element directly, but that is a fair bit of work. Bill Dunlap Spotf

Re: [R] suggestion for proportions

2011-09-07 Thread John Sorkin
Correction. It won't work. Please ignore. >>> John Sorkin 9/7/2011 10:41:46 PM >>> Let my try again, but this time with corrected R code: would the following strategy work: numtests <- 2000 # Create a data frame: test1 results from trial 1 # test2 results from trial 2 #

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread zhenjiang xu
I tried converting the elements to strings before, but due to the large data size it took forever to finish with paste(). Is there anyway to set the default width.cutoff longer and pass it to match()? On Wed, Sep 7, 2011 at 10:42 PM, William Dunlap wrote: > match(aList, aList) probably does wha

Re: [R] Very slow assignments

2011-09-07 Thread André Rossi
I populated my object just using as.list(myDataFrame). My problem is that after doing this, all assignments of the other slot (index) become very slow. Thank you for your reply. André Rosi 2011/9/7 William Dunlap > You did not show the code you used to populate your > object, but consider the

Re: [R] Generating data when mean and 95% CI are known

2011-09-07 Thread Ken
R can tell you how many possible answers there are with those givens though: ?Inf Really though, you can get at some information if you are willing to set one of those definitively. I.e. If you set sample size you can 'find' data which match specs but isn't going to be applicable to anything

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread William Dunlap
match(aList, aList) probably does what as.character(aList) does: cut off the character strings at 500 characters (because deparse(x, nlines=1, width.cutoff) requires that width.cutoff<=500) . Try converting the elements to character strings yourself before passing them to match. E.g., ac <- s

Re: [R] suggestion for proportions

2011-09-07 Thread John Sorkin
Let my try again, but this time with corrected R code: would the following strategy work: numtests <- 2000 # Create a data frame: test1 results from trial 1 # test2 results from trial 2 # agree indicagtor if trial1= trial2 (value =1) or #

Re: [R] how to create data.frames from vectors with duplicates

2011-09-07 Thread zhenjiang xu
Thanks for benchmarking them. data.table is indeed worth looking at. On Wed, Sep 7, 2011 at 9:55 PM, Dennis Murphy wrote: > Hi: > > Here are a few informal timings on my machine with the following > example. The data.table package is worth investigating, particularly > in problems where its adva

Re: [R] Generating data when mean and 95% CI are known

2011-09-07 Thread Mark Leeds
Hi: I don't know if this is what you meant but here's a way to cheat and do it. 1) back out the [sigma over sqrt root of n] from the 95 % CI and call it X. 2) then generate data using rnorm(n*, known mean, sigma*) where sigma*/sqrt(n*) = X is satisfied. 3) there will be many solutions to 2) so

Re: [R] suggestion for proportions

2011-09-07 Thread John Sorkin
Would the following strategy work? numtests <- 20 # Create a data frame: test1 results from trial 1 # test2 results from trial 2 # agree indicagtor if trial1= trial2 (value =1) or # trial1<>trial2 (value =0) data <-

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread zhenjiang xu
Now I nailed down the problem, but I am still confused why match() takes the 1st two components and the last two the same. > match(a,a) [1] 1 2 3 1 2 > a [[1]] [1] "YARCTy1-1" "YAR009C" "YBLWTy1-1" "YBL005W-B" "YBRWTy1-2" "YBR012W-B" [7] "YDRCTy1-1" "YDR098C-B" "YDRCTy1-2" "YDR210C-D" "YDRCTy

Re: [R] Generating data when mean and 95% CI are known

2011-09-07 Thread Rolf Turner
On 08/09/11 09:51, Tyler Hicks wrote: Is there a function in R that will generate data from a known mean and 95% CI? I do not know the distribution or sample size of the original data. No. R is wonderful, but it cannot work magic. cheers, Rolf Turner ___

Re: [R] FSelector and RWeka problem

2011-09-07 Thread Yanwei Song
Hi, Here is a follow up, I resolve the problem in another way. " > e <- evaluate_Weka_classifier(p) > print(subset) > print(e$details[1]) > return(e$details[1])" change this lines to " e <- sum(iris$Species == predict(p))/nrow(iris) print(subset) print(e) return(e) It works wel

[R] Seasonal and 11-day subset for zoo object

2011-09-07 Thread Katrina Bennett
I have a zooreg object and I want to be able to generate a value for seasons and 11-day composites paste it onto my zoo data frame, along with year, month and days. Right now I have the following to work from: eg. dat.zoo.mdy <- with(month.day.year(time(dat.zoo)), cbind(dat.zoo, year, month, day,

Re: [R] suggestion for proportions

2011-09-07 Thread csrabak
Em 7/9/2011 16:53, array chip escreveu: Hi all, thanks very much for sharing your thoughts. and sorry for my describing the problem not clearly, my fault. My data is paired, that is 2 different diagnostic tests were performed on the same individuals. Each individual will have a test results fr

Re: [R] how to create data.frames from vectors with duplicates

2011-09-07 Thread Dennis Murphy
Hi: Here are a few informal timings on my machine with the following example. The data.table package is worth investigating, particularly in problems where its advantages can scale with size. library(data.table) dt <- data.table(x = sample(1:50, 100, replace = TRUE), y = sam

Re: [R] read.table truncated data?

2011-09-07 Thread zhenjiang xu
Thanks for the suggestion. I guess that's the only thing I could do On Fri, Aug 26, 2011 at 4:22 AM, Petr PIKAL wrote: > Hi > > > > > Thanks, Jim. quote='' works. And then I found a single quote in each of > > these lines: > > 3262 > > 10403 > > 17544 > > 24685 > > 31826 > > 38967 > > > > None o

Re: [R] how to create data.frames from vectors with duplicates

2011-09-07 Thread zhenjiang xu
Thanks for all your replies. I am using rowsum() and it looks efficient. I hope I could do some benchmark sometime in near future and let people know. Or is there any benchmark result available? On Wed, Aug 31, 2011 at 12:58 PM, Bert Gunter wrote: > Inline below: > > On Wed, Aug 31, 2011 at 9:50

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread zhenjiang xu
Thanks, Bill. match() is nice and efficient. However, I met a problem: My real data is a large _list_ named "read.genes". I found conflict results between match() and unique() - the lengths of the outcomes are different (and my final result are wrong too). I suspect that some different list compon

[R] FSelector and RWeka problem

2011-09-07 Thread Yanwei Song
Hi all, Last post didn't give the plain format: I was trying to combine RWeka and FSelector, and do the forward feature selection with J48/C5.4 decision tree: Here is the code: #== library(RWeka) library(FSelector) library(rpart)

Re: [R] Very slow assignments

2011-09-07 Thread Rolf Turner
On 08/09/11 12:05, William Dunlap wrote: You did not show the code you used to populate your object, but consider the following ways to make as.list(1:5) via repeated assignments: > system.time( { z0<- list() ; for(i in 1:5)z0[i]<- list(i) } ) user system elapsed 13.340.

Re: [R] Very slow assignments

2011-09-07 Thread William Dunlap
You did not show the code you used to populate your object, but consider the following ways to make as.list(1:5) via repeated assignments: > system.time( { z0 <- list() ; for(i in 1:5)z0[i] <- list(i) } ) user system elapsed 13.340.00 13.42 > system.time( { z1 <- list() ;

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 6:31 PM, dadrivr wrote: Here's an example: id <- c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24, 24,24,25,25,25,26,26,26) age <- rep(c(30,36,42),10) outcome <- c(12,17,10,5,5,2,NA,NA,NA,8,6,5,11,13,10,15,11,15,13,NA,9,0,0,0,20, 14,1

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread dadrivr
Here's an example: > id <- c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24, > 24,24,25,25,25,26,26,26) > age <- rep(c(30,36,42),10) > outcome <- > c(12,17,10,5,5,2,NA,NA,NA,8,6,5,11,13,10,15,11,15,13,NA,9,0,0,0,20, > 14,16,1,2,2) > mydata <- as.data.frame(c

[R] Generating data when mean and 95% CI are known

2011-09-07 Thread Tyler Hicks
Is there a function in R that will generate data from a known mean and 95% CI? I do not know the distribution or sample size of the original data. Cheers, Tyler L Hicks PhD Student Washington State University - Vancouver E-mail: tyler_hi...@wsu.edu Website: www.thingswithwings.org "Back of

[R] Very slow assignments

2011-09-07 Thread André Rossi
I'm creating an object of a S4 class that has two slots: ListExamples, which is a list, and idx, which is an integer (as the code below). Then, I read a data.frame file with 1 (ten thousands) of lines and 10 columns, do some pre-processing and, basically, I store each line as an element of a l

[R] Question about model selection for glm -- how to select features based on BIC?

2011-09-07 Thread Andra Isan
Hi All,  After fitting a model with glm function, I would like to do the model selection and select some of the features and I am using the "step function" as follows:  glm.fit <- glm (Y ~ . , data = dat, family = binomial(link=logit)) AIC_fitted = step(glm.fit, direction = "both") I was wonderin

Re: [R] rgl 'how-to's

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 6:07 PM, Dale Coons wrote: Doing a visual graphic and trying to make it "pretty" Here's simple chart to play with: library(rgl) dotframe<- data.frame(x=c(0,7,0,0,-7,0),y=c(0,0,7,0,0,-7),z=c(7,0,0,-7,0,0)) dotframe plot3d(dotframe$x,dotframe$y,dotframe$z, radius=3, type='

Re: [R] ggplot2-Issue placing error bars behind data points

2011-09-07 Thread Dennis Murphy
Hi: For your test data, try this: # Result of dput(NerveSurv) NerveSurv <- structure(list(Time = c(0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5 ), SAP = c(1, 1.04, 1.04, 1.06, 1.04, 1.22, 1.01, 1, 1.01, 1.01, 1.06, 1.01, 0.977, 0.959, 1, 1.0

[R] storage and single-precision

2011-09-07 Thread Mike Miller
I'm getting the impression from on-line docs that R cannot work with single-precision floating-point numbers, but that it has a pseudo-mode for single precision for communication with external programs. I don't mind that R is using doubles internally, but what about storage? If all I need to s

[R] rgl 'how-to's

2011-09-07 Thread Dale Coons
Doing a visual graphic and trying to make it "pretty" Here's simple chart to play with: library(rgl) dotframe<-data.frame(x=c(0,7,0,0,-7,0),y=c(0,0,7,0,0,-7),z=c(7,0,0,-7,0,0)) dotframe plot3d(dotframe$x,dotframe$y,dotframe$z, radius=3, type='s',col=c('red','green','blue','purple','orange','gra

Re: [R] Application of results from smooth.spline outside R

2011-09-07 Thread Spencer Graves
Hi, Jesper: Where "Outside R" do you want to use it? There are R interfaces to many other software packages, and many that cannot easily link to R can link to Fortran. You could use library(sos) to search for R packages to connect to whatever. Hope this helps. Spe

Re: [R] finding events in a time duration.

2011-09-07 Thread Vineet Shukla
Hi Jeff, My question is not related with SQL. I have all the data available in a csv file. I am looking for R algorithm where can specify a time period and then R essentially uses this time period as a sliding window for all the event-time stamps and gives a significant distribution of occ

Re: [R] Editing the variables attributes section in the netCDF header of netCDF files created using the package ncdf.

2011-09-07 Thread David William Pierce
On Wed, Sep 7, 2011 at 2:25 PM, Ross Maidment < r.i.maidm...@pgr.reading.ac.uk> wrote: > Hi, > > I am using the package ncdf to create netCDF files and I want to mimic the > the header of an exiting netCDF file created outside of R. Below is what the > existing header looks like (part of it that i

Re: [R] finding events in a time duration.

2011-09-07 Thread R. Michael Weylandt
I think (no promises) roll.apply() from the zoo package with sum can count occurrences in whatever time period. Then use a logical test to identify sufficiently active periods. Hope this helps, Michael Weylandt On Sep 7, 2011, at 4:07 PM, Vineet Shukla wrote: > Hi, > > Premises: I have a d

Re: [R] ggplot2-Issue placing error bars behind data points

2011-09-07 Thread Jeff Newmiller
Add geom_errorbar() before adding geom_point() ? --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Em

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 4:49 PM, dadrivr wrote: David Winsemius wrote: What "mean summary line"? I count 8 lines and that matches the number if id's with complete data. Yea, I don't know why there is no mean summary line showing up. I requested it in the interaction.plot statement (fun = mea

Re: [R] finding events in a time duration.

2011-09-07 Thread Jeff Newmiller
You could phrase this in most dialects of SQL, but you don't say what kind of database you are using and this is not a SQL help list. You could also look at the rollapply function in the zoo package. --- Jeff Newmiller The ..

[R] ggplot2-Issue placing error bars behind data points

2011-09-07 Thread Nathan Miller
Hi all, This seems like a basic problem, but no amount of playing with the code has solved it. I have a time-series data set like that shown below (only longer) and am seeking to plot the data with filled, circular points and error bars. I would like the error bars to be behind the points otherwis

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread dadrivr
David Winsemius wrote: > What "mean summary line"? I count 8 lines and that matches the number > if id's with complete data. Yea, I don't know why there is no mean summary line showing up. I requested it in the interaction.plot statement (fun = mean), and I don't get any errors. Any ideas? -

[R] Editing the variables attributes section in the netCDF header of netCDF files created using the package ncdf.

2011-09-07 Thread Ross Maidment
Hi, I am using the package ncdf to create netCDF files and I want to mimic the the header of an exiting netCDF file created outside of R. Below is what the existing header looks like (part of it that is different): netcdf ccd1984_05_08 { dimensions: lat = 1974 ; lon = 1894 ;

[R] finding events in a time duration.

2011-09-07 Thread Vineet Shukla
Hi, Premises: I have a database which contain the list of events and their time stamps (This is a Unix time stamps) What I want to do : I want know how much is the maximum occurrence of this in any a time period of 7 days or does a event occur es more than "N" (say 5) times in a period of 7 days

Re: [R] access objects

2011-09-07 Thread Berry Boessenkool
Thanks! That's exactly it. get gets it ;-) Berry From: michael.weyla...@gmail.com Date: Wed, 7 Sep 2011 14:54:48 -0500 Subject: Re: [R] access objects To: berryboessenk...@hotmail.com CC: r-help@r-project.org The get() function should get you where you need. Michael Weylandt On Wed, Sep 7

Re: [R] Application of results from smooth.spline outside R

2011-09-07 Thread Jesper
Hi Jean, Thanks for the reply.. Using your suggestion, I end up in in the source code (Fortran 77 i believe). At first look, it seems a bit more tedious to implement than I expected. -- View this message in context: http://r.789695.n4.nabble.com/Application-of-results-from-smooth-spline-outsid

[R] Fwd: FSelector and RWeka problem

2011-09-07 Thread Yanwei Song
Hi all, Although I sent the mail to Piotr, the author of FSelector, it should be better to ask here to let others know. Yanwei Begin forwarded message: From: Yanwei Song Date: September 7, 2011 4:41:58 PM EDT To: p.roman...@stud.elka.pw.edu.pl Subject: FSelector and RWeka problem Dear P

Re: [R] suggestion for proportions

2011-09-07 Thread array chip
Hi all, thanks very much for sharing your thoughts. and sorry for my describing the problem not clearly, my fault. My data is paired, that is 2 different diagnostic tests were performed on the same individuals. Each individual will have a test results from each of the 2 tests. Then in the end,

Re: [R] reporting ANOVA for nested models

2011-09-07 Thread peter dalgaard
On Sep 7, 2011, at 20:57 , zugi young wrote: > I have the following results for an ANOVA comparing two nested models. I > wasn't sure how I am supposed to report this result in the area of > psychology. Specifically, am I supposed to report the DF's or just the F > ratio? I could manually calcula

Re: [R] Using substitute on a function parameter

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 5:20 PM, Saptarshi Guha wrote: Hello, I would like to write a function where substitute operates on the parameter, but ... Expression = function(o,l) substitute(o, l) Expression({x=.(FOO)}, list(FOO=2)) o How do i get substitute to work on the contents of o. I sugge

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread Dennis Murphy
Hi: Having just seen your follow-up question, here's how it could be done in ggplot2 or lattice: # ggplot2 version: ggplot(w, aes(x = age, y = outcome)) + geom_line(aes(group = .id)) + stat_summary(fun.y = 'mean', geom = 'line', color = 'blue', size = 2) # lattice version: xyplot(outcome ~ ag

Re: [R] Using substitute on a function parameter

2011-09-07 Thread William Dunlap
I have used do.call("substitute", ...) to work around the fact that substitute does not evaluate its first argument: R> z <- quote(func(arg)) R> do.call("substitute", list(z, list(func=quote(myFunction), arg=as.name("myArgument" myFunction(myArgument) S+'s substitute (following S versi

[R] Using substitute on a function parameter

2011-09-07 Thread Saptarshi Guha
Hello, I would like to write a function where substitute operates on the parameter, but ... > Expression = function(o,l) substitute(o, l) > Expression({x=.(FOO)}, list(FOO=2)) o How do i get substitute to work on the contents of o. Regards Saptarshi _

Re: [R] reporting ANOVA for nested models

2011-09-07 Thread Daniel Malter
fit1, the unrestricted model, includes 1 more regressor than fit2, the restricted model. Testing the models against each other means that fit2 is "equal to" fit1, assuming that the coefficient on the additional regressor that is included in fit1 is restricted to zero. Your F-test is thus whether t

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread Dennis Murphy
Hi: Your code doesn't work, but if you want to do spaghetti plots, they're rather easy to do in ggplot2 or lattice. The first problem you have is that one group in your test data has all NA responses, so by() or any other groupwise summarization function is going to choke unless you give it a way

Re: [R] Testing non-exhaustive Null and Alternative Hypothesis

2011-09-07 Thread Duncan Murdoch
On 07/09/2011 3:46 PM, Michael Grant wrote: I wish to test the hypothesis of mu equal to or less than 5 against the specific alternative mu equal to or greater than 7. I am unable to find how to persuade R to do this with any function (e.g. t.test). Suggestions? According to the standard hy

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 3:46 PM, dadrivr wrote: Here's an example: /id <- c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24, 24,24,25,25,25,26,26,26) age <- rep(c(30,36,42),10) outcome <- c(12,17,10,5,5,2,NA,NA,NA,8,6,5,11,13,10,15,11,15,13,NA,9,0,0,0,20, 14,1

Re: [R] access objects

2011-09-07 Thread R. Michael Weylandt
The get() function should get you where you need. Michael Weylandt On Wed, Sep 7, 2011 at 12:53 PM, Berry Boessenkool < berryboessenk...@hotmail.com> wrote: > > > hi, > > say I have consecutively numbered objects obj1, obj2, ... in my R > workspace. > I want to acces one of them inside a functio

Re: [R] Subsetting does not remove unwanted data in table

2011-09-07 Thread Ben Bolker
Scott Bearer TNC.ORG> writes: > > Dear all, > > This relatively routine analysis has left me frustrated and in a rut. I > have a dataset (data1), which I subset in order to remove rows where > HabitatDensity="Med". This dataset looks correct when I call it up, > however, when I create a table

[R] Imposing Feller condition using project constraint in spg

2011-09-07 Thread Kristian Lind
Dear R-users, I'm running a maximization problem in which I want to impose a condition on the relationship between 2 parameters. The condition is that w[4] = (1+eps)/(2*w[1]), or equivalently w[4]*w[1] = (1+eps)/2 , where eps is some small positive constant. I've been trying to formulate a functi

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread dadrivr
Here's an example: /id <- c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24, 24,24,25,25,25,26,26,26) age <- rep(c(30,36,42),10) outcome <- c(12,17,10,5,5,2,NA,NA,NA,8,6,5,11,13,10,15,11,15,13,NA,9,0,0,0,20, 14,16,1,2,2) mydata <- as.data.frame(cbind(id,age,ou

[R] randomForest memory footprint

2011-09-07 Thread John Foreman
Hello, I am attempting to train a random forest model using the randomForest package on 500,000 rows and 8 columns (7 predictors, 1 response). The data set is the first block of data from the UCI Machine Learning Repo dataset "Record Linkage Comparison Patterns" with the slight modification that I

[R] access objects

2011-09-07 Thread Berry Boessenkool
hi, say I have consecutively numbered objects obj1, obj2, ... in my R workspace. I want to acces one of them inside a function, with the number given as an argument. Where can I find help on how to do that? Somebody must have been trying to do this before... Some keywords to start a search ar

[R] Testing non-exhaustive Null and Alternative Hypothesis

2011-09-07 Thread Michael Grant
I wish to test the hypothesis of mu equal to or less than 5 against the specific alternative mu equal to or greater than 7. I am unable to find how to persuade R to do this with any function (e.g. t.test). Suggestions? Michael Grant [[alternative HTML version deleted]] __

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread dadrivr
Sorry, I thought the link would work for people because it is a public link and it works for me when I run it in R. Anyways, here is an example set of data that I am having trouble with: /id <- c(230017,230017,230017,230018,230018,230018,230019,230019,230019,230020,230020, 230020,230021,2

Re: [R] Possible to access a USB volume by name in windows

2011-09-07 Thread Gene Leynes
Thank you. This is a nice trick, and it works fine for my needs. It's surprising that there isn't a simple way to get to the drive name. On Tue, Sep 6, 2011 at 10:41 PM, Joshua Wiley wrote: > Hi, > > This comes with absolutely no guarantees (and a good recommendation to > be cautious), but you

[R] Subsetting does not remove unwanted data in table

2011-09-07 Thread Scott Bearer
Dear all, This relatively routine analysis has left me frustrated and in a rut. I have a dataset (data1), which I subset in order to remove rows where HabitatDensity="Med". This dataset looks correct when I call it up, however, when I create a table out of the new subset (data2), my table contin

[R] rpart/tree issue

2011-09-07 Thread Brian Jensvold
I am trying to create a classification tree using either tree or rpart but when it comes to plotting the results the formatting I get is different than what I see in all the tutorials. What I would like to see is the XX/XX format but all I get is a weird decimal value. I was also wondering how yo

Re: [R] Possible to access a USB volume by name in windows

2011-09-07 Thread Joshua Wiley
Well that is really on the windows end, not the R end (which may not make it any less surprising). I would not be surprised if there was an easier way using .net or vbs which I get the sense is partly where some things are going (e.g., with the so-called PowerShell), but I am not terribly fami

[R] reporting ANOVA for nested models

2011-09-07 Thread zugi young
I have the following results for an ANOVA comparing two nested models. I wasn't sure how I am supposed to report this result in the area of psychology. Specifically, am I supposed to report the DF's or just the F ratio? I could manually calculate the degrees of freedoms, but there must be a reason

Re: [R] Hessian matrix issue

2011-09-07 Thread Ravi Varadhan
"However, it is not known whether the standard errors obtained from this Hessian are asymptotically valid." Let me rephrase this. I think that as a measure of dispersion, the standard error obtained using the augmented Lagrangian algorithm is correct. However, what is *not known* is the asymp

[R] Hessian matrix issue

2011-09-07 Thread Ravi Varadhan
Yes, numDeriv::hessian is very accurate. So, I normally take the output from the optimizer, *if it is a local optimum*, and then apply numDeriv::hessian to it. I, then, compute the standard errors from it. However, it is important to know that you have obtained a local optimum. In fact, you

[R] 3-Way Crosstab using survey package

2011-09-07 Thread Rachel Licata
Hello, I am wondering if it is possible, or what the correct way to code a three-way crosstab in R using the survey package? I have been using the following code to complete two way crosstabs, but have not seen any three-way code. Two-Way: svyby(~factor(a), ~factor(b), data, svymean) Thanks! Rac

Re: [R] error building package: packaging into .tar.gz failed

2011-09-07 Thread Juliet Hannah
To follow up (because I received a few emails off-list), things work now. I'm not sure what I did differently. In case it is helpful: I reinstalled R tools, and edited by path so that C:\Rtools\bin;C:\Rtools\perl\bin;C:\Rtools\MinGW\bin;C:\Program files\R\R-2.13.1\bin;C:\Program Files\HTML Help

Re: [R] Generalizing call to function

2011-09-07 Thread Berend Hasselman
. wrote: > > Hello guys, > > I would like to ask for help to understand what is going on in > "func2". My plan is to generalize "func1", so that are expected same > results in "func2" as in "func1". Executing "func1" returns... > > 0.25 with absolute error < 8.4e-05 > > But for "func2" I get..

Re: [R] How does one start R within Emacs/ESS with root privileges?

2011-09-07 Thread Spencer Graves
Under Vista and Windows 7, I install R in a local directory "pgms" so I never have to worry about permissions. Under Linux, I use "su" not "sudo". Then I call R and install.packages. Then I quit R and "su" and continue with what I want. hope this helps. Spencer On 9/7/2011 5:11 AM, Karl

Re: [R] process id of an R script

2011-09-07 Thread Charles Berry
Mikkel Grum yahoo.com> writes: > > I have a script that runs as a cron job every minute (on Ubuntu 10.10 and R 2.11.1), querying a database for new > data. Most of the time it takes a few seconds to run, but once in while it takes more than a minute and the next > run starts (on the same data) b

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 9:45 AM, dadrivr wrote: Bump, please help! When I encounter one of these Nabble "bump" messages doing my moderation duties I simply discard it. This is not a website. This is a mailing list. If you didn't get an answer it suggests that your example was not sufficie

Re: [R] reshaping data

2011-09-07 Thread B77S
The terminology (melt, cast, recast) just isn't intuitive to me; but I understand how to use melt now. Thanks! Justin Haynes wrote: > > look at the melt function in reshape, specifically ?melt.data.frame > > require(reshape) > Raw.melt<-melt(RawData,id.vars='Year',variable_name='Month') > >

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 9:46 AM, dadrivr wrote: Can anybody help me with this? Your chances of a meaningful reply would increase considerably if you first read the Posting Guide and also followed the other guidance seen at the bottom of every rhelp posting. -- View this message in context:

Re: [R] What happens if we give a factor as an index at a list?

2011-09-07 Thread Jean V Adams
Varsha Agrawal wrote on 09/07/2011 05:18:10 AM: > > The code looks like this: > L1=list(a=1,b=2,c=3) > f1=as.factor(c) > L1[[f1]] returns 1 > > What happens if we give a factor as an index at a list? > L1=list(a=1,b=2,c=3) f1=as.factor(L1$c) L1[[f1]] When you use a factor (e.g., f1, corrected

Re: [R] predictive modeling and extremely large data

2011-09-07 Thread Steve Lianoglou
Hi, On Wed, Sep 7, 2011 at 5:25 AM, Divyam wrote: > Hi, > > I am new to R and here is what I am doing in it now. I am using machine > learning technique (svm) to do predictive modeling. The data that I am using > is one that is bound to grow perpetually. what I want to know is, say, I fed > in a

Re: [R] (no subject)

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 6:04 AM, Varsha Agrawal wrote: The code looks like this: L1=list(a=1,b=2,c=3) f1=as.factor(c) L1[[f1]] returns 1 What happens if we give a factor as an index at a list? In a virgin session of R there would be no 'c' for the second line to work with. And since 'c' is a fu

Re: [R] suggestion for proportions

2011-09-07 Thread Viechtbauer Wolfgang (STAT)
Indeed, the original post leaves some room for interpretation. In any case, I hope the OP has enough information now to figure out what approach is best for his data. Best, Wolfgang > -Original Message- > From: Bert Gunter [mailto:gunter.ber...@gene.com] > Sent: Wednesday, September 07

Re: [R] Generalizing call to function

2011-09-07 Thread Jean V Adams
Try this: funa <- function(n, y, a, rate, samp) { lambda <- a * n dexp(n, rate) * do.call(paste("d", samp, sep=""), y, lambda) } funb <- function(y, a, rate, samp) { integrate(f1, 0, Inf, y, a, rate) } funb(1, 0.1, 0.1, "pois") Jean > > Hello guy

Re: [R] (no subject)

2011-09-07 Thread R. Michael Weylandt
Is this meant to be a follow up to something? In short, the answer to your question is how factors are encoded as integers in R. If you run something similar to this code (except that actually runs) you'll note that as.numeric(f1) = 1. Michael On Wed, Sep 7, 2011 at 5:04 AM, Varsha Agrawal wrote

Re: [R] reshaping data

2011-09-07 Thread Justin Haynes
look at the melt function in reshape, specifically ?melt.data.frame require(reshape) Raw.melt<-melt(RawData,id.vars='Year',variable_name='Month') there is an additional feature in the melt function for handling na values. names(Raw.melt)[3]<-'CO2' > head(Raw.melt) Year MonthCO2 1 1958

[R] Reshaping data from wide to tall format for multilevel modeling

2011-09-07 Thread dadrivr
Hi, I'm trying to reshape my data set from wide to tall format for multilevel modeling. Unfortunately, the function I typically use (make.univ from the multilevel package) does not appear to work with unbalanced data frames, which is what I'm dealing with. Below is an example of the columns of a

[R] process id of an R script

2011-09-07 Thread Mikkel Grum
I have a script that runs as a cron job every minute (on Ubuntu 10.10 and R 2.11.1), querying a database for new data. Most of the time it takes a few seconds to run, but once in while it takes more than a minute and the next run starts (on the same data) before the previous one has finished. In

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread dadrivr
Can anybody help me with this? -- View this message in context: http://r.789695.n4.nabble.com/Change-properties-of-line-summary-in-interaction-plot-tp3788614p3796133.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread dadrivr
Bump, please help! -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-by-statement-for-spaghetti-plots-tp3788536p3796131.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:/

[R] Overall SSR in plm package

2011-09-07 Thread Igors
Dear all, I estimate Fixed-effects model. Since it use "within" transformation, it also reports "within" SSR in summary report. The problem is that I need overall SSR. How can I quickly compute it? Thanks in advance! Best wishes, Igors -- View this message in context: http://r.789695.n4.n

Re: [R] r-help volcano plot

2011-09-07 Thread Duny
Ben - I'm sorry, you're right! The following website shows how to make a volcano plot using ggplot2. http://bioinformatics.knowledgeblog.org/2011/06/21/volcano-plots-of-microarray-data/ Enjoy! Anna -- View this message in context: http://r.789695.n4.nabble.com/r-help-volcano-plot-tp3792651p3795

Re: [R] function censReg in panel data setting

2011-09-07 Thread Igors
Dear Arne, I have sent you an e-mail to your e-mail at gmail.com. There I have attached my data set and the code for this particular problem. I hope to hear from you soon. Many thanks in advance! Igors -- View this message in context: http://r.789695.n4.nabble.com/function-censReg-in-panel-d

[R] What happens if we give a factor as an index at a list?

2011-09-07 Thread Varsha Agrawal
The code looks like this: L1=list(a=1,b=2,c=3) f1=as.factor(c) L1[[f1]] returns 1 What happens if we give a factor as an index at a list? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

[R] (no subject)

2011-09-07 Thread Varsha Agrawal
The code looks like this: L1=list(a=1,b=2,c=3) f1=as.factor(c) L1[[f1]] returns 1 What happens if we give a factor as an index at a list? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

  1   2   >