[R] pass nrow(x) to dots in function(x){plot(x,...)}

2011-02-02 Thread Marianne Promberger
, how do I assign an object inside a function that I can then access in the dots when executing the function? Many thanks Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.12.0 (2010-10-15) Ubuntu 9.04 __ R

[R] cross tabulate variables by subject id

2010-11-29 Thread Marianne Promberger
to fill in the cells of the table. Thanks, Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.12.0 (2010-10-15) Ubuntu 9.04 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Number above the bar?

2010-11-11 Thread Marianne Promberger
Hi Joel, I got an barplot, and I would like to have the exact number of the bars just above the bars anyone know how to do this? Google r number above bars barplot for threads on this list how to do it and why you might not want to. ?text Marianne -- Marianne Promberger PhD, King's College

Re: [R] new column from column in another df

2010-11-09 Thread Marianne Promberger
-- Marianne Promberger PhD, King's College London http://promberger.info R version 2.12.0 (2010-10-15) Ubuntu 9.04 __ 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

Re: [R] How to extract Friday data from daily data.

2010-11-09 Thread Marianne Promberger
), then pick the first (or last) entry that exists for that week. Of course, since your choice order is not chronologlical you probably can't use fromLast. Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.12.0 (2010-10-15) Ubuntu 9.04

Re: [R] help to merge two data frame if name matches

2010-11-09 Thread Marianne Promberger
1 100.040.0 1 0 1.11 Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.12.0 (2010-10-15) Ubuntu 9.04 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] help to add a new column filled with value 1

2010-11-09 Thread Marianne Promberger
storage newcol 1 mohan 1 100.2 1.1 1 2 ram 1 200.0 100.0 1 3 kumar 1 400.050.0 1 4 xxx 1 100.040.0 1 5 aaa 1 800.045.0 1 6 mount 1 200.080.0 1 main[,c(1,5,2,3,4)] # order columns by indexing -- Marianne Promberger PhD, King's

Re: [R] R Founding

2010-09-17 Thread Marianne Promberger
perspective this means even this cumbersome possibility is not salient enough at the moment. -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.11.1 (2010-05-31) Ubuntu 9.04 __ R-help@r-project.org mailing list https

[R] Index list by other list (w/ logical elements)?

2010-08-24 Thread Marianne Promberger
was hoping sapply(x,[,y) would work, but it doesn't. I guess I need to sapply twice, like sapply(x, function() { sapply(y ... but I can't figure it out. Many thanks for any pointers Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.11.1 (2010-05-31

[R] gsub patterns from vector elements w/out loop?

2010-02-22 Thread Marianne Promberger
that to x ... erm. :/ Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.10.1 (2009-12-14) Ubuntu 9.10 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] gsub patterns from vector elements w/out loop?

2010-02-22 Thread Marianne Promberger
gsub(paste(x, collapse = |), something else, y) [1] something else blah something else blah something else blah [4] something else blah Many thanks! I didn't know about collapse. Should have thought about reading up in ?paste ... Thanks Marianne -- Marianne Promberger PhD, King's

Re: [R] env() for lme4

2010-02-22 Thread Marianne Promberger
-project.org;) (But then something didn't work with profile() on my particular model but I forgot what it was -- haven't had time to pursue this yet) -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.10.1 (2009-12-14) Ubuntu 9.04

Re: [R] Help with R in ubuntu

2010-02-01 Thread Marianne Promberger
/linux/ubuntu/ Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.10.1 (2009-12-14) Ubuntu 9.04 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] read.csv to read output of system()?

2009-12-12 Thread Marianne Promberger
the answer must be in ?connections, maybe pipe() but I have fiddled with these and cannot figure it out. Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.10.0 (2009-10-26) Ubuntu 9.04 __ R-help@r-project.org

Re: [R] read.csv to read output of system()?

2009-12-12 Thread Marianne Promberger
gsub would be even neater, as it would really be self-contained in R. gsub(( [A-Za-z]+),,\\1;,readLines(file.csv)) seems to work fine, but how to get this into a data frame? Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.10.0 (2009-10-26) Ubuntu

Re: [R] read.csv to read output of system()?

2009-12-12 Thread Marianne Promberger
Wonderful, thanks a lot! Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.10.0 (2009-10-26) Ubuntu 9.04 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] R script From PHP

2009-12-01 Thread Marianne Promberger
://dirk.eddelbuettel.com/code/littler.html might come in handy as well. -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.10.0 (2009-10-26) Ubuntu 9.04 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Use R -- term and logo copyright?

2009-10-09 Thread Marianne Promberger
somewhere. Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.9.2 (2009-08-24) Ubuntu 9.04 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread Marianne Promberger
the margins of the histogram plots, then they get plotted to the region with the next number given in the layout() matrix. Maybe I'm missing something. Thanks, Marianne -- David On Oct 3, 2009, at 3:15 PM, Marianne Promberger wrote: Dear R users, I create a graphic with two plots side

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread Marianne Promberger
is said incompatible with par(mfrow)). Indeed. I did look around ?par, but due to this warning thought anything relating to mfrow() and mfcol() would not work anyway. Thanks again, Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.9.2 (2009-08-24) Ubuntu

[R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-03 Thread Marianne Promberger
,main=left plot) plot(10:1,main=right plot) lines(c(3:7,7:3),col=red) but of course now lines() gets added to the right plot. I Is there any way to make the lines() go to the fist plot (left plot)? Marianne -- Marianne Promberger PhD, King's College London http://promberger.info R version 2.9.2

Re: [R] if else statement error

2009-10-03 Thread Marianne Promberger
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. -- Marianne

Re: [R] .Rprofile file

2009-10-02 Thread Marianne Promberger
.html Marianne -- Marianne Promberger PhD King's College London London SE1 9RT Phone: 020 7188 2590 GnuPG/PGP public key ID 80AD9916 .tex .bib .R .Rnw files welcome __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] get function to return object name?

2009-09-02 Thread Marianne Promberger
called myplot(s1), s2 if myplot(s2), etc. I'm sure I'll be really embarrassed that this is so trivial but I cannot figure it out. Marianne -- Marianne Promberger PhD King's College London __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] ggplot, qplot: alpha channel for colors corresponding to factor

2009-06-10 Thread Marianne Promberger
),colour=I(alpha(Second.adapt,1/5)),data=d1) Thanks for any pointers, Marianne -- Marianne Promberger PhD http://www.psych.upenn.edu/~mpromber PGP/GnuPG public key ID 80AD9916 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] ggplot, qplot: alpha channel for colors corresponding to factor

2009-06-10 Thread Marianne Promberger
for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Marianne Promberger Verzonden: woensdag 10 juni 2009 13:37 Aan

[R] ggplot: order of numeric factor levels?

2009-03-31 Thread Marianne Promberger
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 -

Re: [R] Digest setting won't take

2008-10-31 Thread Marianne Promberger
. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ 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

[R] barchart for aggregated (sum) data in lattice?

2008-10-05 Thread Marianne Promberger
=t1),beside=T) But I'd like to be able to do this in lattice. I tried: barchart(amount~what|month,t1) But that doesn't sum the data for t1$amount for each month first. How could I do that? Thanks, Marianne -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu

Re: [R] [SOLVED] barchart for aggregated (sum) data in lattice?

2008-10-05 Thread Marianne Promberger
notation in lattice, like barchart(xtabs(amount~what)|month or so. Sorry for the clutter. m. On Sunday, 05 October 2008, 18:12 (UTC+0100), Marianne Promberger wrote: Hi list, I have data in a dataframe t1, with a column for different amounts spent, a column what it was spent

Re: [R] remove multiple elements from vector

2008-09-28 Thread Marianne Promberger
On Saturday, 27 September 2008, 15:30 (UTC+0200), Bastian Offermann wrote: Hello all, one brief question I would like to remove double/triple elements from a vector, e.g. 0 1 1 1 1 2 2 2 4 5 6 6 but keep one of these multiple ones. Should look like this finally: 0 1 2 4 5 6 ?unique

Re: [R] axis in a normal plot

2008-09-26 Thread Marianne Promberger
://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ R-help@r-project.org mailing list https

Re: [R] include scripts into main file (the LaTeX way)

2008-09-26 Thread Marianne Promberger
. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ 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

Re: [R] Saving functions

2008-09-08 Thread Marianne Promberger
. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ 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

Re: [R] Beginner graphics device questions.

2008-09-08 Thread Marianne Promberger
?dev.off HTH m. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ 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

Re: [R] Pie chart and labels

2008-09-08 Thread Marianne Promberger
have told you this, too. m. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] I don't know how to run a r-code written in emacs

2008-09-06 Thread Marianne Promberger
is much more convenient than running from the console. m. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] another histogram question

2008-09-01 Thread Marianne Promberger
) Antje __ 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. -- Marianne

Re: [R] need help for building R in Ubuntu 8.04

2008-05-25 Thread Marianne Promberger
currently using 7.10 so not 100 percent sure if this works in 8.04. m. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] dividing the data

2008-05-23 Thread Marianne Promberger
than 50 years of age. Assuming you have your data in a dataframe x with one column called age (get the data into R e.g. with read.csv) young - x[x$age 50,] write.table(young,file=young.txt) etc. m. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu

Re: [R] Rank Values in a Matrix

2008-05-21 Thread Marianne Promberger
this do what you want? x - matrix(c(3,100,0.1,3,100,2,5,0,0,50),5) y - as.data.frame(table(x)) y$Rank - rank(y$x) m. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ R-help@r-project.org mailing list https

Re: [R] Starting R from .RData in linux

2008-05-20 Thread Marianne Promberger
not work. Is there any way to set it up? Marianne Promberger Wrote: You presumably need to associate the file type .RData with starting a terminal and then executing R in that terminal. I'm using Xubuntu, so my file manager is Thunar, and if I right click on an .RData and select use other

Re: [R] Startin R from .RData in linux

2008-05-19 Thread Marianne Promberger
and may have different syntax. (gnome-terminal maybe? then man gnome-terminal in case the -e option doesn't work for you). m. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ R-help@r-project.org mailing

Re: [R] help for the first poster- a simple question

2008-03-03 Thread Marianne Promberger
On 03/03/08 12:52, Xuejun Qin wrote: Hi, there, I cannot get accurate value for calculation. for example: ld-sqrt(1*0.05*0.95*0.05*0.95) 0.05*0.95-ld=-6.938894e-18 0.05*0.95-ld==0 is False. I met this problem in my program, how can I handle it. Thanks. I think what you are