Re: [R] categorizing data
I'm sorry if this has come across as a homework assignment!I was trying to provide a simple example. There are actually 38323 rows of data, each row is an observation of the percent that each of those veg types occupies in a spatial unit - where each line adds to 90 - and values are different every line. I need a way to categorize the data, so I can reduce the number of unique observations. So instead of 38323 unique observations - I can reduce this to X number of High/Med/Low X number of Med/Low/High X number of Low/High/Med etc... for all combinations I hope this makes it more clear.. thank you all for your responses, JC On Sun, May 29, 2022 at 1:16 PM Avi Gross via R-help wrote: > Tom, > You may have a very different impression of what was asked! LOL! > Unless Janet clarifies what seems a bit like a homework assignment, it > seems to be a fairly simple and straightforward assignment with exactly > three rows/columns and asking how to replace the variables, in a sense, by > finding the high and low and perhaps thus identifying the medium, but to do > this for each row without changing the order of the resulting data.frame. > I note most techniques people have used focus on columns, not rows, but an > all-numeric data.frame can be transposed, or converted to a matrix and > later converted back. > If this is HW, the question becomes what has been taught so far and is > supposed to be used in solving it. Can they make their own functions > perhaps to be called three times, once per row or column, to replace that > row/column, or can they use some form of loop to iterate over the columns? > Does it need to sort of be done in place or can they create gradually a > second data.frame and then move the pointer to it and lots of other similar > ideas. > I am not sure, other than as a HW assignment, why this transformation > would need to be done but of course, there may well be a reason. > I note that the particular example shown just happens to create almost a > magic square as the sum of rows and columns and the major diagonal happen > to be 0, albeit the reverse diagonal is all 50's. > Again, there are many solutions imaginable but the goal may be more > specific and I shudder to supply one given that too often questions here > are not detailed enough and are misunderstood. In this case, I thought I > understood until I saw what Tom wrote! LOL! > I will add this. Is it guaranteed that no two items in the same row are > never equal or is there some requirement for how to handle a tie? And note > there are base R functions called min() and max() and you can ask for > things like: > > if ( current == min(mydata[1,])) ... > > > -Original Message- > From: Tom Woolman > To: Janet Choate > Cc: r-help@r-project.org > Sent: Sun, May 29, 2022 3:42 pm > Subject: Re: [R] categorizing data > > > Some ideas: > > You could create a cluster model with k=3 for each of the 3 variables, > to determine what constitutes high/medium/low centroid values for each > of the 3 types of plant types. Centroid values could then be used as the > upper/lower boundary ranges for high/med/low. > > Or utilize a histogram for each variable, and use quantiles or > densities, etc. to determine the natural breaks for the high/med/low > ranges for each of the IVs. > > > > > On 2022-05-29 15:28, Janet Choate wrote: > > Hi R community, > > I have a data frame with three variables, where each row adds up to 90. > > I want to assign a category of low, medium, or high to the values in > > each > > row - where the lowest value per row will be set to 10, the medium > > value > > set to 30, and the high value set to 50 - so each row still adds up to > > 90. > > > > For example: > > Data: Orig > > tree shrub grass > > 3211 47 > > 23 41 26 > > 49 23 18 > > > > Data: New > > tree shrub grass > > 30 10 50 > > 10 5030 > > 50 3010 > > > > I am not attaching any code here as I have not been able to write > > anything > > effective! appreciate help with this! > > thank you, > > JC > > > > -- > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >
[R] turning a list of objects into columns
Hi, I have a data frame that looks something like this (but much longer): df scen streamflowtrans evap psn 1 0.019234 1.658967 0.002883 0.002391 1 0.019027 1.661192 0.002844 0.003142 2 0.018821 1.695623 0.003192 0.002167 2 0.018619 1.503481 0.002536 0.003059 3 0.018425 0.08 1.880355 0.002592 3 0.018369 0.100551 2.225793 0.006642 i want to end up with something like this (for each variable - streamflow, trans, evap, psn). using the variable trans here as an example: trans1trans2 trans3 1.658967 1.695623 0.08 1.661192 1.503481 0.100551 so that each variable (streamflow, trans, evap, psn) is in a separate column based on the scen #. i used split which created a list for each scen #: test = split(df[,,], df$scen) as well as test = as.data.frame(split(df[,,], df$scen) which did separate out each scen instance, but in lists, i.e.: $`1` [1] 1.658967 1.661192 $`2` [1] 1.695623 1.503481 $`3` [1] 0.08 0.100551 if i use as.data.frame, i.e.: test2 = as.data.frame(test) it seems like it puts it into columns, i.e.: X1 X2 X3 1 1.658967 1.695623 0.08 2 1.661192 1.503481 0.100551 however, if i look at one of the variables, it still presents as a list, even though the class is numeric: head(tmp2$X1) [1] 1.658967 1.661192 can anyone tell me how to get this into the format i want - where each variable for each scen # is in it's own column in a data frame? thank you, Janet -- Tague Team Lab Manager 1005 Bren Hall UCSB, Santa Barbara, CA. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] splitting a column of data into multiple columns
Hello R community, I have a data frame that has multiple observations in a single column that I would like to break into multiple columns. The data looks something like this: scen trans evap flow 1 1.10.10.09 1 1.20.20.10 1 1.30.30.20 2 2.10.10.09 2 2.20.20.10 2 2.30.30.20 3 3.10.10.09 3 3.20.20.10 3 3.30.30.20 the column scen runs from 1 through 500, and each scen # contains 1461 rows - i.e. there are 1461 observations for scen1, 1461 observations for scen2, etc... i want to split the trans, evap, and flow columns out by scen #, so that i end up with something like: trans1 trans2trans3 1.1 2.11.1 1.2 2.23.2 1.3 2.33.3 and same for the other variables. thought i could use the separate command to do this, but either not the right approach or i am not executing it properly. thank you for any assistance, Janet -- Tague Team Lab Manager 1005 Bren Hall UCSB, Santa Barbara, CA. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] pulling recessions out of a hydrograph
Dear R community, I'm hoping someone out there has perhaps done this and can share their code and/or expertise with me. I need to pull recession periods out of a hydrograph - can anyone help me with this? I want to create a subset from streamflow data that consists of just the recession curves - the decreasing runoff after the passage of a peak flow. would really appreciate any help on this! Janet -- Tague Team Lab Manager 1005 Bren Hall UCSB, Santa Barbara, CA. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Online courses in R from Statistics.com
Perhaps you could circulate this? *Online courses in R from Statistics.com* *Basic programming courses: * - R Programming - Intro 1 http://www.statistics.com/R-Prog-Intro-1 (Dr. Paul Murrell, instructor - core development team for R and author of *R Graphics *and *Introduction to Data Technologies*) This course introduces the basic concepts in computer programming via R - it is for those who have had little or no experience in programming. Students will learn how to get going in R from the beginning, understand file formats and basic R syntax, and learn about using text editors to write code. They will learn how to read in files, use symbols and assignments, and iterate simple loops. The course closes with discussion of data structures and subsetting. - R Programming - Intro 2 http://www.statistics.com/r-prog-intro-2/ (Mr. Joris Mays, instructor - coauthor of *R for Dummies*) This course continues the introduction to R programming. Students will learn how R works with numeric vectors and special values, and how to deal with special values. They will start working with R to handle text data, and learn about regular expressions, dates, classes and generic functions, as well as matrices, data frames and lists. *Beyond basic programming:* For those who have been working and using R - the instructor for both of these courses is Dr. Olivia Lau from Google. - R Programming - Intermediate http://www.statistics.com/r-courses/course-catalog/R-Prog-Interm/ (One year of daily R use required before taking this course) This course is intended for experienced data analysts looking to unlock the power of R. It provides a systematic overview of R as a programming language, emphasizing good programming practices and the development of clear, concise code. After completing the course, students should be able to manipulate data programmatically using R functions of their own design. - R Programming - Advanced http://www.statistics.com/r-courses/r-program-adv/ (Two years of daily R use required before taking this course) This course covers key concepts for writing advanced R code, emphasizing the design of functional and efficient code. It will set students down the road to mastering the intricacies of R. After completing the course, students should be able to read, understand, modify, and create complex functions to perform a variety of tasks. *Other topic specific courses in R:We have a full curriculum of courses in R (Graphics in R, Mapping in R, Spatial Analysis in R, more). This page groups and describes our R courses:http://www.statistics.com/r-courses/ http://www.statistics.com/r-courses/All courses include:* - Expert instructors who answer questions on a daily basis - Work on practical exercises and individualized feedback - Class size which allows interaction with instructor and fellow students We specialize in personal attention and value pricing. Each course lasts 4 weeks and consists of readings, supplemental materials, exercises, and a private discussion forum with fellow students and the instructor. There are no set hours to be online, and we estimate the workload to be about 15 hours per week. This is not a 'MOOC' (massive open online course) -- enrollment is limited, and the instructor will respond to each question that you ask. *Pricing:* Depending on how many participants and how many courses you are interested in, we can offer an institutional rate. The commercial price for the R Programming courses ranges between $549/person for the intro courses to $629/person for the advanced/ topic focused courses. Each course has a text requirement which can be viewed under the requirements tab of each course description page. If you need help with this, just let me know and I can put a chart together for you. -Janet Janet Dobbins Vice President of Marketing and Communications 612 N. Jackson St. Arlington, VA 22201 703.431.3874 - mobile 703.522.5410 - office 703.522.5846 - fax janet.dobbins1 - skype jdobb...@statistics.com Follow us on Facebook https://www.facebook.com/pages/statisticscom-The-Institute-for-Statistics-Education/153157148097998 , Twitter https://twitter.com/statisticscom, LinkedIn http://www.linkedin.com/company/statistics-com-the-institute-for-statistics-education?trk=hb_tab_compy_id_1737759 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Using Moran.I
Dear R community, i am attempting to use Moran.I for the first time, and am not quite sure on the inputs needed i have loaded the ape library. i have a data frame that includes concentrations of nutrients (no3, nh4, po4) and the percentage of different land use types (urb, ag, ud, comm, sr, dp, park) contributing to the locations where the measurements were taken. it (fwr) looks like this (but longer): fwr no3 nh4po4 urb ag ud comm sr dp park 1 558.77 10.79 147.95 0.50 0.09 0.37 0.17 0.15 0.18 0.05 2 403.70 9.27 25.11 0.49 0.09 0.37 0.16 0.16 0.17 0.05 3 365.77 9.61 127.22 0.46 0.09 0.40 0.15 0.15 0.16 0.04 4 93.95 1.78 11.34 0.45 0.08 0.42 0.13 0.18 0.14 0.06 5 63.20 21.44 47.17 0.47 0.08 0.40 0.13 0.19 0.15 0.06 6 14.80 4.47 27.06 0.49 0.07 0.38 0.13 0.21 0.15 0.06 i was asked to do multiple regression, and plot the residuals: no3.mr = lm(no3 ~ urb+ag+ud+comm+sr+dp+park) then asked to do a Moran's I on the residuals. i am not sure about the input necessary to do a Moran's I. do i need coordinate locations? or/and how do i assign the weights? i think i assign the weights to the land use types - how would i use the results of the multiple regression (no3.mr) to perform the Morans.I on the residuals? thank you for any assistance, Janet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] function completing properly
Hi R community, i created a function (mkdate) as follows: mkdate = function(x) { x$date = as.Date(paste(x$year, x$month, x$day, sep=-)) x$wy = ifelse(x$month =10, x$year+1, x$year) x$yd = as.integer(format(as.Date(x$date), format=%j)) x$wyd = cal.wyd(x) x } the function results in adding the new columns date, wy, yd, and wyd to the table i apply it to. this has always worked in R version 2.14.2. however, in R version 3.1.0 - instead of my mkdate function adding those columns to my existing table, it just overwrites my table and leaves me with just a list of the last variable created by my mkdate function. so i end up with just a list of numbers representing wyd, and lose all the data in my original table. does anyone know what would now be causing this to occur, and what i need to do to make my function work properly again? thank you for any assistance, Janet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Merge and specify column output order
Hi, i am merging two data frames of different time periods, so that the result contains data from both for the same time period. however, I want the result to output columns in a certain order. the common column between the two data frames is date. for example: df1 columns: mod1 mod2 mod3 mod4 date #(there are actually 691 mod columns) df2 columns: obs wy date after merge, i want the order of the columns to be all mod data columns from df1, followed by the obs and wy columns from df2, followed by the date column. i almost get want i want with (at least it doesn't put the common column date as the first column as merge does by default): new = merge(df1, df2, by=c(date))[, union(names(df1), names(df2))] however, that of course gives me all of df1 followed by all of df2, which doesn't put obs immediately after the mod columns: what i get: mod1 mod2 mod3 mod4 date obs wy what i want: mod1 mod2 mod3 mod4 obs wy date any suggestions on how to output the columns in the order i want, without having to rearrange the order after the fact? thank you for any help! Janet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Plot only a portion of a record
Hi R community, i have a data frame of streamflow for 23 years, i.e. date year month day wy yd wyd modQ 1 1965-10-01 196510 1 1966 274 1 0.3341630 2 1965-10-02 196510 2 1966 275 2 0.3223247 3 1965-10-03 196510 3 1966 276 3 0.3109057 i only want to plot 1 of the years, along with the date. i can accomplish this with: plot(mod.sage$date[mod.sage$wy==1976],mod.sage$modQ[mod.sage$wy==1976], type=l) however, this is a bit long and clunky. is there a way to plot just a portion of the full data record without creating a whole new object with subset? thank you for any help! Janet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with mclapply -- losing output/data
Hi Elizabeth, I just found your thread after experiencing a similar problem (I was also using some IRanges/GenomicRanges functions). You've probably figured it out by this time - I'm actually curious to know what you found? I think I've tracked it down in my case, where a small minority of the elements I was trying to lapply/mclapply over caused a genuine error (perhaps in your case a genuine NULL answer - is that possible?). When I used lapply that error was very obvious - it came up on the screen. But when I used mclapply it looked like the function completed fine - it wasn't until later that I saw the error was captured as a string object in the relevant slot of the list object returned by mclapply. I should build in some checking if I want to persist with using mclapply. I wonder if something similar is going on in your case? Janet __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] XML segfault on some architectures
Dear Prof Ripley, Apologies - I've re-sent that to Duncan Temple Lang, along with your note about lib versions. Version info was included in my original post - I gave full sessionInfo(). It's XML_3.4-0. I only have a very sketchy understanding of libraries and systems administration, but it looks like our libxml2 is version 2.6.26. I'll ask my sysadmin people whether they can update that, and try again. Janet On Jun 7, 2011, at 10:54 PM, Prof Brian Ripley wrote: On Tue, 7 Jun 2011, Janet Young wrote: Hi, I found an architecture-specific segfault problem with the XML package. I originally found the problem using the parseKGML2Graph function in the Bioconductor KEGGgraph package, but as far as I can tell the underlying issue seems to be with the xmlTreeParse which is called by parseKGML2Graph. I'm trying this piece of code, from the xmlTreeParse help page: library(XML) fileName - system.file(exampleData, test.xml, package=XML) x - xmlTreeParse(fileName) On my Mac and on nodes of one of the linux clusters I have access to, this works fine. But on another of the linux clusters I use, I get a segfault every time, on both 32-bit and 64-bit nodes of the cluster. The unames for those nodes are here: Linux kong053 2.6.18-194.17.1.el5xen #1 SMP Wed Sep 29 13:30:21 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux Linux king049 2.6.18-194.26.1.el5xen #1 SMP Tue Nov 9 14:13:46 EST 2010 i686 i686 i386 GNU/Linux I think I've included all the relevant info below, but please let me know if there's anything else you'd like to see. As the posting guide says, report problems in contributed packages first to the maintainer, giving the 'at a minimum' information required (which includes the package version number). But note that package XML relies on libxml2, and it is entirely possible the fault is in the latter. Your kernel looks like RHEL 5 (and is an old version): that is well known for having very old versions of system software. One known issue with libxml2 is a mismatch between it and zlib 1.2.[45] prior to libxml2 2.7.7 (2.7.8 is current): from experience, that causes segfaults in package XML's examples. thanks, Janet --- Dr. Janet Young Fred Hutchinson Cancer Research Center 1100 Fairview Avenue N., C3-168, P.O. Box 19024, Seattle, WA 98109-1024, USA. tel: (206) 667 1471 fax: (206) 667 6524 email: jayoung ...at... fhcrc.org --- on 64-bit node library(XML) fileName - system.file(exampleData, test.xml, package=XML) fileName [1] /home/btrask/traskdata/lib_linux_64/R/library/XML/exampleData/test.xml sessionInfo() R version 2.13.0 (2011-04-13) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] XML_3.4-0 system(uname -a) Linux kong053 2.6.18-194.17.1.el5xen #1 SMP Wed Sep 29 13:30:21 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux x - xmlTreeParse(fileName) *** caught segfault *** address 0x51c4f, cause 'memory not mapped' Traceback: 1: .Call(RS_XML_ParseTree, as.character(file), handlers, as.logical(ignoreBlanks), as.logical(replaceEntities), as.logical(asText), as.logical(trim), as.logical(validate), as.logical(getDTD), as.logical(isURL), as.logical(addAttributeNamespaces), as.logical(useInternalNodes), FALSE, as.logical(isSchema), as.logical(fullNamespaceInfo), as.character(encoding), as.logical(useDotNames), xinclude, error, addFinalizer, PACKAGE = XML) 2: xmlTreeParse(fileName) Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace Selection: __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http
Re: [R] XML segfault on some architectures
Hi, Our sysadmin updated libxml2 to version 2.7.8, and now xmlTreeParse works fine with no segfault. Thank you very much - that was very helpful, Janet On Jun 8, 2011, at 11:59 AM, Janet Young wrote: Dear Prof Ripley, Apologies - I've re-sent that to Duncan Temple Lang, along with your note about lib versions. Version info was included in my original post - I gave full sessionInfo(). It's XML_3.4-0. I only have a very sketchy understanding of libraries and systems administration, but it looks like our libxml2 is version 2.6.26. I'll ask my sysadmin people whether they can update that, and try again. Janet On Jun 7, 2011, at 10:54 PM, Prof Brian Ripley wrote: On Tue, 7 Jun 2011, Janet Young wrote: Hi, I found an architecture-specific segfault problem with the XML package. I originally found the problem using the parseKGML2Graph function in the Bioconductor KEGGgraph package, but as far as I can tell the underlying issue seems to be with the xmlTreeParse which is called by parseKGML2Graph. I'm trying this piece of code, from the xmlTreeParse help page: library(XML) fileName - system.file(exampleData, test.xml, package=XML) x - xmlTreeParse(fileName) On my Mac and on nodes of one of the linux clusters I have access to, this works fine. But on another of the linux clusters I use, I get a segfault every time, on both 32-bit and 64-bit nodes of the cluster. The unames for those nodes are here: Linux kong053 2.6.18-194.17.1.el5xen #1 SMP Wed Sep 29 13:30:21 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux Linux king049 2.6.18-194.26.1.el5xen #1 SMP Tue Nov 9 14:13:46 EST 2010 i686 i686 i386 GNU/Linux I think I've included all the relevant info below, but please let me know if there's anything else you'd like to see. As the posting guide says, report problems in contributed packages first to the maintainer, giving the 'at a minimum' information required (which includes the package version number). But note that package XML relies on libxml2, and it is entirely possible the fault is in the latter. Your kernel looks like RHEL 5 (and is an old version): that is well known for having very old versions of system software. One known issue with libxml2 is a mismatch between it and zlib 1.2.[45] prior to libxml2 2.7.7 (2.7.8 is current): from experience, that causes segfaults in package XML's examples. thanks, Janet --- Dr. Janet Young Fred Hutchinson Cancer Research Center 1100 Fairview Avenue N., C3-168, P.O. Box 19024, Seattle, WA 98109-1024, USA. tel: (206) 667 1471 fax: (206) 667 6524 email: jayoung ...at... fhcrc.org --- on 64-bit node library(XML) fileName - system.file(exampleData, test.xml, package=XML) fileName [1] /home/btrask/traskdata/lib_linux_64/R/library/XML/exampleData/test.xml sessionInfo() R version 2.13.0 (2011-04-13) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] XML_3.4-0 system(uname -a) Linux kong053 2.6.18-194.17.1.el5xen #1 SMP Wed Sep 29 13:30:21 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux x - xmlTreeParse(fileName) *** caught segfault *** address 0x51c4f, cause 'memory not mapped' Traceback: 1: .Call(RS_XML_ParseTree, as.character(file), handlers, as.logical(ignoreBlanks), as.logical(replaceEntities), as.logical(asText), as.logical(trim), as.logical(validate), as.logical(getDTD), as.logical(isURL), as.logical(addAttributeNamespaces), as.logical(useInternalNodes), FALSE, as.logical(isSchema), as.logical(fullNamespaceInfo), as.character(encoding), as.logical(useDotNames), xinclude, error, addFinalizer, PACKAGE = XML) 2: xmlTreeParse(fileName) Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace Selection: __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA
[R] XML segfault on some architectures
Hi, I found an architecture-specific segfault problem with the XML package. I originally found the problem using the parseKGML2Graph function in the Bioconductor KEGGgraph package, but as far as I can tell the underlying issue seems to be with the xmlTreeParse which is called by parseKGML2Graph. I'm trying this piece of code, from the xmlTreeParse help page: library(XML) fileName - system.file(exampleData, test.xml, package=XML) x - xmlTreeParse(fileName) On my Mac and on nodes of one of the linux clusters I have access to, this works fine. But on another of the linux clusters I use, I get a segfault every time, on both 32-bit and 64-bit nodes of the cluster. The unames for those nodes are here: Linux kong053 2.6.18-194.17.1.el5xen #1 SMP Wed Sep 29 13:30:21 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux Linux king049 2.6.18-194.26.1.el5xen #1 SMP Tue Nov 9 14:13:46 EST 2010 i686 i686 i386 GNU/Linux I think I've included all the relevant info below, but please let me know if there's anything else you'd like to see. thanks, Janet --- Dr. Janet Young Fred Hutchinson Cancer Research Center 1100 Fairview Avenue N., C3-168, P.O. Box 19024, Seattle, WA 98109-1024, USA. tel: (206) 667 1471 fax: (206) 667 6524 email: jayoung ...at... fhcrc.org --- on 64-bit node library(XML) fileName - system.file(exampleData, test.xml, package=XML) fileName [1] /home/btrask/traskdata/lib_linux_64/R/library/XML/exampleData/test.xml sessionInfo() R version 2.13.0 (2011-04-13) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] XML_3.4-0 system(uname -a) Linux kong053 2.6.18-194.17.1.el5xen #1 SMP Wed Sep 29 13:30:21 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux x - xmlTreeParse(fileName) *** caught segfault *** address 0x51c4f, cause 'memory not mapped' Traceback: 1: .Call(RS_XML_ParseTree, as.character(file), handlers, as.logical(ignoreBlanks), as.logical(replaceEntities), as.logical(asText), as.logical(trim), as.logical(validate), as.logical(getDTD), as.logical(isURL), as.logical(addAttributeNamespaces), as.logical(useInternalNodes), FALSE, as.logical(isSchema), as.logical(fullNamespaceInfo), as.character(encoding), as.logical(useDotNames), xinclude, error, addFinalizer, PACKAGE = XML) 2: xmlTreeParse(fileName) Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace Selection: __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] summing 15 minute precip data to daily
Hi all, i'm sure there is an easy way to do this, but i'm stumped, so any help would be appreciated. i have a single column of data for precipitation every 15 minutes over a year. i want to sum the precip to daily data. so the first 96 records = the first day, the second 96 records = the second day, and so on is there a way to write a for loop that would sum the data to daily, and write each value to a second object so i end up with a file of daily precip? thanx, Janet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] online course: SVM in R with Lutz Hamel at statistics.com
Support vector machines (SVMs) have established themselves as one of the preeminent machine learning models for classification and regression over the past decade or so, frequently outperforming artificial neural networks in task such as text mining and bioinformatics. Dr. Lutz Hamel, author of Knowledge Discovery with Support Vector Machines from Wiley will present his online course Introduction to Support Vector Machines In R Nov. 20 Dec. 18 at statistics.com. Support Vector Machines in R will give you an understanding on what is going on under the hood when using SVMs. After completing this course, you will be able to interpret the performance of SVM models and make appropriate choices for model parameters during the model evaluation and selection cycle. You will understand the difference between linear, polynomial, and gaussian kernels and know how to tune their parameters. In addition, you will have a deep understanding on how the cost constant C affects the quality of your models. Dr. Lutz Hamel teaches at the University of Rhode Island and was the founder of the machine learning and data mining group there. He is the author of Knowledge Discovery with Support Vector Machines (the course text). Before becoming an academic, Dr. Hamel was Director of Software Development at Thinking Machine Corporation, and Vice President of RD for Bluestreak, where he oversaw the development of advanced technologies for online ad delivery and optimization, and directed the building of a next generation data warehouse-driven system for campaign analysis and design tools. Participants can ask questions and exchange comments with Dr. Hamel via a private discussion board throughout the course. Details and registration: http://www.statistics.com/ourcourses/SVM/ Thanks for your consideration, Janet Dobbins -- statistics.com the source for statistics education 612 N. Jackson St. Arlington, VA 22201 703.522.5410 703.522.5846-fax jdobb...@statistics.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] online course: Spatial Analysis Techniques in R with David Unwin at statistics.com
statistics.com offers Spatial Analysis Techniques in R with David Unwin on Dec. 17 - Jan. 22 This course will teach users how to implement spatial statistical analysis procedures using R software. Topics covered include point pattern analysis, identifying clusters, measures of spatial association, geographically weighted regression and surface procession. Dr. David Unwin is Emeritus Chair of Geography at Birkbeck College, University of London, and also a Visiting Professor in the Department of Geomatic Engineering at University College, also in the University of London. His work using and developing spatial statistics in research stretches back some 40 years, and he has authored over a hundred academic papers in the field, together with a series of texts, of which the most recent are his Geographic Information Analysis, 2nd edition (with D. O'Sullivan, 2010) and a series of edited collections at the interface between geography and computer science in Visualization in GIS (Hearnshaw and Unwin, 1994), Spatial Analytical Perspectives on GIS (Fischer, Scholten and Unwin, 1996), Virtual Reality in Geography (Fisher and Unwin, 2002) and, most recently representation issues in Re-presenting GIS (Fisher and Unwin, 2005). Having developed the world's first wholly internet-delivered Master's program in GIS in 1998, David Unwin has considerable experience of teaching and tutoring online. Thank you for your consideration, Janet Dobbins -- statistics.com the source for statistics education 612 N. Jackson St. Arlington, VA 22201 703.522.5410 703.522.5846-fax jdobb...@statistics.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] online course: Graphics in R with Paul Murrell
Paul Murrell will be teaching his online courseGraphics in R, on Nov. 5 - Dec. 3 at statistics.com. Graphics in R, teaches you how to produce publication-quality statistical plots of data using R. It will cover plots such as scatterplots, bar plots, histograms, boxplots and Trellis plots. It will review the underlying model used to produce plots in R so that you can extensively customize these plots. Finally, the course will introduce the grid graphics system and look at producing unique plots from the ground up using basic components. Dr. Paul Murrell, instructor for this course, is a Senior Lecturer in the Department of Statistics at the University of Auckland, New Zealand. Paul has been a member of the core development team for R since 1999, with a focus on the graphics system in R. He is the past Chair of the Section for Statistical Graphics of the American Statistical Association. He has recently served as Editor-in-Chief of R News, the newsletter of the R project, and is an Associate Editor for Computational Statistics and The Journal of Statistical Software. Participants can ask questions and exchange comments with Dr. Murrell via a private discussion board throughout the period. Details and registration: http://www.statistics.com/ourcourses/graphicsR/ The course takes place online at statistics.com in a series of 4 weekly lessons and assignments, and requires about 15 hours/week. Participate at your own convenience; there are no set times when you are required to be online. Thanks for your consideration, Janet Dobbins -- statistics.com the source for statistics education 612 N. Jackson St. Arlington, VA 22201 703.522.5410 703.522.5846-fax jdobb...@statistics.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] using grib files in R
I am not new to R, but I am new to .grib files. I am downloading some climate data and I would like to analyze it in R. R has a nice netcdf package, but I don’t see any package available to deal specifically with grib files. I see a few posts from other people using grib files in R. However, I was unclear if they used grib files in a different software program and then imported the data somehow into R. Is it possible to use read grib files in R and then use the data? If so, could someone point me to a book/website that might help me learn how to do this? Any advice would be helpful…I am beginning to think I should use a different software program, but I’d like to use R! Thanks, Janet __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] memory error
Hi R community, i have what appears to be a memory allocation problem: R(51150) malloc: *** mmap(size=158068736) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug can anyone tell me how to increase the memory size for R on mac os X? thank you, Janet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] memory error
Thanx for clarification on stating my problem, Charlie. I am attempting to merge to files, i.e.: hi39 = merge(comb[,c(hillID,geo)], hi.h39, by=c(hillID)) if this is relevant or helps to explain: the file 'comb' is 3 columns and 1127 rows the file 'hi.h39' is 5 columns and 19758564 rows i started a new clean R session in which i was able to read those 2 files in, but get the following error when i try to merge them: R(2175) malloc: *** mmap(size=79036416) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug R(2175) malloc: *** mmap(size=79036416) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug R(2175) malloc: *** mmap(size=158068736) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug R(2175) malloc: *** mmap(size=158068736) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug R(2175) malloc: *** mmap(size=158068736) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug Error: cannot allocate vector of size 150.7 Mb so the final error is Cannot allocate vector of size 150.7 Mb, as suggested when R runs out of memory. i am running R version 2.9.2, on mac os X 10.5 - leopard. any suggestion on how to increase R's memory on a mac? thanx for any much needed help! Janet On Wed, Mar 31, 2010 at 5:47 PM, Sharpie ch...@sharpsteen.net wrote: Janet Choate-2 wrote: Hi R community, i have what appears to be a memory allocation problem: R(51150) malloc: *** mmap(size=158068736) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug can anyone tell me how to increase the memory size for R on mac os X? thank you, Janet Setting memory limits was something that was done under OS 9- with OS X apps get as much memory as they request as long as free space is available. Also, when R runs out of memory, you usually see errors like: Cannot allocate vector of size X Some details may help pin this problem down: what were you doing when you got this error? Is it repeatable? Is it an error with a base R routine or with something provided by a package? If so, what version? Providing these details will help the people on this list understand what your problem is and suggest solutions. Good luck! -Charlie - Charlie Sharpsteen Undergraduate-- Environmental Resources Engineering Humboldt State University -- View this message in context: http://n4.nabble.com/memory-error-tp1747357p1747558.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] installing RCurl when libcurl is in non-standard location
Hi, I'm struggling to install RCurl for 32-bit linux and am hoping for some suggestions. I obtained RCurl_1.3-1.tar.gz from CRAN today, and am using a very recent version of R: R version 2.10.1 Patched (2010-01-12 r50970). I'm not the sysadmin for this system (disclaimer: my sysadmin skills are not very good, I'm afraid). curl is available centrally on the system but it's a little old (7.12.3 - looks from some older r-help posts like this is too old for RCurl). Therefore I installed libcurl 7.19.7 in a non-standard location (because I'm not the sysadmin), and I think I'm pointing R towards this new libcurl OK, but I'm not 100% sure about that. The output of locate (see below) makes me a little suspicious, but the output of the R CMD INSTALL makes it seem like the new libcurl I installed IS being used. I've included various output below that I hope will help in figuring this out. Is there anything else that would be useful to know? I can also ask our sysadmin for help if that makes more sense than asking you all via r-help. Thanks very much in advance for any ideas, Janet Young --- [2] zork20:/home/jayoung uname -a Linux zork20 2.6.12-1.1381_FC3smp #1 SMP Fri Oct 21 04:03:26 EDT 2005 i686 athlon i386 GNU/Linux [3] zork20:/home/jayoung setenv MAKE gmake [4] zork20:/home/jayoung which gmake /usr/bin/gmake [5] zork20:/home/jayoung gmake -version GNU Make 3.80 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [6] zork20:/home/jayoung which curl-config /home/jayoung/traskdata/bin_linux/curl-config [7] zork20:/home/jayoung curl-config --version libcurl 7.19.7 [8] zork20:/home/jayoung locate curl-config /usr/bin/curl-config /usr/share/man/man1/curl-config.1.gz [16] zork20:/home/jayoung /usr/bin/curl-config --version libcurl 7.12.3 [9] zork20:/home/jayoung locate libcurl /usr/lib/libcurl.so.3 /usr/lib/libcurl.so /usr/lib/libcurl.a /usr/lib/libcurl.so.3.0.0 /usr/share/man/man3/libcurl-multi.3.gz /usr/share/man/man3/libcurl-easy.3.gz /usr/share/man/man3/libcurl-errors.3.gz /usr/share/man/man3/libcurl-share.3.gz /usr/share/man/man3/libcurl-tutorial.3.gz /usr/share/man/man3/libcurl.3.gz [10] zork20:/home/jayoung ls ~/traskdata/lib_linux/libcu* /home/jayoung/traskdata/lib_linux/libcurl.a /home/jayoung/traskdata/lib_linux/libcurl.la* /home/jayoung/traskdata/lib_linux/libcurl.so@ /home/jayoung/traskdata/lib_linux/libcurl.so.3@ /home/jayoung/traskdata/lib_linux/libcurl.so.3.0.0* /home/jayoung/traskdata/lib_linux/libcurl.so.4@ /home/jayoung/traskdata/lib_linux/libcurl.so.4.0.0* /home/jayoung/traskdata/lib_linux/libcurl.so.4.1.1* [11] zork20:/home/jayoung printenv LD_LIBRARY_PATH /home/btrask/traskdata/lib_linux:/home/jayoung/traskdata/bin_linux/qt/ lib:/home/btrask/traskdata/lib_linux/R/library/RSPerl/libs:/home/ btrask/traskdata/lib_linux/R/lib [14] zork20:/home/jayoung/source_codes/R/other_packages R CMD INSTALL RCurl_1.3-1.tar.gz --configure-args='--libdir=/home/btrask/traskdata/ lib_linux --includedir=/home/btrask/traskdata/include' * installing to library ‘/home/btrask/traskdata/lib_linux/R/library’ * installing *source* package ‘RCurl’ ... checking for curl-config... /home/jayoung/traskdata/bin_linux/curl- config checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking how to run the C preprocessor... gcc -E Version has a libidn field Version has CURLOPT_URL Version has CURLINFO_EFFECTIVE_URL Version has CURLINFO_RESPONSE_CODE Version has CURLINFO_TOTAL_TIME Version has CURLINFO_NAMELOOKUP_TIME Version has CURLINFO_CONNECT_TIME Version has CURLINFO_PRETRANSFER_TIME Version has CURLINFO_SIZE_UPLOAD Version has CURLINFO_SIZE_DOWNLOAD Version has CURLINFO_SPEED_DOWNLOAD Version has CURLINFO_SPEED_UPLOAD Version has CURLINFO_HEADER_SIZE Version has CURLINFO_REQUEST_SIZE Version has CURLINFO_SSL_VERIFYRESULT Version has CURLINFO_FILETIME Version has CURLINFO_CONTENT_LENGTH_DOWNLOAD Version has CURLINFO_CONTENT_LENGTH_UPLOAD Version has CURLINFO_STARTTRANSFER_TIME Version has CURLINFO_CONTENT_TYPE Version has CURLINFO_REDIRECT_TIME Version has CURLINFO_REDIRECT_COUNT Version has CURLINFO_PRIVATE Version has CURLINFO_HTTP_CONNECTCODE Version has CURLINFO_HTTPAUTH_AVAIL Version has CURLINFO_PROXYAUTH_AVAIL Version has CURLINFO_OS_ERRNO Version has CURLINFO_NUM_CONNECTS Version has CURLINFO_SSL_ENGINES No CURLINFO_COOKIELIST enumeration value. No CURLINFO_LASTSOCKET enumeration value. No CURLINFO_FTP_ENTRY_PATH enumeration value. No CURLINFO_REDIRECT_URL enumeration
[R] increase size of filled box in a legend
Hello R user community, can anyone tell me how to increase the size of a filled box in a legend? thanx, Janet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Strange package installation error
Thank you very much for the suggestion: you were spot on with the problem. As you and the package developer suggested, I upgraded R (I was running 2.6.*) to 2.9.* and the package installed with no problem. I hadn't known that could be a problem. Incidentally, is there any way to get R to install all the old packages I had before when you upgrade, other than doing it manually? Janet On Aug 21, 2009, at 10:27 PM, Juliet Hannah wrote: Hi Janet, Were you able to install the package? I just installed it without problems. I don't think there should be any issues installing it. If it has not worked yet, make sure your R is updated, and if it is, maybe reinstall it. Best, Juliet Janet Rosenbaum, Ph.D., A.M. Postdoctoral Fellow, Johns Hopkins Bloomberg School of Public Health ja...@post.harvard.edu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Strange package installation error
Hi. I'm trying to install a new package. I'm a relatively long-time (though not advanced) R user and have never seen this error before. For the first example, I tried a few different CRAN mirrors. In the second example, the file does exist; I downloaded it from the CRAN website for the package and pasted in the name exactly a few different times to make sure it was right. install.packages(DiagnosisMed) Warning message: package ‘DiagnosisMed’ is not available install.packages(/Users/janet/Desktop/Camino-downloads/DiagnosisMed_0.2.2.1.tar.gz) Warning message: package ‘/Users/janet/Desktop/Camino-downloads/DiagnosisMed_0.2.2.1.tar.gz’ is not available Permissions: [Macintosh:~/Desktop/Camino downloads] janet% ls -l DiagnosisMed_0.2.2.1.tar.gz -rwxr-xr-x@ 1 janet janet 42731 Aug 17 17:31 DiagnosisMed_0.2.2.1.tar.gz Any ideas? Thanks for your help. Janet -- Janet Rosenbaum, Ph.D., A.M. Postdoctoral Fellow, Johns Hopkins Bloomberg School of Public Health ja...@post.harvard.edu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] EM Algorithm
Look into the R packages for missing data by Joe Schafer. These missing data routines use EM. See here for starters. He also wrote a book: http://www.stat.psu.edu/~jls/misoftwa.html Janet __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] More basic equivalent of TukeyHSD
This is a simple question, but I'm going on the supposition that the only stupid question is the one not asked. 1. I have many sets of 5 proportions that are different from each other (prop.test), and want to know which proportions are different from each other. In other words, I want the equivalent of Tukey's HSD test, but for proportions rather than anova. Here is one of the sets of number of successes; the denominator is 151 for all cases. Parents School Peers Church No one Menstruation 79 5855 3 38 As proportions: round(topics.sum[1,], digits=3) Parents School Peers Church No one 0.523 0.384 0.364 0.020 0.252 Intuitively, it looks like there are 3 or 4 groups that are different from each other, but is there a function that does this? parents school and peers ? no one church 2. I am displaying this data in a bar graph. How do I show graphically which proportions are different? I'm not interested in using error bars since they can be ambiguous, but probably something like putting a different symbol over each bar to show which bars are the same and which differ. I've made efforts at this before, but they've always looked a bit clumsy. Thanks, Janet __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] More basic equivalent of TukeyHSD
This is a simple question, but I'm going on the supposition that the only stupid question is the one not asked. 1. I have many sets of 5 proportions that are different from each other (prop.test), and want to know which proportions are different from each other. In other words, I want the equivalent of Tukey's HSD test, but for proportions rather than anova. Here is one of the sets of number of successes; the denominator is 151 for all cases. Parents School Peers Church No one Menstruation 79 5855 3 38 As proportions: round(topics.sum[1,], digits=3) Parents School Peers Church No one 0.523 0.384 0.364 0.020 0.252 Intuitively, it looks like there are 3 or 4 groups that are different from each other, but is there a function that does this? parents school and peers ? no one church 2. I am displaying this data in a bar graph. How do I show graphically which proportions are different? I'm not interested in using error bars since they can be ambiguous, but probably something like putting a different symbol over each bar to show which bars are the same and which differ. I've made efforts at this before, but they've always looked a bit clumsy. Thanks, Janet __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] dotted lines for branches in ape's plot.phylo?
Hi, I'm very much enjoying using the ape package to produce phylogenetic trees with colored branches (using edge.color). Is it also possible to specify that some branches should be drawn as dotted lines? That would be really useful. I've tried messing around with edge.width, but that doesn't seem to help me get dotted lines. thanks, Janet Young __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] problem with putting text in outer margins (mtext outer=TRUE)
Hi there, I'm trying to get some text in the outer margins of my plots and am having trouble - the margin text is overlapping my plots, even though the outer margin I'm trying to put it in is very big. I've simplified my problem down to this: - X11(width=7.5,height=10) par(mfrow=c(6,1),oma=c(20,0,20,0), mar=c(0,3.1,1,2.1)) for (i in 1:6) { plot(cars[,speed],cars[,dist]) } mtext(Position (Mb), outer=TRUE, side=1) mtext(Position (Mb), outer=TRUE, side=3) - It's an ugly and meaningless set of plots, but you can see my problem: the two Position strings are right up against the plot, the bottom one even overlapping the bottom plot. Does anyone know how I can get the text to appear in the big white space of the outer margin, rather than right up against the plot? thanks in advance, Janet Young PS I'm using R 2.7.1 Patched (2008-07-01 r46019) on an i686 linux machine. I have the same problem if I do this on Mac OS X R 2.7.1 (2008-06-23). __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] RMySQL installation
Hi, I am having trouble getting RMySQL running on a solaris machine. [43] bedrock:/home/jayoung/source_codes/R/other_packages uname -a SunOS bedrock 5.10 Generic_118833-36 sun4v sparc SUNW,Sun-Fire-T200 I thought I had finally managed to get it installed, albeit with some warnings that I didn't understand (it took me a while to find where our mysql libraries were), but when I tried to load it within R I got an error: library(RMySQL) Error in dyn.load(file, ...) : unable to load shared library '/home/btrask/traskdata/lib/R/ library/RMySQL/libs/RMySQL.so': ld.so.1: R: fatal: relocation error: file /home/btrask/traskdata/ lib/R/library/RMySQL/libs/RMySQL.so: symbol mysql_more_results: referenced symbol not found Error: package/namespace load failed for 'RMySQL' I'm not a sysadmin and don't know any C, so I don't really understand this error, but I'm wondering whether we might have an older, incompatible version of mysql? [42] bedrock:/home/jayoung/source_codes/R/other_packages mysql -V mysql Ver 12.22 Distrib 4.0.24, for sun-solaris2.10 (sparc) Or am I somehow failing to specify some of the necessary libraries in LD_LIBRARY_PATH or some other thing R is using to look for libraries? I've pasted the command I used for installation, and the output of the build process below, as well as the output of sessionInfo. Thanks in advance for any help, Janet Young --- Dr. Janet Young (Trask lab) Fred Hutchinson Cancer Research Center 1100 Fairview Avenue N., C3-168, P.O. Box 19024, Seattle, WA 98109-1024, USA. tel: (206) 667 1471 fax: (206) 667 6524 email: [EMAIL PROTECTED] http://www.fhcrc.org/labs/trask/ --- [13] bedrock:/home/jayoung/source_codes/R/other_packages R CMD INSTALL --configure-args='--with-mysql-inc=/usr/sfw/include/mysql -- with-mysql-lib=/usr/sfw/lib' RMySQL_0.6-0.tar.gz * Installing to library '/home/btrask/traskdata/lib/R/library' * Installing *source* package 'RMySQL' ... checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking how to run the C preprocessor... gcc -E checking for compress in -lz... yes checking for getopt_long in -lc... yes checking for mysql_init in -lmysqlclient... no checking for egrep... egrep checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking mysql.h usability... no checking mysql.h presence... no checking for mysql.h... no configure: creating ./config.status config.status: creating src/Makevars ** libs cc -I/home/btrask/traskdata/lib/R/include -I/home/btrask/traskdata/ lib/R/include -I/usr/sfw/include/mysql -I/usr/local/include-KPIC -g -c RS-DBI.c -o RS-DBI.o RS-DBI.c, line 1177: warning: assignment type mismatch: pointer to char = pointer to const char RS-DBI.c, line 1190: warning: implicit function declaration: isalpha RS-DBI.c, line 1228: warning: assignment type mismatch: pointer to char = pointer to const char cc -I/home/btrask/traskdata/lib/R/include -I/home/btrask/traskdata/ lib/R/include -I/usr/sfw/include/mysql -I/usr/local/include-KPIC -g -c RS-MySQL.c -o RS-MySQL.o RS-MySQL.c, line 134: warning: implicit function declaration: mysql_more_results RS-MySQL.c, line 161: warning: implicit function declaration: mysql_next_result RS-MySQL.c, line 387: warning: assignment type mismatch: pointer to char = pointer to const char RS-MySQL.c, line 389: warning: assignment type mismatch: pointer to char = pointer to const char RS-MySQL.c, line 391: warning: assignment type mismatch: pointer to char = pointer to const char RS-MySQL.c, line 393: warning: assignment type mismatch: pointer to char = pointer to const char RS-MySQL.c, line 395: warning: assignment type mismatch: pointer to char = pointer to const char cc -G -L/usr/local/lib -o RMySQL.so RS-DBI.o RS-MySQL.o -L/usr/sfw/ lib -lmysqlclient -lz -L/home/btrask/traskdata/lib/R/lib -lR ** R ** inst ** preparing package for lazy loading Loading required package: DBI Creating a new generic function for format in RMySQL Creating a new generic function for print in RMySQL ** help Building/Updating help pages for package 'RMySQL' Formats: text html latex example MySQL texthtmllatex example MySQLConnection-class