similar to: include scripts into main file (the LaTeX way)

Displaying 20 results from an estimated 20000 matches similar to: "include scripts into main file (the LaTeX way)"

2008 Oct 05
1
barchart for aggregated (sum) data in lattice?
Hi list, I have data in a dataframe t1, with a column for different amounts spent, a column what it was spent on, and a column with dates, from which I create a new column with months. Example: amount <- rep(c(10,20,30),3) what <- rep(c("food","books","cycling"),3) when <- c(rep("2008-09-05",5),rep("2008-10-07",4)) t1 <-
2009 Sep 02
1
get function to return object "name"?
Dear list, I've written a function that plots subjects. Something like: myplot <- function(subject) { plot(subject) } Subjects are vectors, e.g. ... s1 <- c(200,200,190,180) ... and plotting them works fine, e.g. ... myplot(s1) Now I want to have "s1" etc appear in the plot title, but I don't know how to refer to this generically (the object "name"? I tried
2009 Oct 03
2
add lines() to 1st plot in layout() after calling 2nd plot()?
Dear R users, I create a graphic with two plots side by side using layout(), like this: layout(matrix(c(1,2),1)) plot(1:10,main="left plot") lines(c(3:7,7:3),col="red") plot(10:1,main="right plot") The lines() obivously get added to the "left plot" plot. Now, I'm trying to write a function that builds up a plot bit by bit to then include it in a
2009 Jun 10
1
ggplot, qplot: alpha channel for colors corresponding to factor
Hi, I have a qplot like the one in the minimal example below, except I also have faceting like this: qplot(jitter(Goodall),jitter(Better.adapt),colour=Second.adapt,facets=~Pol,data=d1) and with the real data I get quite a lot of overplotting, so I would like to add an alpha channel. In addition, I would like to be able to control which colors are used for each value of Second.adapt (which
2008 May 25
3
need help for building R in Ubuntu 8.04
Hi everyone I have been trying to build R in ubuntu 8.04 from its source code but am getting the following error. configure: error: --with-x=yes (default) and X11 headers/libs are not available Please help me and consider me a newbie in linux thanks in advance [[alternative HTML version deleted]]
2008 May 25
3
need help for building R in Ubuntu 8.04
Hi everyone I have been trying to build R in ubuntu 8.04 from its source code but am getting the following error. configure: error: --with-x=yes (default) and X11 headers/libs are not available Please help me and consider me a newbie in linux thanks in advance [[alternative HTML version deleted]]
2009 Mar 31
1
ggplot: order of numeric factor levels?
Hi, I'm having problems with qplot and the order of numeric factor levels. Factors with numeric levels show up in the order in which they appear in the data, not in the order of the levels (as far as I understand factors!) Here is a minimal example: library(ggplot2) y <- c(-1,2,0,0,-2,-1) z <- factor(y,levels=c(-2,-1,0,1,2)) qplot(z) For me, the resulting plot is ordered: -1,2,0,-2
2010 Feb 22
3
gsub patterns from vector elements w/out loop?
Dear list, I have two vectors: x <- c("one","two") y <- paste(rep(x,2),"blah") I want to replace all occurrences of each element of x in y with something else, so that y looks like this: y [1] "something else blah" "something else blah" "something else blah" [4] "something else blah" I can do this using a loop: for (
2008 Sep 08
2
Pie chart and labels
With a pie chart pie(c(11, 15, 16, 29, 31)) how can I generate labels for the chart, such as orange: 11 green: 15 blue: 16 red: 29 purple: 31 rather than the default labels that are drawn automatically 1 2 3 4 5 -- Mark Polishook, D.M.A. Technology Coordinator Morehead Hall, Rm 132 Center for Academic Advising and Adult Learning Montclair State University Montclair, NJ 07043 (973)-655-7114
2008 May 19
1
Startin R from .RData in linux
Hi! Is it possible to start R by clicking the .RData file in linux as in Windows? I've tried with ubuntu hardy using the right button and selecting R, but does not work. Is there any way to set it up? (I know R can by started from the terminal, selecting the appropriate directory). Thanks Agus -- Dr. Agustin Lobo Institut de Ciencies de la Terra "Jaume Almera" (CSIC) LLuis Sole
2008 Sep 08
1
Beginner graphics device questions.
Please forgive me if this has been asked before but I could not readily find an answer. First, from the example I was able to determine that graphics device commands such as plot can be redirected using 'png' and 'bmp' type commands. I tried this and it works as I understand it. The question is how this graphics device works. If I issue another 'plot' command will it also
2008 Oct 31
1
Digest setting won't "take"
I've been trying to set my email setting to Digest Mode for a while, but it doesn't seem to "take". I log through to the "Unsubscribe or edit options" button on the Web interface to the R-help mailing list page. I scroll down to the "Set Digest Mode" box and change the radio button to "On". I click the "Submit My Changes" button
2010 Nov 29
1
cross tabulate variables by subject id
Dear list, I have data like this: dat1 <- data.frame(subject=rep(1:10,2), cond1=rep(c("A","B"),each=5), cond2=rep(c("C","D"),each=10), choice=sample(0:1,10,replace=TRUE)) I would like to compare subjects' "choice" for (cond1=="A" & cond2=="C") vs
2011 Feb 02
1
pass nrow(x) to dots in function(x){plot(x,...)}
Dear Rers, I have a function to barplot() a matrix, eg myfun <- function(x, ...) { barplot(x , ... )} (The real function is more complicated, it does things to the matrix first.) So I can do: m1 <- matrix(1:20,4) myfun(m1) myfun(m1, main="My title") I'd like to be able to add the number of rows of the matrix passed to the function to the "..." argument, eg
2009 Oct 09
3
"Use R" -- term and logo copyright?
Dear list, I would like to start some R workshops at King's College London, and to do so, I would like to use the "Use R!" logo at http://www.agrocampus-ouest.fr/math/useR-2009//useR%21%202008_fichiers/useR-middle.png Since it seems to be difficult to get a shell account at KCL, I also went ahead and registered use-r.org.uk and am starting to put together a website at
2010 Aug 24
1
Index list by other list (w/ logical elements)?
I have two lists of the same shape, like this: x <- list() x[[1]] <- c("one","two") x[[2]] <- c("three","four","five") y <- list() y[[1]] <- c(TRUE,FALSE) y[[2]] <- c(FALSE,TRUE,TRUE) I would like to index x "by" y, that is, the result in this case should be: z [[1]] [1] "one" [[2]] [1] "four"
2009 Dec 12
1
read.csv to read output of system()?
Dear list, I have a file that is comma delimited but contains some erroneous non-delimiter commas. I would like to replace these commas with semicolons and then read the correct file into R as a data frame. I want to do this from within R, without changing the original data file. My current idea of how to do this would be to use system("sed ...") and feed the result to read.csv(), but
2008 May 19
3
Rank Values in a Matrix
Dear All, a short and maybe simple question: I have to rank all values in a matrix from 0 to X, [1] [2] [3] [4] [1] 0.1 2 0 3 [2] 50 3 3 1 [3] 100 1 1 0 [4] 100 2 2 0 0->0 0.1->1 2->2 3->3 50->4 100->5 (X=5) is there any function for this? i have looked in several packages (vegan, labdsv etc.) because I am working with species by site tables,
2008 Sep 06
3
I don't know how to run a r-code written in emacs
Hi, I just installed R, I'm work in UBUNTU and I don't have idea about how to run a r-code written in emacs into the shell. Well I am in a shell, and obviously I can run simple commands over there, Must I compile the program? if yes, How must I do that? what is the extension? I really appreciate your help -- View this message in context:
2008 Sep 08
3
Saving functions
Hi, Appologies for the simple nature of this question, I am unable to find the answer in manuals (EG and introduciton to R). I have written a function in a text editor and saved it with an .R extension. It is saved in my working directory. How can I run it, do I need to use source? If so, how do I supply the arguments to the function? Or does it need to be saved in a particular directory?