Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Charilaos Skiadas
On Apr 10, 2012, at 1:08 PM, Steve Lavrenz wrote: I definitely need a loop - the example I gave was only a simple one. Say I want to do more complex calculations in each step, such that the numeric difference between consecutive terms is not constant. I will try out some of the methods th

Re: [R] lattice panel question

2008-10-14 Thread Charilaos Skiadas
http://lmdvr.r-forge.r-project.org/figures/figures.html Look at Figure 10.24 and the code therein. You will likely want to define your own strip function, and the code in strip.combined could be your guide. If you have Deepayan's book, you can find more details in the relevant section. H

Re: [R] Turn factors to numeric

2008-10-09 Thread Charilaos Skiadas
R-FAQ 7.10: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors- to-numeric_003f On Oct 9, 2008, at 6:59 AM, joseph kambeitz wrote: I am having some problems while trying to fit simple data. I aggregated some data using: data1 <- aggregate(data1$T2, list=(SOA=data1$SOA), mea

Re: [R] Dot plot - equivalent of MINITAB

2008-09-25 Thread Charilaos Skiadas
I think the problem is that what you describe is not what some people, R folks included, refer to as "dotplot", though I suppose wikipedia as well as some other top google links seem to agree with you and minitab. What you describe I think can be obtained with something like: x<- c(6,6,4,

Re: [R] paste in xtable

2008-09-23 Thread Charilaos Skiadas
Actually the '\\textbf' specification would work just fine. If you examine test[,1] you'll see it contains the correct thing. The problem is when print.xtable is called. This is because it automatically contains a function that "sanitizes" the character entries to "fix" characters that have

Re: [R] Compiling date

2008-09-10 Thread Charilaos Skiadas
So, am I correct that each datum is either of the form "mm/dd/yy" or of the form "dd/mm/"? If that is correct, then the following should work, and takes care of converting 99 to 1999 instead of 2099: dates <- c("06/15/07","04/09/99","20/03/2008") short <- grep("\\d\\d/\\d\\d/\\d\\d$", dat

Re: [R] match problem by rownames

2008-09-09 Thread Charilaos Skiadas
As suggested in ?"[.data.frame", try: dat[match('a1', rownames(dat)),] Haris Skiadas Department of Mathematics and Computer Science Hanover College On Sep 9, 2008, at 2:41 AM, Xianming Wei wrote: Hi all, While dat['a1',] and dat['a10',] produce the same results in the following example, I'd

Re: [R] "license" for a university

2008-09-03 Thread Charilaos Skiadas
Try: license() On Sep 3, 2008, at 6:59 PM, Erin Hodgess wrote: Dear R People: I am trying to install R in a classroom here, but have been told that there must be a license. Is there such a thing with R, please? Since it is free, I "assumed" that there would be no license. Thanks for any hel

Re: [R] Parenthesis recognition with grep

2008-08-31 Thread Charilaos Skiadas
Try: myStr <- "YD\\(001\\)" In POSIX format, or in most such formats in fact, special characters like parentheses have a particular meaning, and need to be escaped if they are to have the "parenthesis" meaning. This is done typically by putting a backslash in front of them. Since however a

Re: [R] Upgrading R means I lose my packages

2008-08-27 Thread Charilaos Skiadas
On Aug 27, 2008, at 10:40 PM, Rolf Turner wrote: On 28/08/2008, at 2:02 PM, James Milks wrote: The title says it all. Does anyone know of a way to save your packages when you upgrade to a new version of R? This may seem petty, but I'm accumulating enough packages that having to downloa

Re: [R] keywords

2008-07-29 Thread Charilaos Skiadas
On Jul 29, 2008, at 5:24 AM, Edna Bell wrote: Hi R Gurus! When you build a package, you need to put in keywords in the Rd files. Where would you find the list of keywords, please? Simplest way is to google for "r keywords". First hit is: http://www.stat.ucl.ac.be/ISdidactique/Rhelp/doc/keyw

Re: [R] include S4 class and methods in a package

2008-06-28 Thread Charilaos Skiadas
On Jun 27, 2008, at 1:44 PM, baptiste Auguié wrote: DeaR list, Pardon the stupidity of this question but I've been trying this for a while now without success. I've followed the example given in the green book "programming with data", and I now have a working example of a S4 class with a

Re: [R] Editor for Mac OSX

2008-06-18 Thread Charilaos Skiadas
One more advantage of TextMate is support for Sweave files. You can have a Sweave file open, and the LaTeX parts of it are syntax colored according to LaTeX and one can use all the facilities of the LaTeX extension (bundle) in LaTeX (which probably has some things similar to AucTeX, has a n

Re: [R] Reshape or Stack? (To produce output as columns)

2008-06-17 Thread Charilaos Skiadas
On Jun 17, 2008, at 8:06 AM, Chuck Cleland wrote: On 6/17/2008 6:59 AM, Steve Murray wrote: Dear all, I have used 'read.table' to create a data frame of 720 columns and 360 rows (and assigned this to 'Jan'). The row and column names are numeric: columnnames <- sprintf("%.2f", seq(from = -17

Re: [R] Lattice: Superpose bwplot on dotplot [Newbie Question]

2008-06-16 Thread Charilaos Skiadas
On Jun 16, 2008, at 12:13 PM, Lord Yo wrote: Hello everyone I have dataset containing a monetary value (ABS) and two factors (Fct, Group). I am able to create useful using: bwplot(ABS~Group|Fct) and dotplot(ABS~Group|Fct) Question: What do I have to do to overlay the dotplot with the bwpl

Re: [R] Subset by Factor by date

2008-06-14 Thread Charilaos Skiadas
ere? Haris Skiadas Department of Mathematics and Computer Science Hanover College Charilaos Skiadas-3 wrote: On Jun 14, 2008, at 1:25 AM, T.D.Rudolph wrote: aggregate() is indeed a useful function in this case, but it only returns the columns by which it was grouped. Is there a way I

Re: [R] Subset by Factor by date

2008-06-13 Thread Charilaos Skiadas
On Jun 14, 2008, at 1:25 AM, T.D.Rudolph wrote: aggregate() is indeed a useful function in this case, but it only returns the columns by which it was grouped. Is there a way I can use this while simultaneously retaining all the other column values in the dataframe? e.g. add superfluous (y

Re: [R] Rest of a division

2008-06-13 Thread Charilaos Skiadas
?"%%" On Jun 13, 2008, at 11:23 AM, Eric Ferreira wrote: Dear useRs, How do I ask for the rest of a division? For instantce, in C is like: 4%2 = 0 Best regards, -- Eric B Ferreira Exact Sciences Department Federal University of Lavras Brasil Haris Skiadas Department of Mathematics and C

Re: [R] numbers as part of long character

2008-06-12 Thread Charilaos Skiadas
On Jun 12, 2008, at 6:34 PM, Hua Li wrote: Thanks, Marc and Haris! I didn't know the values of the numbers beforehand, so the scan method won't work, but "[^+-\\d.]+" will do! And Haris, I didn't intend to keep the information of which number is B, which is C etc when asking the question,

Re: [R] numbers as part of long character

2008-06-12 Thread Charilaos Skiadas
On Jun 12, 2008, at 5:06 PM, Marc Schwartz wrote: on 06/12/2008 03:46 PM Hua Li wrote: Hi, I'm looking for some way to pick up the numbers which are contained and buried in a long character. For example, outtree.new="(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C: 17139.21);" num.char

Re: [R] problem with function "rep"

2008-06-12 Thread Charilaos Skiadas
I believe this might do what you want a bit faster. I replaced the while loop with something that is likely to be faster. I saw no reason for the rounding you were doing, better to use as.integer at the end. test <- function(t){ x <- rexp(t,0.1) while(sum(x) <= t) { x <- c(x, rexp(

Re: [R] problem with function "rep"

2008-06-12 Thread Charilaos Skiadas
On Jun 12, 2008, at 10:48 AM, Julien Hunt wrote: Do you need more information on my specific program. Thanks for your time and help, Yes, as the posting guide says, we would probably need a reproducible self-contained example. Emphasis on "reproducible" and "self-contained. Best regards,

Re: [R] How to change the class of data?

2008-06-12 Thread Charilaos Skiadas
Seeing how there have been three wrong answers so far, I should point out that: 1) This is an FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How- do-I-convert-factors-to-numeric_003f 2) Most of the other methods suggested so far fail if the example x used is not of the form 1:n. The only

Re: [R] How to change the class of data?

2008-06-12 Thread Charilaos Skiadas
On Jun 12, 2008, at 2:24 AM, Qman Fin wrote: Hi all, I have some data x, which are actualy consisted of numerical enties. But the class of this matrix is set to be "factor" by someone else. I used "class(x)", it turns out to be "factor". So I can not calculate them. The typical approach is

Re: [R] Increase Number of Decimals

2008-06-11 Thread Charilaos Skiadas
On Jun 11, 2008, at 12:17 PM, Neil Gupta wrote: R Users, I'm new to R and was wondering how I can show more decimal places when I run commands. If I'm simply running a correlation(ES,YM) how would I increase the number of decimal places R shows? When I run this it shows me . 9734044. How

Re: [R] fitting periodic 'sine wave' model

2008-06-10 Thread Charilaos Skiadas
In addition to Gabor's suggestion, note the following warning from ?nls Warning Do not use nls on artificial "zero-residual" data. The nls function uses a relative-offset convergence criterion that compares the numerical imprecision at the current parameter estimates to the residual sum-of-

Re: [R] Probs with paste

2008-06-09 Thread Charilaos Skiadas
I have to say it is not clear at all what you expected. risk.factors [1] is the character vector "file$A". You ask it to do a paste of that, so of course it will just return itself. Then you do a table, and naturally it tells you that it found "file$A" exactly once. So what you have forgotte

Re: [R] Using lm with a matrix?

2008-06-07 Thread Charilaos Skiadas
On Jun 7, 2008, at 8:13 AM, jonboym wrote: I'm trying to do a linear regression between the columns of matrices. In example below I want to regress column 1 of matrix xdat with column1 of ydat and do a separate regression between the column 2s of each matrix. But the output I get seem

Re: [R] write.table() error

2008-06-05 Thread Charilaos Skiadas
I just managed to write things just fine, and then I recalled that I had a similar problem when teaching our students SPSS (Yes, I know, don't ask...), but the problem was effectively this: If a given file was open in Excel, then that file was locked and no other program could use it until

Re: [R] Existence of formal arguments.

2008-06-05 Thread Charilaos Skiadas
On Jun 5, 2008, at 9:13 PM, Duncan Murdoch wrote: On 05/06/2008 8:23 PM, Rolf Turner wrote: I just discovered what seems to me to be a slight funny in respect of formal argument names. If I define a function foo <- function(a,b){ ... whatever ...} then ``inside'' foo() the exists() fu

Re: [R] A question about *read.table()*

2008-05-30 Thread Charilaos Skiadas
On May 30, 2008, at 7:56 PM, ss wrote: and I got an error message: exprSet <- read.table('process_all4_GSA2.txt', row.names = 1,header =FALSE) Error in read.table("process_all4_GSA2.txt", row.names = 1, header = FALSE) : duplicate 'row.names' are not allowed I would say that's pretty e

Re: [R] apply in apply

2008-05-30 Thread Charilaos Skiadas
On May 30, 2008, at 5:37 AM, baptiste Auguié wrote: Thank you for the suggestions (off-list as well). I think the best option may eventually be an explicit for loop to make things clearer. To clarify a bit, I've used the plot function in the example where in fact it is a numerical integrat

Re: [R] nlm and "missing argument

2008-05-29 Thread Charilaos Skiadas
On May 29, 2008, at 11:54 PM, Redding, Matthew wrote: Dear R Gurus, I am having a little difficulty with nlm. I've searched the archives and found nothing that tells me why this is occuring -- though there are some slightly similar issues. A simple example: lev2<-function(aaa,bbb,ccc,ddd,e

Re: [R] Including a tilde in a plotmath-type call

2008-05-29 Thread Charilaos Skiadas
On May 29, 2008, at 11:02 PM, [EMAIL PROTECTED] wrote: Suppose I have a plot plot(1:10, pch = "") And I want some text to indicate a Normal distrubition. I could do this: text(5, 6, substitute(XN(mu, sigma^2)), adj = 0) text(5.35, 6, "~", adj = 0) But that's clumsy, and depending on you

Re: [R] Problem with scatter plotting

2008-05-29 Thread Charilaos Skiadas
On May 29, 2008, at 9:56 PM, lek2k wrote: PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. I (and certainly many others) have been using multiple points calls for a while now with no problems at

Re: [R] can I do this with R?

2008-05-28 Thread Charilaos Skiadas
A google search for "logistic regression with stepwise forward in r" returns the following post: https://stat.ethz.ch/pipermail/r-help/2003-December/043645.html Haris Skiadas Department of Mathematics and Computer Science Hanover College On May 28, 2008, at 7:01 AM, Maria wrote: Hello, I am

Re: [R] how to bind lists recursively

2008-05-27 Thread Charilaos Skiadas
On May 27, 2008, at 10:43 PM, Daniel Yang wrote: Dear all, I want to create a list that contains 0,1,2,3, ..., 1 as its elements. I used the following code, which apparently doesn't work very well. a <- 0 for(i in 1:1) { a <- list(a, i) } The result is not what I wanted. So ho

Re: [R] Rotated text on a regression line

2008-05-27 Thread Charilaos Skiadas
I think this comment for ?par, meant for both crt and srt, applies: crt A numerical value specifying (in degrees) how single characters should be rotated. It is unwise to expect values other than multiples of 90 to work. Compare with srt which does string rotation. So I would say that even

Re: [R] How to pass variable of for loop on read table text

2008-05-23 Thread Charilaos Skiadas
?paste paste('text',y,'.txt', sep="") and you likely need data[[y]] instead of data$y. On May 23, 2008, at 9:05 PM, Jason Lee wrote: Hi, I have a couple of text and would like to automate of reading these multiple files using (namely; text1.txt, text2.txt) for(y in 3:10){ data$y<-rea

Re: [R] Some problems with Sweave

2008-05-23 Thread Charilaos Skiadas
Try results=verbatim instead of results=tex. Haris Skiadas Department of Mathematics and Computer Science Hanover College On May 23, 2008, at 4:16 AM, [EMAIL PROTECTED] wrote: Dear R users, I'm working in a brief R-tutorial to a group of students. To make that I'm using Sweave but I've got

Re: [R] About Passing Arguments to Function

2008-05-22 Thread Charilaos Skiadas
On May 22, 2008, at 9:14 PM, Edward Wijaya wrote: Hi, Below I have a function mlogl_k, later it's called with "nlm" . __BEGIN__ vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) mlogl_k <- function( k_func, x_func, theta_func, samp) { tot_mll <- 0 for (comp in 1:k_func) { curr_ml

Re: [R] 3D Area Diagram

2008-05-22 Thread Charilaos Skiadas
On May 22, 2008, at 3:04 PM, AlGates wrote: Hello, maybe someone can help me. I am looking for a possibility to plot a 3D area diagram like in Excel: http://www.microsoft.com/germany/mac/excel/images/chartbefore.jpg Watch this! Would be nice if someone had any idea about that. I don't

Re: [R] disaggregate frequency table into flat file

2008-05-22 Thread Charilaos Skiadas
On May 22, 2008, at 8:56 AM, maiya wrote: sorry, my mistake! the data frame should read: orig<-as.data.frame.table(orig) orig Var1 Var2 Freq 1AA 40 2BA5 3AB 30 4BB 25 but basicaly i would simply like a sample of the original matrix ( which is a fre

Re: [R] Computing Maximum Loglikelihood With "nlm" Problem

2008-05-21 Thread Charilaos Skiadas
Try: mlogl_out <- nlm(mlogl, mean(vsamples), vsamples) or mlogl_out <- nlm(mlogl, mean(vsamples), x=vsamples) The argument vsamples=vsamples is passed to mlogl, since nlm does not recognize it. But mlogl doesn't have a vsamples argument, only alpha and x arguments. So you have to either le

Re: [R] Question about banking to 45 degrees.

2008-05-20 Thread Charilaos Skiadas
On May 20, 2008, at 5:59 PM, Deepayan Sarkar wrote: On 5/20/08, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: Here is how I see it. Let me define a "visual y-unit" as the height of a unit of data in the y-direction, and similarly for a visual x-unit. Then the aspect ratio

Re: [R] Question about banking to 45 degrees.

2008-05-20 Thread Charilaos Skiadas
On May 20, 2008, at 2:34 PM, Deepayan Sarkar wrote: On 5/20/08, Joshua Hertlein <[EMAIL PROTECTED]> wrote: Hello, I am very interested in "banking to 45 degrees" as defined by William S. Cleveland in "Visualizing Data." I like to do it in R as well as Excel, etc. With R I have come

Re: [R] Alignment of axes intersection

2008-05-20 Thread Charilaos Skiadas
On May 20, 2008, at 11:49 AM, David Afshartous wrote: All, Very basic question I can't seem to find the answer to: plot(0:10, 0:10) The axes intersection is not aligned at (0,0) in the lower left. This is on purpose, so that data points are not obscured by the axes. The axis range is alwa

Re: [R] Histograms without bars

2008-05-19 Thread Charilaos Skiadas
Hi Andre, On May 19, 2008, at 4:28 PM, Andre Nathan wrote: Hello I'd like to plot a histogram of some data composed of real numbers. The bin width I'm using is ~ 0.01, which results in high values in the y axis, so that the area under each bar corresponds to the probability of the data i

Re: [R] Figure environment and includegraphics options from Sweave

2008-05-18 Thread Charilaos Skiadas
On May 18, 2008, at 10:41 AM, BXC (Bendix Carstensen) wrote: Tha handy thinb about the fig=TRUE option in Sweave is that you do not have to bother about filenames and starting and stpping the device. I want the the resulting LaTeX to look as: \begin{Schunk} \begin{Sinput} x <- seq(-2 * pi, 2

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Charilaos Skiadas
On May 15, 2008, at 5:37 PM, e-letter wrote: Below is direct copy from command terminals of both pcs (mandrake 92 with r 171; mandriva 2008 with r 251, respectively). R : Copyright 2003, The R Development Core Team Version 1.7.1 (2003-06-16) R is free software and comes with ABSOLUTELY NO WAR

Re: [R] proto naming clash?

2008-05-15 Thread Charilaos Skiadas
On May 15, 2008, at 1:24 PM, David Katz wrote: Trying to learn Proto. This threw me: #startup r... library(proto) a <- proto(x=10) a$x [1] 10 x <- proto(x=100) x$x Error in get("x", env = x, inherits = TRUE) : invalid 'envir' argument Do I simply need to be careful to name proto obje

Re: [R] lattice histogram problem with integers values and nint

2008-05-15 Thread Charilaos Skiadas
Two comments. First of all, I don't see how you can be sure that if you specify 365 bins, then each bin will contain exactly one day. In order to do that, you need to know that each bin has width exactly 1, and you don't tell lattice to use such a width, so it is likely choosing something e

Re: [R] off topic

2008-05-15 Thread Charilaos Skiadas
On May 15, 2008, at 2:07 PM, lamack lamack wrote: Dear all, someone could explain why the following example is not a valid randomization scheme? Consider an experiment in which the six experimental units to be used are permanently fixed in a row and two treat- ments are to be randomly ass

Re: [R] lattice: left-aligned text in strips?

2008-05-15 Thread Charilaos Skiadas
ligned) ### Anywag, thanks again for having taken the time thinking about my question; Heinrich. -Ursprüngliche Nachricht- Von: Charilaos Skiadas [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 14. Mai 2008 13:30 An: RINNER Heinrich Cc: [EMAIL PROTECTED] Betreff: Re: [R] lattice: left-

Re: [R] fancy text in pairs()

2008-05-14 Thread Charilaos Skiadas
On May 14, 2008, at 9:28 PM, [EMAIL PROTECTED] wrote: Dear List, I'm currently trying to produce a number of pairs() plots with special text labels in the diagonal panels giving the units for the various quantities. These labels stretch across multiple lines, with the names of the quantities a

Re: [R] win.graph() with more than one Lattice plot

2008-05-14 Thread Charilaos Skiadas
Deepayan's new book to the rescue again: http://lmdvr.r-forge.r-project.org/figures/figures.html? chapter=01;figure=01_04 Look at the code for this figure, especially the last two lines. Not sure that the fact that it's a win.graph device has much to do with this. Haris Skiadas Departmen

Re: [R] lattice: left-aligned text in strips?

2008-05-14 Thread Charilaos Skiadas
On May 14, 2008, at 3:47 AM, RINNER Heinrich wrote: [adapted repost of question http://tolstoy.newcastle.edu.au/R/e4/help/08/03/6260.html] Dear R community, by default, text in the strips of a trellis plot is centered in the strip. Is there a way to have the text left-aligned? For example: l

Re: [R] test

2008-05-13 Thread Charilaos Skiadas
On May 13, 2008, at 5:52 AM, Esmail Bonakdarian wrote: Tony Plate wrote: You probably should check this section in your R-help subscription options (via https://stat.ethz.ch/mailman/options/r-help/, I think): Receive your own posts to the list? Tony, Like jt I too have it set to receive

Re: [R] Format integer

2008-05-12 Thread Charilaos Skiadas
On May 12, 2008, at 5:22 PM, Anh Tran wrote: Hi, What's one way to convert an integer to a string with preceding 0's? such that '13' becomes '013' to be put into a string I've tried formatC, but they removes all the zeros and replace it with blanks formatC(13, width=10, format="d", fl

Re: [R] Hashes as S4 Classes, or: How to separate environments

2008-05-10 Thread Charilaos Skiadas
On May 10, 2008, at 7:30 AM, Hans W Borchers wrote: For learning purposes mainly I attempted to implement hashes/maps/ dictionaries (Python lingua) as S4 classes, see the coding below. I came across some rough S4 edges, but in the end it worked (for one dictionary). When testing ones sees th

Re: [R] Is there in R a function equivalent to the mround, as found in most spreadsheets?

2008-05-09 Thread Charilaos Skiadas
On May 9, 2008, at 5:39 AM, Dieter Menne wrote: Dr. Ottorino-Luca Pantani unifi.it> writes: Imagine that for a particular cuvette (I have 112 different cuvettes !!) you have to mix the following volumes of solution A, B, and C respectively. c(1803.02, 193.51, 3.47) Each solution is to

Re: [R] Is it possible to do fancy area plots?

2008-05-08 Thread Charilaos Skiadas
On May 8, 2008, at 9:11 PM, Sean Carmody wrote: Does anyone have any ideas about how you could use R to produce a fancy area plot like this one in the NY Times? http://tinyurl.com/6rr22g I certainly hope not, I wouldn't want my favorite statistics program to produce an area graph where the

Re: [R] LaTeX in system()

2008-05-08 Thread Charilaos Skiadas
This is exactly the problem: apps launched through the Finder do not go through the usual shell initialization process, where the PATH is typically set up. The two solutions would be to either use the full path to the command, or else start R.app from the Terminal, via the command: open -

Re: [R] figure margins too large for a barplot in png, pdf ok

2008-05-06 Thread Charilaos Skiadas
On May 6, 2008, at 10:43 PM, Alexy Khrabrov wrote: I've used to have a script with a barplot command it in, preceded by a png: png(graph.file,height=H,width=W) barplot(t,names.arg=breaks[2:(length(t)+1)],tck=gridlines) -- worked before R 2.6.2. When I tried it in R 2.6.2, which I have for

Re: [R] building a formula string bit by bit ..

2008-05-06 Thread Charilaos Skiadas
I would actually go with this: bits=c(1, 0, 1, 1, 0) paste("X", which(bits==1), sep=".",collapse="+") No need for the vars variable. Though admittedly it breaks down if bits is identically 0. Haris Skiadas Department of Mathematics and Computer Science Hanover College On May 6, 2008, at 3:1

Re: [R] Formating numbers

2008-05-05 Thread Charilaos Skiadas
On May 5, 2008, at 7:03 AM, pecardoso wrote: Maybe a very, very basic question but how can I get a vector of values with the specific format: 001,002,010,100 instead of: 1,2,10,100 Not perfect, but might get you started: sprintf("%03d",c(8:10,101)) or formatC(c(8:10,101), width=3, flag="

Re: [R] Lattice book

2008-04-30 Thread Charilaos Skiadas
Actually it's been out for a couple of weeks now at least. I just finished my first reading of it, and I must say it was spectacular. Congratulations Deepayan, the book gave me exactly the kind of lattice knowledge I needed, and then some. The graphics are really impressive and good illustr

Re: [R] How to test if t[["cat"]] exists ?

2008-04-15 Thread Charilaos Skiadas
On Apr 15, 2008, at 9:53 PM, Ng Stanley wrote: > Hi, > >> t <- list("cat"=1) >> exists("t") > [1] TRUE >> exists("t[["cat"]]") > Error: unexpected symbol in "exists("t[["cat" >> exists("t[[\"cat\"]]") > [1] FALSE Perhaps what you want is: "cat" %in% names(t) > Thanks > Stanley Haris Skiadas De

Re: [R] Making a data frame into a factor ?

2008-04-15 Thread Charilaos Skiadas
I think you want to look into ?stack. For example: x<-data.frame(a=1:5,b=6:10) y<- stack(x) Then x$values are the values, and x$ind is the factor. On Apr 15, 2008, at 9:36 PM, Paul Lynch wrote: > Hi, >I'm trying to do a linear regression style one-way ANOVA using some > data in a data frame

Re: [R] densities from a list with data.frames

2008-04-11 Thread Charilaos Skiadas
Did you try Richie's suggestion? The x[,1] part will pick out the first column of the data frame. Seems to do exactly what you asked for. Haris Skiadas Department of Mathematics and Computer Science Hanover College On Apr 11, 2008, at 7:57 AM, Antje wrote: > Of course, I know, but I cannot app

Re: [R] Number of words in a string

2008-04-09 Thread Charilaos Skiadas
On Apr 9, 2008, at 1:27 PM, Hans-Jörg Bibiko wrote: > > On 09.04.2008, at 17:46, Shubha Vishwanath Karanth wrote: >> To put it simple, >> >> C=c("My Dog", "Its really good", "Beautiful") >> >> Now, >> SOMEFUNCTION(C) should give: c("My", "Its really", "") > > SOMEFUNCTION <- function(x) gsub(" *\

Re: [R] What to use for assignment, " = " or " <- "?

2008-04-06 Thread Charilaos Skiadas
On Apr 6, 2008, at 10:35 AM, Ben Bolker wrote: > csiro.au> writes: > >> >> I've noticed an increasing tendency for people to use '=' rather than >> the older '<-' symbol. When '=' became available as an assignment >> operator in S-PLUS in the late '90s my first reaction was to >> switch to >>

Re: [R] Definition of "wrapper"?

2008-03-30 Thread Charilaos Skiadas
On Mar 30, 2008, at 2:51 PM, Bryan Hanson wrote: > I think I more or less understand what a “wrapper” is, but I’d like > to hear > how more experienced R users define it, and especially I'd like to > know if > there is a formal definition. In my reading, it seems like there > are a > fairly

Re: [R] Sweave - print \n ?

2008-03-29 Thread Charilaos Skiadas
Try adding strip.white=false on the code chunks: <>= hline() hline() @ Read ?RweaveLatex for more settings. or if you want this to happen in all code chunks add this early on in the rnw file: \SweaveOpts{strip.white=false} Haris Skiadas Department of Mathematics and Computer Science Hanover

Re: [R] barplot as Trellis graphic

2008-03-28 Thread Charilaos Skiadas
raphics? I found Paul Murrell's book useful. > Agus Haris Skiadas Department of Mathematics and Computer Science Hanover College > Charilaos Skiadas escribió: >> On Mar 27, 2008, at 1:47 PM, Agustin Lobo wrote: >>> Thanks, it was a matter of reshaping the data matrix a

Re: [R] barplot as Trellis graphic

2008-03-27 Thread Charilaos Skiadas
On Mar 27, 2008, at 1:47 PM, Agustin Lobo wrote: > Thanks, it was a matter of reshaping the data matrix as I usually have > it, ie: > datos <- > data.frame(x=abs(round(rnorm(100,10,5))),y=abs(round(rnorm > (100,2,1))),f=factor(round(runif(100,1,3 > > to become: > > datos2 <- > data.frame(V1=

Re: [R] (no subject)

2008-03-23 Thread Charilaos Skiadas
As you have not given us a reproducible example (namely we don't really know what "test" is), there are likely better ways to do this than what I am about to suggest, and you can find examples in the relevant plot functions likely, but I think what you want can be achieved using ifelse:

Re: [R] Mean in bwplot

2008-03-23 Thread Charilaos Skiadas
On Mar 23, 2008, at 1:37 PM, Charilaos Skiadas wrote: > panel.points(mean(x), y, col="red", ...) Correction, this should have probably been: panel.points(tapply(x, y, mean), y, col="red", ...) All this assuming you want horizontal boxplots. Haris Skiadas De

Re: [R] Mean in bwplot

2008-03-23 Thread Charilaos Skiadas
On Mar 23, 2008, at 11:31 AM, Plantky wrote: > Hi everyone, > > Is there a way to include both mean and median in a bwplot? And what > should I do to convert the median dots into lines? Did you look at the documentation for bwplot and panel.bwplot? This should do it , adjust at will: ex <- data

Re: [R] setAs vs setIs

2008-03-16 Thread Charilaos Skiadas
On Mar 16, 2008, at 8:12 PM, Christophe Genolini wrote: > Hi the list > > I am fighting with the twins setAs and setIs... > > Here are some questions and comments (comments to myself but that > migth > be wrong, it is why I am posting them) > 1. Very surprising : using setIs define 'is', 'as<-'

Re: [R] Sealed for setGeneric

2008-03-13 Thread Charilaos Skiadas
On Mar 13, 2008, at 5:04 AM, Christophe Genolini wrote: > Hi the list > > When two setGeneric occurs on the same function, the second erage the > first and erase all the function previously define. > Is it possible to prevent that ? Is it possible to declare a > setGeneric > that can not be eras

Re: [R] Weighting data when running regressions

2008-03-10 Thread Charilaos Skiadas
On Mar 10, 2008, at 7:49 AM, Elena Wilson wrote: > > linmod=lm(Y~X1+X2+X3+X4W, subset=(X5==1 & X6==7), weights==WEIGHT) That should likely be weights=WEIGHT, with one equal sign. Haris Skiadas Department of Mathematics and Computer Science Hanover College ___

Re: [R] (no subject)

2008-03-10 Thread Charilaos Skiadas
If you have an original file in excel, the way I get such files is to save them as csv (comma-separated), and then to use read.csv. Then these empty spots are more easily handled, since they correspond to too successive commas. Haris Skiadas Department of Mathematics and Computer Science Han

Re: [R] Odp: comparing two columns of a dataset on a graph

2008-03-10 Thread Charilaos Skiadas
On Mar 10, 2008, at 5:15 AM, Petr PIKAL wrote: > Hi > [EMAIL PROTECTED] napsal dne 10.03.2008 08:12:28: > >> hello >> >> I want to compare the values of two columns of a dataset on a graph. >> Which graphic do you recommend ? > > It depends on what values you have and what you want to compare. > >

Re: [R] Calling plot with a formula, from within a function, using ..., and xlim

2008-03-09 Thread Charilaos Skiadas
as to allow the use of variables from the data frame in the specification of graphics parameters like col, lty etc? Your suggestion does indeed work very nicely in my case. I could probably do away from the formula interface altogether, but it is a convenient way of specifying the axis label

Re: [R] R error: Not able to launch R 2.6.2

2008-03-09 Thread Charilaos Skiadas
On Mar 9, 2008, at 12:12 PM, Keizer_71 wrote: > > Hi Everyone, > > I am having trouble using R. I am not sure what happen but when i > start R, i > am getting error message > > "Fatal Error: Unable to restore saved data in .RData. Just google for "unable to restore saved data in .RData. ", and

[R] Calling plot with a formula, from within a function, using ..., and xlim

2008-03-09 Thread Charilaos Skiadas
I ran into a weird, to me at least, problem, and hoping someone can shed some light into it. In a nutshell, there seems to be some problem when one calls plot with a formula, from within another function, using ... to pass arguments, and one of those arguments being xlim (and only xlim show

Re: [R] locate the rows in a dataframe with some criteria

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 10:50 AM, zhihuali wrote: > > Hi, netters, > > This is probably a rookie question but I couldn't find the answer > after hours of searching and trying. > > Suppose there'a a dataframe M: > > x y > 10 A > 13 B > 8 A > 11 A > > I want to locate the rows where x >=

Re: [R] How to navigate in layout() created graph?

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 8:41 AM, Rainer M Krug wrote: >> >> I'm not sure I understand it, why don't you want to just number the >> subfigures in the order in which you will draw them? > > Because i thought it would be easier the other way round? Thanks > anyway Yes, I agree it should not be as har

Re: [R] How to navigate in layout() created graph?

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 8:02 AM, Rainer M Krug wrote: > On 07/03/2008, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: >> On Mar 7, 2008, at 7:18 AM, Rainer M Krug wrote: >> >>> Hi >>> >>> I created a complex layout with using layout() and it looks &

Re: [R] training svm

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 2:17 AM, Oldrich Kruza wrote: > Hello Soumyadeep, > > if you store the data in a tabular file, then I suggest using standard > text-editing tools like cut (say your file is called data.csv, fields > are separated with commas and you want to get rid of the third and > sixth colum

Re: [R] How to navigate in layout() created graph?

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 7:18 AM, Rainer M Krug wrote: > Hi > > I created a complex layout with using layout() and it looks exactly as > I need it. But I don't want to print in the order in which the > subfigure are numbered, but in a different order. > > How can I navigate in the layout so that I can s

Re: [R] read stata data file

2008-03-06 Thread Charilaos Skiadas
On Mar 6, 2008, at 9:05 PM, John Taffe wrote: > Dear R-help list, > > I'm new to R. I tried to get R to read a Stata data file using the > read.dta function in the package "foreign", which I downloaded and > extracted to "C:\Program Files\R\R-2.6.2\library" on my pc. > > I tried > >> nora <- rea

Re: [R] R-Logo in \LaTeX

2008-03-06 Thread Charilaos Skiadas
On Mar 6, 2008, at 1:49 PM, Mag. Ferri Leberl wrote: > Dear everybody! > Is there a command in \LaTeX to display the R-Logo or has anybody > made it up? > Thank you in advance. Isn't it just an image? Hence you would include it like one usually includes images. Or do you mean something else?

Re: [R] types of vectors / lists

2008-03-05 Thread Charilaos Skiadas
On Mar 5, 2008, at 2:56 PM, [EMAIL PROTECTED] wrote: > Hello, > > I am an advanced user of R. Recently I found out that apparently I do > not fully understand vectors and lists fully > Take this code snippet: > > > T = c("02.03.2008 12:23", "03.03.2008 05:54") > Times = strptime(T, "%d.%m.%Y %H:%M

Re: [R] matrix inversion using solve() and matrices containing large/small values

2008-03-05 Thread Charilaos Skiadas
Sorry, I meant to send this to the whole list. On Mar 5, 2008, at 8:46 AM, Charilaos Skiadas wrote: > The problem doesn't necessarily have to do with the range of data. > At first level, it has to do with the simple fact that dfdb has > rank 6 at most, (7 at most in general,

Re: [R] vertex labels in igraph from adjacency matrix

2008-03-04 Thread Charilaos Skiadas
On Mar 5, 2008, at 1:39 AM, Mark W Kimpel wrote: > I am getting some unexpected results from some functions of igraph and > it is possible that I am misinterpreting the vertex numbers. Eg., the > max betweenness measure seems to be from a vertex that is not > connected > to a single other vertex

Re: [R] simulating the anova

2008-03-04 Thread Charilaos Skiadas
On Mar 5, 2008, at 12:03 AM, Will Holcomb wrote: > I have been trying to figure out how to run a simple simulation of > the ANOVA > and I'm coming up just a bit short. The code I've got is: > > cohen.f = .25 > groups = 4 > between.var = 19 > within.var = between.var / cohen.f ^ 2 > n = 500 > s

Re: [R] connectivity measure for graph nodes

2008-03-04 Thread Charilaos Skiadas
Mark, if I understand what you are asking, then you likely want either the Floyd-Warshall algorithm: http://en.wikipedia.org/wiki/Floyd-Warshall_algorithm or Djikstra's algorithm http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm The package igraph seems to have some useful methods,

Re: [R] read.zoo problem reading in date time

2008-03-03 Thread Charilaos Skiadas
On Mar 3, 2008, at 11:12 AM, stephen sefick wrote: > x<-read.zoo("SC2.csv", sep="," , format="%m%m/%d%d/%y%y%y%y %h%h:%m% > m") > > #Error in read.zoo("SC2.csv", sep = ",", format = > "%m%m/%d%d/%y%y%y%y %h%h:%m%m") : > index contains NAs Error message You need header=TRUE in th

  1   2   >