| To: | S-News <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | Re: Changing a read-only data frame to read/write |
| From: | TzamouranisY@LouisDreyfus.com |
| Date: | Mon, 12 Sep 2005 08:52:38 -0400 |
| Cc: | "Jordan, Paul" <paul.jordan@roche.com>, SmithSJ@mar.dfo-mpo.gc.ca, BBiggerstaff@cdc.gov |
|
Thank you all for your suggestions (listed below). First off, the problem with creating the read-only frame was an unexpected "named" class for one of the columns of my data frame, as I noted before. I am not clear why "named" and not "double", given that all the items that rowMeans, colMeans, min, max and mean operated on to create the additional columns in the original frame were doubles. Wrapping the results of these functions with an "as.double" resolved the issue and the data frame was now read/write. Steve Smith (and others) suggested writing a function to check that none of the columns were of class named One such function, contributed by Brad Biggerstaff, would be: if (any(nmd <- sapply(db, class) == "named")) db <- convert.col.type(db, which(nmd),"numeric") Thanks to all for their suggestions (I hope that I have not skipped any names but some email glitch has cost me some loss of communications which I tried to fill through notes I had). Yannis Tzamouranis -------------------- Paul's suggestion: attach(X,pos=2) database.status(where=2) <- "readwrite"
-----Original Message----- |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | absolutele the fastest computer for S=, Xao Ping |
|---|---|
| Next by Date: | finding substrings, Dave Evens |
| Previous by Thread: | Re: Changing a read-only data frame to read/write, Wim Kimmerer |
| Next by Thread: | Re: Course***R/Splus Programming Techniques***New York, September 2005, paul king |
| Indexes: | [Date] [Thread] [Top] [All Lists] |