Re: [R] Plotting numeric values against non numeric items

2010-01-09 Thread Jim Lemon
On 01/09/2010 12:38 PM, lse1986 wrote: Hi i want do a line graph. My y axis contains numeric values. My x axis contains non numeric statements. This is what i want the graph to look like. When i try to plot this graph on R it comes up with the following error message: "Error in plot.window(..

Re: [R] Arguments of a function

2010-01-09 Thread Peter Ehlers
You could define a list and then just access the appropriate elements of that list: my.f <- function(a, b) { x1 = equation 1 x2 = equation 2 x3 = equation 3 L <- list(x1, x2, x3) y <- L[[a]] + L[[b]] } my.f(1,2) my.f(2,3) -Peter Ehlers Lisa wrote: Dear all, I have a question about

[R] Is there any function in R like ezplot in matlab?

2010-01-09 Thread 军 吕
Hi, Is there any function in R like ezplot in matlab? How to draw the relationship between x y like this x^y+y^(sinx)=log(x+y) Thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Is there any function in R like ezplot in matlab?

2010-01-09 Thread Duncan Murdoch
On 09/01/2010 5:22 AM, 军 吕 wrote: Hi, Is there any function in R like ezplot in matlab? How to draw the relationship between x y like this x^y+y^(sinx)=log(x+y) It's not pre-packaged, but drawing a contour plot of the function f <- function(x,y) x^y+y^sin(x) - log(x+y) should do it: xv

[R] aov function syntax

2010-01-09 Thread Dave Deriso
Hello, I have a simple question about using the aov function syntax (ie. * + or :) for the interaction of 2 factors. I have read the help files, and researched other sites, and have included my source files. My goal is to measure the signifigance of the interaction between population and condition

Re: [R] aov function syntax

2010-01-09 Thread Dave Deriso
Oops small error Use this to import the data #import the data allData.import=read.table("http://files.davidderiso.com/r/allData.data ",header=T) studentData.import=read.table(" http://files.davidderiso.com/r/studentData.data",header=T) everything else is good On Sat, Jan 9, 2010 at 3:33 AM, Dav

Re: [R] strange behavior of R

2010-01-09 Thread Liviu Andronic
On Fri, Jan 8, 2010 at 10:57 PM, Fahim wrote: >> arr > [1] "y1" "y2" > At this moment 'arr' no longer has two dimensions, but only one. So you can access it only as a vector. > Problem: I want to access the first row now using: >>arr[1, ] > Error in arr[1, 1] : incorrect number of dimensions > Co

Re: [R] aov function syntax

2010-01-09 Thread Prof Brian Ripley
What are you trying to do? Your example is not what is commonly called ANOVA (some call it ANCOVA) and more often lm() is used. I suspect that you intended 'population' to be a factor, and it is not. So population:condition is not an interaction but different slopes for population by levels

Re: [R] aov function syntax

2010-01-09 Thread Dave Deriso
Thank you for your help professor Ripley! I suppose my problem is more theoretical related than syntax. I will review your suggested literature. and yes, I did error on the data source, thank you for catching my mistake!! Best, Dave On Sat, Jan 9, 2010 at 3:56 AM, Prof Brian Ripley wrote: > W

Re: [R] time series analysis for a time series without a regular frequency

2010-01-09 Thread Achim Zeileis
On Fri, 8 Jan 2010, Erin Hestir wrote: I am trying to conduct a time series analysis on historic hydrologic data, but I cannot coerce it into class ts because it does not have regular sampling intervals (some years have 20 samples, other have 8). Specifically I am trying to perform a CUSUM or or

Re: [R] Arguments of a function

2010-01-09 Thread Gabor Grothendieck
Normally one designs their function to input a formula in such a case rather than design it to take the names directly. Thus: f <- function(formula = ~ x1 + x2) { xs <- c(x1 = 1, x2 = exp(1), x3 = 2*pi) v <- all.vars(formula) stopifnot(length(v) == 2, all(v %in% names(xs))) sum(xs[v]) }

Re: [R] how to flatten a list to the same level?

2010-01-09 Thread Mark Heckmann
Henrique, thanks for the code!! It works out fine for vectors. I forgot to mention I also have dataframes as list elements. Thus I want the structure of the list element to be kept intact. I tried an recursive approach (which unfortunately resulted in some more code) which works. .getNonL

Re: [R] postscript, greek lellters

2010-01-09 Thread baptiste auguie
Hi, Something like this maybe, plot.new() lab = expression(bar(T)*"("*-x*" ; "*alpha*")"-G*"("*x*" ; "*alpha*" , "*J*")") text(0.5,0.5,lab) ?plotmath HTH, baptiste 2010/1/8 bernardo lagos alvarez : > Dear useRs, > > How can I, writting the correct greek letter using postscrip or pdf functio

[R] parsing pdf files

2010-01-09 Thread David Kane
I have a pdf file that I would like to parse into R: http://www.williams.edu/Registrar/geninfo/faculty.pdf For now, I open the file in Acrobat by hand, then save it "as text" and then use readLines(). That works fine but a) I am concerned that some information may be lost and b) I may be doing th

[R] errors when installing packages (ubuntu)

2010-01-09 Thread romunov
Hi List, I'm having problems installing certain packages. When I try to install fields, I get the output below. I have highlighted the what I perceive as the first error (spam seems to be a dependency of fields). Can I assume this is causing dependency problems for fields, which fails to install a

Re: [R] parsing pdf files

2010-01-09 Thread Barry Rowlingson
On Sat, Jan 9, 2010 at 1:11 PM, David Kane wrote: > I have a pdf file that I would like to parse into R: > > http://www.williams.edu/Registrar/geninfo/faculty.pdf > > For now, I open the file in Acrobat by hand, then save it "as text" > and then use readLines(). That works fine but a) I am concern

Re: [R] parsing pdf files

2010-01-09 Thread Albert-Jan Roskam
Hi, I used pdftk (pdf toolkit) before. A quick glance at the features seems to tell that it does *not* support what you are looking for, but it may nonetheless be a useful starting point: http://www.accesspdf.com/pdftk/ . The nice thing is that it's a command-line tool. Cheers!! Albert-Jan

Re: [R] parsing pdf files

2010-01-09 Thread Laurent Rhelp
David Kane a écrit : I have a pdf file that I would like to parse into R: http://www.williams.edu/Registrar/geninfo/faculty.pdf For now, I open the file in Acrobat by hand, then save it "as text" and then use readLines(). That works fine but a) I am concerned that some information may be lost

[R] importing home range polygon

2010-01-09 Thread Mustafa Durmus
Hi everyone, I am using adehabitat package for habitat selection analysis, I know R also do home range analysis, but I want to import home range polygon to R and run K-select analysis on this home range polygon. Do you know any material to help me? Thanks, Mustafa [[alternative HTML ver

[R] Boxplots

2010-01-09 Thread Marlin Keith Cox
I have a data set with four columns and need to make boxplots from them. Data is as follows: tank TanksTotal cons_hat 1aa4 5.651017 5.59 2aa5 5.017499 5.29 3aa6 4.894238 4.69 4cc4 3.986347 3.40 5cc5 4.099442 3.58 6cc6 4.15052

[R] Reducing the size of a large script top speed onset of execution

2010-01-09 Thread Dennis Fisher
Colleagues, (R 2.10 on all platforms) I have a lengthy script (18000 lines) that runs within a graphical interface. The script consists of 100's of function followed by a single command that calls these functions (execution depends on a number of environment variables passed to the script

Re: [R] Plotting numeric values against non numeric items

2010-01-09 Thread lse1986
Hey Jim, Thanks for your reply! I tried what you said, i still kept getting errors. here's what i want my graph to look like: http://i.imagehost.org/0474/Untitled_5.jpg i have x<-c("not stir", "stir") i can't plot it though :( Jim Lemon wrote: > > On 01/09/2010 12:38 PM, lse1986 wrote: >>

Re: [R] Building static HTML help pages in R 2.10.x on Windows

2010-01-09 Thread Dieter Menne
Michal Kulich wrote: > > This works. Not entirely invisible but not a big deal about that. > The R code run within Rterm is > > options(help_type="html",help.ports=6800) > help.start() > library(audio) > wait(-1) > > I tried to run your code with System.sleep(10) instead of wait(-1) insi

Re: [R] Plotting numeric values against non numeric items

2010-01-09 Thread jim holtman
Try this: # create data x <- rbind("Not Stir"=c(400, 700), Stir=c(50, 180)) matplot(x, type='o', pch=16, cex=2, xaxt='n') axis(1, at=1:2, labels=rownames(x)) On Sat, Jan 9, 2010 at 9:29 AM, lse1986 wrote: > > Hey Jim, > > Thanks for your reply! > > I tried what you said, i still kept gettin

[R] aov vs lme for split plot analysis

2010-01-09 Thread Rafael Rubio de Casas
Dear R community, I am trying to do a split-plot analysis as follows. I have a data set (“morf”) with plant data from 6 “blocks” at different latitudes, each divided in 3 plots. The full-plot “treatment” is “soil type” and has three levels. Within each plot I have two levels of radiation, code

Re: [R] Reducing the size of a large script top speed onset of execution

2010-01-09 Thread Prof Brian Ripley
Please just use make a package; then all the effort of parsing the code is done at install time, you can use lazy-loading Or if you are for some reason averse to that, source the code into an environment, save that and simply attach() its save file next time. Packages of that size load i

Re: [R] postscript, greek lellters

2010-01-09 Thread bernardo lagos alvarez
Thank you, Dennis and Baptisite By including the. eps in my . tex and the compilation of the .tex, this does not generate the symbol of the greek letter. Bernardo. 2010/1/9 baptiste auguie : > Hi, > > Something like this maybe, > > plot.new() > > lab = expression(bar(T)*"("*-x*" ; "*alpha*")"-G

Re: [R] postscript, greek lellters

2010-01-09 Thread bernardo lagos alvarez
The problem is of the .dvi. It was arranged,using the solution of Baptiste. Bernardo. 2010/1/9 bernardo lagos alvarez : > Thank you, Dennis and Baptisite > > By including the. eps in my  . tex and the compilation of the .tex, > this does not generate the symbol of the greek letter. > > Bernardo. >

[R] [Lattice] panel.levelplot - shrink argument to highlight absolute z-values

2010-01-09 Thread nabble . 30 . miller_2555
Hi - I have a levelplot with positive and negative z-values. I'd like to scale the levelplot rectangles proportional to the *absolute* z-values to highlight the z-value extremes (while retaining the color difference to track the positive/negative attribute). I've likely missed something in the

Re: [R] Reducing the size of a large script top speed onset of execution

2010-01-09 Thread Dennis Fisher
Professor Ripley, Thanks for your suggestions. I will look into the package approach. As far as the "source" speed issue, you suggested that the problem may relate to guessing encodings so I added: options(encoding="UTF-8") at the beginning of the code (was this the correct approach

[R] bootstrapping a matrix using boot package

2010-01-09 Thread Amit
Dear All, I am trying to bootstrap a large data matrix 'exp' of dimension 9275x898 using package 'boot'. I am trying to calculate correlation of the obtained samples. I have done following so far: >library(boot) >load("ratio_exp.RData") #loading the data matrix >dim(ratio_exp) [1] 9275 898 >sampl

Re: [R] errors when installing packages (ubuntu)

2010-01-09 Thread Uwe Ligges
Looks like spam depends on R-2.10.x which the package maintainer (CCing) has not declared in the DESCRIPTION file. So either install R-2.10.1 and try again or use an older spam version from the CRAN archives for your old version of R. To Reinhard Furrer: can you please upload a new version with

Re: [R] Online R documentation

2010-01-09 Thread Dieter Menne
Karl Ove Hufthammer wrote: > > In case anybody is looking for ideas in how to improve the above > site, inclusion of rendered example graphs, similar to the ones at > "http://www.metaresearch.de/exlib/";, would be nice. > If the format you use on your site were accepted as the standard in R

Re: [R] Online R documentation

2010-01-09 Thread Duncan Murdoch
On 09/01/2010 12:48 PM, Dieter Menne wrote: Karl Ove Hufthammer wrote: In case anybody is looking for ideas in how to improve the above site, inclusion of rendered example graphs, similar to the ones at "http://www.metaresearch.de/exlib/";, would be nice. If the format you use on your site

Re: [R] Directory operations

2010-01-09 Thread anupam sinha
Hi Jim, Thanks for your suggestion. I tried scripting but gives me an error. Can you tell me what am I doing wrong here ? *> list.files()->org_xml_dirs > for (i in org_xml_dirs){ + setwd("/home/anupam/Research/Anupam_data/ORG_XML_FILES/i")} Error in setwd("/home/anupam/Research/Anu

Re: [R] Panel order in lattice with xyplot

2010-01-09 Thread Dieter Menne
Carol wrote: > > I am a new user of R and I am going very slow…. > Never mind, R has s a steep (or, more accurately, shallow) learning curve. Carol wrote: > > I am using lattice and am trying to draw a multipanel figure. The problems > are that I am not able to find out how to: > 1. Set t

Re: [R] Online R documentation

2010-01-09 Thread Dieter Menne
Duncan Murdoch wrote: > > Including graphical output in the man pages is one of the eventual goals > of the new help system. I doubt it will make it into 2.11.x, but it > will probably be there in 2.12.x. > This is good news; while I did not love Hadley Wickham's decision to put documentat

Re: [R] Boxplots

2010-01-09 Thread Peter Ehlers
I'm guessing that you want side-by-side boxplots. If that's correct, then try the following. It stacks the y-values, makes an appropriate grouping factor and plots with reasonable spacing. dat <- read.table(textConnection(" tank TanksTotal cons_hat 1aa4 5.651017 5.59 2aa5

[R] R in English Version

2010-01-09 Thread pooja pandey
Dear Sir/Madam   I am living in germany but do not know German Language. so could you please help me to download R in English working Language, because automatically it gives German version of R when I download it from UK or US or Germany.   Thanking you and Best regards Pooja [[

Re: [R] Directory operations

2010-01-09 Thread Uwe Ligges
On 09.01.2010 19:04, anupam sinha wrote: Hi Jim, Thanks for your suggestion. I tried scripting but gives me an error. Can you tell me what am I doing wrong here ? *> list.files()->org_xml_dirs Please do turn that arrow around for (i in org_xml_dirs){ + setwd("/home/anup

Re: [R] R in English Version

2010-01-09 Thread Uwe Ligges
On 09.01.2010 18:45, pooja pandey wrote: Dear Sir/Madam I am living in germany but do not know German Language. So time to learn it... ;-) so could you please help me to download R in English working Language, because automatically it gives German version of R when I download it from UK

Re: [R] R in English Version

2010-01-09 Thread David Winsemius
On Jan 9, 2010, at 12:45 PM, pooja pandey wrote: Dear Sir/Madam I am living in germany but do not know German Language. so could you please help me to download R in English working Language, because automatically it gives German version of R when I download it from UK or US or Germany.

Re: [R] svm

2010-01-09 Thread Steve Lianoglou
Hi, On Fri, Jan 8, 2010 at 11:57 AM, Amy Hessen wrote: > Hi Steve, > > Thank you very much for your reply. Your code is more readable and obvious > than mine… No Problem. > Could you please help me in these questions?: > > 1) “Formula” is an alternative to “y” parameter in SVM. is it correct?

Re: [R] Calling FING.EXE under RGui.EXE for windows.

2010-01-09 Thread Duncan Murdoch
On 07/01/2010 1:25 PM, Uwe Ligges wrote: Argh. I see it as well. Will dig a lit tomorrow. I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing

[R] Linear regression - R^2

2010-01-09 Thread Csanád Bertók
Hello, I was doing a linear regression with the following formula: *lm(y~x+0)*, so it passes through the origin. But when I called the summary of the regression i saw that R squared is abnormally high (it's a lot lower in other programs such as SigmaPlot and MS Excel).The manual explained the caus

[R] R^2 in linear regression

2010-01-09 Thread Terias
Hello, I was doing a linear regression with the following formula: lm(y~x+0), so it passes through the origin. But when I called the summary of the regression i saw that R squared is abnormally high (it's a lot lower in other programs such as SigmaPlot and MS Excel).The manual explained the cause

Re: [R] R^2 in linear regression

2010-01-09 Thread Peter Dalgaard
Terias wrote: Hello, I was doing a linear regression with the following formula: lm(y~x+0), so it passes through the origin. But when I called the summary of the regression i saw that R squared is abnormally high (it's a lot lower in other programs such as SigmaPlot and MS Excel).The manual expl

Re: [R] R^2 in linear regression

2010-01-09 Thread Terias
Thank you, it worked :) Csanad Bertok Biology BSc University of Debrecen Debrecen, Hungary -- View this message in context: http://n4.nabble.com/Re-R-2-in-linear-regression-tp1010477p1010484.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Calling FING.EXE under RGui.EXE for windows.

2010-01-09 Thread Gabor Grothendieck
That doesn't explain why this returns character(o) even though we have launched a console for it: system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE) On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch wrote: > On 07/01/2010 1:25 PM, Uwe Ligges wrote: >> >> Argh. I see it as well. Will dig

[R] string functions

2010-01-09 Thread Laetitia Schmid
Hi! Does anybody know a string function that would calculate how many characters two strings share? I.e. ("Hello World","Hello Peter") would be 7. Thanks. Laetitia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

[R] commandArgs return value

2010-01-09 Thread Ben Tupper
Hello, I plan to use a script with R CMD BATCH on different platforms Linux, Windows and Mac OSX. I use the commandArgs(trailing = FALSE) function to retrieve the name of the script and the arguments (example below with output.) The online docs for "Introduction to R" (sections B.1 Invo

Re: [R] string functions

2010-01-09 Thread Liviu Andronic
On 1/9/10, Laetitia Schmid wrote: > Does anybody know a string function that would calculate how many characters > two strings share? I.e. ("Hello World","Hello Peter") would be 7. > Perhaps package ‘stringr’ has something related? Liviu __ R-help@r-p

Re: [R] Calling FING.EXE under RGui.EXE for windows.

2010-01-09 Thread Duncan Murdoch
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote: That doesn't explain why this returns character(o) even though we have launched a console for it: system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE) I don't see any console launched. R redirects stdin and stdout (and stderr, I thin

Re: [R] string functions

2010-01-09 Thread Greg Hirson
Laetitia, One approach: lettermatch <- function(stringA, stringB) { sum(unique(unlist(strsplit(stringA, ""))) %in% unique(unlist(strsplit(stringB, "" } lettermatch("Hello World","Hello Peter") yields 6, as the l is only singly counted. This treats uppercase and lowercase as different

Re: [R] Linear regression - R^2

2010-01-09 Thread milton ruser
Dear Csanad, PLEASE do read the posting guide http://www.R-project.org/posting-guide.html Reproducible code/problem are welcome. By the way, who you believe is right? bests milton On Sat, Jan 9, 2010 at 5:40 PM, Csanád Bertók wrote: > Hello, > > I wa

Re: [R] string functions

2010-01-09 Thread Ista Zahn
Maybe I don't understand the question. I can think of four ways to count, none of which give me 7: a <- "Hello World" b <- "Hello Peter" #counting duplicates and the space: sa <- strsplit(a, split="")[[1]] sb <- strsplit(b, split="")[[1]] length(which(sb %in% sa == TRUE)) #counting the space but

[R] scatterplot matrix with ggplot2

2010-01-09 Thread stephen sefick
#I would like to use the below data to make a scatter plot matrix with #code similar to that below the data #conceptually this is the right approach I think #thanks in advance melt.gg <- structure(list(stream = c("Bonham Lower", "Bonham Lower", "Bonham Lower", "Bonham Lower", "Bonham Lower", "Bonh

Re: [R] how to organize a lot of R source files

2010-01-09 Thread Hao Cen
Hi Henrik, Thanks for your suggestion. I created a directory with 10 R files and tried the following and measured its time system.time(sourceDirectory("~/fun", modifiedOnly = F)) system.time(sourceDirectory("~/fun", modifiedOnly = T)) But the second line seems to spend as much time as the first

Re: [R] scatterplot matrix with ggplot2

2010-01-09 Thread Ista Zahn
I don't think this approach will work. In your call to facet_grid you call variable twice. Another way to do this is create another variable, call it "variable2" and set it equal to variable. Now look at the dataframe. You have values for variable = x1, variable2 = x1, but no values for variable =

Re: [R] how to organize a lot of R source files

2010-01-09 Thread Henrik Bengtsson
Hi. On Sat, Jan 9, 2010 at 6:16 PM, Hao Cen wrote: > Hi Henrik, > > Thanks for your suggestion. I created a directory with 10 R files and > tried the following and measured its time > > system.time(sourceDirectory("~/fun", modifiedOnly = F)) > system.time(sourceDirectory("~/fun", modifiedOnly = T

Re: [R] Mixtures of Discrete Uniforms

2010-01-09 Thread Jim Silverton
I want to create the mixture formulation of a discrete uniform ie, say f(x) = 1/10, for i = 1,2,3,4,5,6,7,8,9 and 10 and another discrete distribution which has the same values of x, but he probabilities can vary. Can this be done on any package in R? an if so, can the package estimate the 'probab

Re: [R] data frame names in sequence. please help!!!

2010-01-09 Thread Berend Hasselman
Zoho wrote: > > I've been stuck with this problem for a whole afternoon. It's silly but > totally pissed me off. I have a set of data frames with names in a > sequence: df_1, df_2, df_3, ..., df_20. Now I want to access each data > frame (read or write) in a for loop, in a way something like th