[R] quantmod: How could I change the name in chartSeries

2014-07-09 Thread William
hi, guys, I am just a beginner to the excellent R package, quantmod. I quite don't know how to change the y-axis name in the chartSeries function. Actually, I want to write some sort of the following function, by which I could use just one code sentence to complete the financial analysis.

[R] Decision Tree

2014-07-09 Thread Abhinaba Roy
Hi R-helpers, Is it possible to change the color of the boxes when plotting decision trees using 'fancyRpartPlot()' from rpart.plot package ? -- Regards, Abhinaba Roy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list h

Re: [R] Information about font

2014-07-09 Thread David Winsemius
On Jul 9, 2014, at 7:47 PM, Sébastien Bihorel wrote: > Hi, > > I have this set of R scripts which are ran on a linux box and create plots > with the lattice package. I do not specify any custom font family, so I > believe that whatever is the default font on my system is used in the plot. > 1- h

[R] Information about font

2014-07-09 Thread Sébastien Bihorel
Hi, I have this set of R scripts which are ran on a linux box and create plots with the lattice package. I do not specify any custom font family, so I believe that whatever is the default font on my system is used in the plot. 1- how can I know which is the default font used in my plots? 2- is thi

Re: [R] Cansisc: Error in eigen(eHe, symmetric = TRUE)

2014-07-09 Thread Maria Judith Carmona H
Dear John There is my data set. Thanks. On Wed, Jul 9, 2014 at 8:12 PM, John Fox wrote: > Dear Judith, > > I take it from your reply that you have *more* observations than there are > response variables in the multivariate linear model, but since you still > haven't provided access to the dat

Re: [R] Cansisc: Error in eigen(eHe, symmetric = TRUE)

2014-07-09 Thread Maria Judith Carmona H
Dear John, I am including abundance values ​​in my data set so obviously I have zero abundances. The problem is that if plot only the factors (biomasa, altdosel, altsoto, cobertura, riqarb, elevacion, temperatura, precipitacion) I get the graphic, the same happen when I included only the famil

[R] Installing rgdal and rjags packages on a linux cluster

2014-07-09 Thread Adam Zeilinger
Dear R Help, I'm trying to install the rjags and rgdal packages on a linux cluster running R 3.0.3. However, I'm having problems installing them successfully. Both packages require external programs (JAGS and GDAL, respectively), which have been successfully installed. For rjags, the error

Re: [R] Cansisc: Error in eigen(eHe, symmetric = TRUE)

2014-07-09 Thread John Fox
Dear Judith, I take it from your reply that you have *more* observations than there are response variables in the multivariate linear model, but since you still haven't provided access to the data, it's still impossible to tell what the problem is. I don't follow your application, possibly be

Re: [R] function completing properly

2014-07-09 Thread Jeff Newmiller
I think you are mistaken. Please provide an example of how you used this function in any version of R that behaved as you describe. Also, please post in plain text to avoid the what-you-see-is-not-what-we-see feature that HTML email provides. --

Re: [R] R Studio v3.0.3 for Windows 32bits is too slow

2014-07-09 Thread peter dalgaard
Grumpy today, Jeff? For the concrete issue, I'd conjecture that the base problem is that there are way too many columns in the data and that the nature of the method is not properly understood. It is not obvious that k-means clustering based on Euclidean distance makes sense in 1426-dimensional

[R] function completing properly

2014-07-09 Thread Janet Choate
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

Re: [R] < symbols in a data frame

2014-07-09 Thread MacQueen, Don
After reading the metals data frame, I would do this: metals$result <- as.numeric(gsub('<','',metals$Cedar.Creek)) metals$flag <- ifelse(grepl('<',metals$Cedar.Creek),'<','h') Also, assuming you got your data into R using read.table(), read.csv(), or similar, I would include stringsAsFactors=T

Re: [R] Cansisc: Error in eigen(eHe, symmetric = TRUE)

2014-07-09 Thread John Fox
Dear Maria Judith Carmona Higuita, Since you didn't include enough information (such as your access to your data) to reproduce the error, one can only guess. My guess: you have fewer observations in your data set than response variables on the LHS of the multivariate linear model. I hope this

Re: [R] R Studio v3.0.3 for Windows 32bits is too slow

2014-07-09 Thread Rolf Turner
On 10/07/14 04:24, Jeff Newmiller wrote: Grumpy today, Bert? Bert is ***always*** grumpy! :-) If he weren't, I'd get worried. But then someone else, not more than a million miles from this email, has a strong tendency to be grumpy (acerbic?) as well. Of course ***I*** am ***never*** gr

Re: [R] using match to obtain non-sorted index values from non-sortedvector

2014-07-09 Thread Folkes, Michael
Oh dear, I seem to have suffered a case of reversed arguments. This explains my surprise why R didn't have this in a function already - as it does! I was following the pattern of search.vector %in% pattern, but match() arguments are opposite this. Thanks to both Davids. Michael -Original Me

Re: [R] using match to obtain non-sorted index values from non-sortedvector

2014-07-09 Thread David Winsemius
On Jul 9, 2014, at 1:13 PM, Folkes, Michael wrote: > So nice! > Apply wins again. I doubt that `sapply( ..., which(,) )` would win a foot race with `match`: > match(Tset, pop.df$pop) [1] 5 4 2 -- David. > Thanks David. > Michael > > -Original Message- > From: David L Carlson [mailto

Re: [R] using match to obtain non-sorted index values from non-sortedvector

2014-07-09 Thread Folkes, Michael
So nice! Apply wins again. Thanks David. Michael -Original Message- From: David L Carlson [mailto:dcarl...@tamu.edu] Sent: July-09-14 1:11 PM To: Folkes, Michael; r-help@r-project.org Subject: RE: using match to obtain non-sorted index values from non-sortedvector There may be a faster

Re: [R] < symbols in a data frame

2014-07-09 Thread Claudia Beleites
Hi Sam, > But this may not be the important issue here at all. If " value is left censored at k -- i.e. we know it's less than k but not > how much less -- than Sarah's proposal is not what you want to do. > Exactly what you do want to do depends on context, and as it concerns > statistical method

Re: [R] using match to obtain non-sorted index values from non-sorted vector

2014-07-09 Thread David L Carlson
There may be a faster way, but > sapply(Tset, function(x) which(pop.df$pop==x)) [1] 5 4 2 - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-

[R] using match to obtain non-sorted index values from non-sorted vector

2014-07-09 Thread Folkes, Michael
Hello all, I've been struggling with the best way to find index values from a large vector with elements that will match elements of a subset vector [the table argument in match()]. BUT the index values can't come out sorted (as we'd get in which(X %in% Y) ). My 'population' vector can't be so

[R] Cansisc: Error in eigen(eHe, symmetric = TRUE)

2014-07-09 Thread Maria Judith Carmona H
Hi, I have a problem using the function Candisc from Candisc Package. bosques1<-read.csv("bosques1.csv",header=TRUE,encoding="latin1") bosques1<-na.exclude(bosques1) attach(bosques1) #Modelo de regresión mod <- lm(cbind(biomasa,altdosel,altsoto,cobertura,riqarb,elevacion,temperatura,precipitaci

Re: [R] HPGL or PCL plotting device? Or otherwise plotting plots

2014-07-09 Thread Thomas Levine
Actually, this doesn't _quite_ do what I want; I want different R colors (1, 2, 3, &c.) to select different pens in HPGL ("SP1", "SP2", "SP3", &c.), but the HPGL file I get selects only pen 1. A hacky way to do this would be to generate a few different postscript files for the different colors on

Re: [R] < symbols in a data frame

2014-07-09 Thread Sam Albers
Thanks for all the responses. It sometimes difficult to outline exactly what you need. These response were helpful to get there. Speaking to Bert's point a bit, I needed a column to identify where the < symbol was used. If I knew more about R I think I might be embarrassed to post my solution to th

Re: [R] How to include factor levels into plot title?

2014-07-09 Thread Beatriz
@ Sarah Thanks a lot, paste does the job perfectly! On 09/07/2014 17:46, Sarah Goslee wrote: How about: plot(dd$Sepal.Length, dd$Petal.Length, main=paste("These are the levels:", paste(levels(dd$Species), collapse=", "))) Thanks for the actual reproducible example! Sarah On Wed, Jul 9, 20

Re: [R] < symbols in a data frame

2014-07-09 Thread Bert Gunter
Well, ?grep and ?regex are clearly apropos here -- dealing with character data is an essential skill for handling input from diverse sources with various formatting conventions. I suggest you go through one of the many regular expression tutorials on the web to learn more. But this may not be the

Re: [R] < symbols in a data frame

2014-07-09 Thread Marc Schwartz
On Jul 9, 2014, at 12:19 PM, Sam Albers wrote: > Hello, > > I have recently received a dataset from a metal analysis company. The > dataset is filled with less than symbols. What I am looking for is a > efficient way to subset for any whole numbers from the dataset. The column > is automatically

Re: [R] < symbols in a data frame

2014-07-09 Thread Sarah Goslee
Hi Sam, I'd take the similar tack of removing the < instead. Note that if you import the data frame using the stringsAsFactors=FALSE argument, you don't need the first step. metals$Cedar.Creek <- as.character(metals$Cedar.Creek) metals$Cedar.Creek <- gsub("<", "", metals$Cedar.Creek) metals$Cedar

[R] < symbols in a data frame

2014-07-09 Thread Sam Albers
Hello, I have recently received a dataset from a metal analysis company. The dataset is filled with less than symbols. What I am looking for is a efficient way to subset for any whole numbers from the dataset. The column is automatically formatted as a factor because of the "<" symbols making it d

Re: [R] reorder a list

2014-07-09 Thread Lorenzo Alfieri
Thanks for the suggestion. I found that I get the result I wanted with this simple command: split(unlist(A2),unlist(A1)) $`1` [1] 2.718282 $`2` [1] 7.389056 7.389056 $`3` [1] 20.08554 $`4` [1] 54.59815 54.59815 54.59815 $`5` [1] 148.4132 148.4132 $`13` [1] 442413.4 $`23` [1] 9744803446 whi

Re: [R] reorder a list

2014-07-09 Thread William Dunlap
Is the following 'g' what you want? A better example might be with A2a <- lapply(A1, function(x)x+seq_along(x)/(100*length(x))) g <- function (x, y) { xLengths <- vapply(x, FUN = length, FUN.VALUE = 0L) yLengths <- vapply(y, FUN = length, FUN.VALUE = 0L) stopifnot(identical(xLength

Re: [R] Survival Analysis with an Historical Control

2014-07-09 Thread Andrews, Chris
The code is actually available at the websites you provide. Try "View page source" in your browser. The most cryptic code isn't needed because the math functions (e.g, incomplete gamma function) are available in R. -Original Message- From: Paul Miller [mailto:pjmiller...@yahoo.com] S

Re: [R] R Studio v3.0.3 for Windows 32bits is too slow

2014-07-09 Thread Jeff Newmiller
Grumpy today, Bert? While it is a fact that RStudio is a separate tool from R, it is clear from the question that the OP is interested in capabilities that R is providing and he simply cannot tell the difference. OP: 1) "Better" is a word that leads to pointless arguments. You will have to be

Re: [R] eclat problem

2014-07-09 Thread Michael Hahsler
Hi Alvaro, this was a tricky problem. Under Windows R uses the trio library (different from the package Trio which creates very similar error messages) for printf support. arules currently contains a bug that results in an invalid format string for printf when an error message is created. For

Re: [R] How to include factor levels into plot title?

2014-07-09 Thread Sarah Goslee
How about: plot(dd$Sepal.Length, dd$Petal.Length, main=paste("These are the levels:", paste(levels(dd$Species), collapse=", "))) Thanks for the actual reproducible example! Sarah On Wed, Jul 9, 2014 at 11:24 AM, Bea GD wrote: > Hi all, > > I'd like to include the levels of one of my variable

Re: [R] Cutting hierarchical cluster tree at specific height fails

2014-07-09 Thread David L Carlson
To cut the tree, the clustering algorithm must produce consistently increasing height values with no reversals. You used one of the two options in hclust that does not do this. Note the following from the hclust manual page: "Note however, that methods "median" and "centroid" are not leading to

[R] How to include factor levels into plot title?

2014-07-09 Thread Bea GD
Hi all, I'd like to include the levels of one of my variables in the title of a plot. I'd like these factor levels to be concatenated. E.g. 'These are the levels: setosa, versicolor, virginica'. I've been working with this code but I don't get the desired results. Any suggestions would be a

[R] Revolutions blog: June 2014 Roundup

2014-07-09 Thread David Smith
Revolution Analytics staff and guests write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related

Re: [R] eclat problem

2014-07-09 Thread Alvaro Flores
Thanks Michael, everything going perfect right now! I didn't expect such an extensive list of itemsets given the insights on the data that I have. And the error message didn't gave me the right clue. Now is working fine! Thanks for your time! Best Regards. Alvaro. -Mensaje original--

Re: [R] R Studio v3.0.3 for Windows 32bits is too slow

2014-07-09 Thread Bert Gunter
RStudio is a separate product with its own support. Post there, not here. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Tue, Jul 8, 2014 at 7:34 PM, Phan

Re: [R] HPGL or PCL plotting device? Or otherwise plotting plots

2014-07-09 Thread Thomas Levine
Oh it was easier than I thought. postscript('project-contracts.ps') hist(log(projects$n.contracts)) dev.off() Then run this from the shell. pstoedit -f plot-hpgl project-contracts.ps project-contracts.hpgl And send it to the plotter. On 09 Jul 13:10, Thomas Levine wrote: > Hi, > > I w

[R] HPGL or PCL plotting device? Or otherwise plotting plots

2014-07-09 Thread Thomas Levine
Hi, I want to print plots on a Roland DXY-1100 plotter. How can I do this from R? I think the easiest thing would be a graphics device for Printer Command Language or Hewlett-Packard Graphics Language, but I haven't managed to find any of those. Thanks Tom __

[R] Error evaluating partitioning around medoids clustering method R clValid package

2014-07-09 Thread Scott Davis
I have a data.frame with 300 observations of 36 numerical, categorical, and NA variables. I am trying to evaluate the partitioning around medoids clustering algorithm for a marketing segmentation study. My original dataset has over 130,000 observations, but I took a sample for easy reproducibility

[R] R Studio v3.0.3 for Windows 32bits is too slow

2014-07-09 Thread Phan, Truong Q
Hi R'er, I have a dataset which has a matrix of 7502 x 1426 (rows x columns). The data is in a CSV format which has a size around 68Mb. This dataset is less than 10% of our dataset. I have been adopting the Anomaly detection method as described by http://www.mattpeeples.net/kmeans.html . It has

[R] [R-pkgs] h2o - fast scalable glm, deeplearning, gbm, randomForest, plyr for big datasets

2014-07-09 Thread SriSatish Ambati
http://cran.r-project.org/web/packages/h2o/ Please try h2o, H2O is fast scalable open source R package for Generalized Linear Modeling, Deep Learning, Gradient Boosting, RandomForest, k-means for large tera-byte datasets. This package allows you to scale R over Hadoop like datasets in-memory on mu

[R] [R-pkgs] icd9 - a new R package

2014-07-09 Thread Jack Wasey
Dear R people, The new packge 'icd9' provides a range of tools for working with ICD-9-CM codes. http://cran.r-project.org/web/packages/icd9/index.html https://github.com/jackwasey/icd9 ICD-9 (clinical modification) is primarily used for categorizing diseases in the USA for hospital administratio

[R] Cutting hierarchical cluster tree at specific height fails

2014-07-09 Thread Johannes Radinger
Hi, I'd like to cut a hierachical cluster tree calculated with hclust at a specific height. However ever get following error message: "Error in cutree(hc, h = 60) : the 'height' component of 'tree' is not sorted (increasingly)" Here is a working example to show that when specifing a height in

Re: [R] Transform a data.frame with "; " sep column and another one in a a new one with the same two column but with repetitions

2014-07-09 Thread João Azevedo Patrício
Em 05-07-2014 00:43, John McKown escreveu: I messed up my original response by not including r-help in the distribution. And now I won't look as bad because, after a short nap, I have new, much shorted (but more difficult, for me, to understand) answer. # # The original data is in the variable "

Re: [R] How to process each element in 3 minute interval using a for loop in R?

2014-07-09 Thread Michael Sumner
On 9 Jul 2014 17:19, "Takatsugu Kobayashi" wrote: > > Hi R-users, > > This should be a simple question: How can I delay each loop process in some > minutes? The reason for this is I need to avoid too much traffic to get > longitudes and latitudes of 2000 addresses using google API. > R is too fas

[R] matrix built by diagonal matrices with a given structure (2nd trial)

2014-07-09 Thread Carlo Giovanni Camarda
Dear R-users, three weeks ago I sent the mail below, but I didn't receive any response. Maybe it was overlooked. Thanks anyway for all the help you gave us by this mailing-list, Giancarlo Camarda [...] I have a matrix with a series of "not-overlapping in a row dimension" vectors in a given

Re: [R] reorder a list

2014-07-09 Thread Lorenzo Alfieri
Thanks Bill and the other guys for the variety of useful replies! In fact I'm working with pretty big lists (with ~35000 sublists) and Bill's solution is the fastest one in terms of computing time. Now comes the second part of the question... :-) I've my usual list of values and time indices to so

Re: [R] How to process each element in 3 minute interval using a for loop in R?

2014-07-09 Thread Prof Brian Ripley
On 09/07/2014 08:17, Takatsugu Kobayashi wrote: Hi R-users, This should be a simple question: How can I delay each loop process in some minutes? The reason for this is I need to avoid too much traffic to get longitudes and latitudes of 2000 addresses using google API. I am searching for solutio

[R] How to process each element in 3 minute interval using a for loop in R?

2014-07-09 Thread Takatsugu Kobayashi
Hi R-users, This should be a simple question: How can I delay each loop process in some minutes? The reason for this is I need to avoid too much traffic to get longitudes and latitudes of 2000 addresses using google API. I am searching for solutions with keywords like interval, minutes, delay, bu