Re: [R] recommendations on use of - operator

2010-03-18 Thread Emmanuel Charpentier
An old (Lisp ? C ?) quote, whose author escapes me now, was : syntactic sugar causes cancer of the semicolon .. but nowadays semicolons are rarely used in real-life R. Emmanuel Charpentier PS and, BTW, neither C nor Lisp have much use for semicolons...

[R] can I rotate a matrix

2010-03-18 Thread dc896148
useR's, I want to be able to rotate a matrix 90 degrees, clockwise. For example, mat [,1] [,2] [,3] [,1] 12 1 [,2] 32 6 [,3] 45 3 I want to rotate it, so that it looks like this... [,1] [,2] [,3] [,1] 43 1 [,2] 52 2 [,3] 36

Re: [R] can I rotate a matrix

2010-03-18 Thread Henrique Dallazuanna
Try this: t(mat[3:1,]) On Thu, Mar 18, 2010 at 4:10 PM, dc896148 cyr.de...@gmail.com wrote: useR's, I want to be able to rotate a matrix 90 degrees, clockwise.  For example, mat     [,1] [,2] [,3] [,1]   1    2     1 [,2]   3    2     6 [,3]   4    5     3 I want to rotate it, so that

Re: [R] recommendations on use of - operator

2010-03-18 Thread Duncan Murdoch
On 18/03/2010 3:10 PM, Emmanuel Charpentier wrote: An old (Lisp ? C ?) quote, whose author escapes me now, was : syntactic sugar causes cancer of the semicolon .. but nowadays semicolons are rarely used in real-life R. Emmanuel Charpentier PS and, BTW,

Re: [R] can I rotate a matrix

2010-03-18 Thread Greg Hirson
Not sure why you are doing it, but you can do it like this: m = matrix(c(1,3,4,2,2,5,1,6,3), nrow =3) [,1] [,2] [,3] [1,]121 [2,]326 [3,]453 t(m)[ , ncol(m):1] [,1] [,2] [,3] [1,]431 [2,]522 [3,]361 I hope

Re: [R] can I rotate a matrix

2010-03-18 Thread Phil Spector
I belive that apply(t(mat),2,rev) [,1] [,2] [,3] [1,]163 [2,]225 [3,]134 will do what you want. I'll leave it up to you to decide whether it's straightforward. - Phil Spector

Re: [R] can I rotate a matrix

2010-03-18 Thread Rolf Turner
On 19/03/2010, at 8:10 AM, dc896148 wrote: useR's, I want to be able to rotate a matrix 90 degrees, clockwise. For example, mat [,1] [,2] [,3] [,1] 12 1 [,2] 32 6 [,3] 45 3 I want to rotate it, so that it looks like this... [,1] [,2] [,3]

Re: [R] Plotting symbols over a screenshot

2010-03-18 Thread Greg Snow
One approach: Read in and plot background image (possibly using EBImage package or other). Use the updateusr function from the TeachingDemos package to set the user coordinates to match your image. Add points using points or symbols function. Hope this helps, -- Gregory (Greg) L. Snow Ph.D.

Re: [R] can I rotate a matrix

2010-03-18 Thread Ted Harding
On 18-Mar-10 19:10:46, dc896148 wrote: useR's, I want to be able to rotate a matrix 90 degrees, clockwise. For example, mat [,1] [,2] [,3] [,1] 12 1 [,2] 32 6 [,3] 45 3 I want to rotate it, so that it looks like this... [,1] [,2] [,3] [,1] 4

Re: [R] Please help with loop, thanks

2010-03-18 Thread Marc Schwartz
Mark, Sorry to come to the party late, but if the result vectors are going to be the same length: mat - matrix(rnorm(40), 10, 4) colnames(mat) - c(A,B,C,D) mat AB C D [1,] -0.6489907 -1.000256771 0.69287228 0.81174708 [2,] 0.182

[R] r-help

2010-03-18 Thread rr
hi I am doing a project in R language.I need help with creating a front end in R language. i created a dialog box with file menu n file consists of load ,save and quit options. But these options are not working.I try to load my data into r using these options but its not working.pls help.

[R] R front end help

2010-03-18 Thread rr
hi I am doing a project in R language.I need help with creating a front end in R language. i created a dialog box with file menu n file consists of load ,save and quit options. But these options are not working.I try to load my data into r using these options but its not working. pls help. thanks

Re: [R] R front end help

2010-03-18 Thread David Winsemius
Look at how John Fox built Rcmdr. http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/ Others are out there as well. And there is a GUI SIG http://www.sciviews.org/_rgui/ ... and maybe a Task View or maybe that page with 15 GUI's down the side was what I was remembering? Seems like there might be

Re: [R] R front end help

2010-03-18 Thread Sharpie
rrp wrote: hi I am doing a project in R language.I need help with creating a front end in R language. i created a dialog box with file menu n file consists of load ,save and quit options. But these options are not working.I try to load my data into r using these options but its not

Re: [R] can I rotate a matrix

2010-03-18 Thread Seeliger . Curt
I want to be able to rotate a matrix 90 degrees, clockwise. For example, mat [,1] [,2] [,3] [,1] 12 1 [,2] 32 6 [,3] 45 3 I want to rotate it, so that it looks like this... [,1] [,2] [,3] [,1] 43 1 [,2] 52 2

Re: [R] R front end help

2010-03-18 Thread Tal Galili
Also have a look at deducer: http://www.deducer.org/manual.html Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com

Re: [R] can I rotate a matrix

2010-03-18 Thread Ted Harding
On 18-Mar-10 20:25:22, seeliger.c...@epamail.epa.gov wrote: I want to be able to rotate a matrix 90 degrees, clockwise. For example, mat [,1] [,2] [,3] [,1] 12 1 [,2] 32 6 [,3] 45 3 I want to rotate it, so that it looks like this...

[R] Substitute NAs in a data frame

2010-03-18 Thread Marshall Feldman
Excuse me for what I'm sure is a stupid beginner's question, but I've given up trying to find the answer to this question from the help, RSiteSearch, or any of the usual places. I have a list that looks like this: myList $first [1] -- 18 8 32 $second [1] -- -- 40 54 I want a straightforward

Re: [R] can I rotate a matrix

2010-03-18 Thread Seeliger . Curt
mat # [,1] [,2] [,3] # [1,]121 # [2,]326 # [3,]453 matrix(rev(mat),nrow=3,byrow=TRUE)[(3:1),] # [,1] [,2] [,3] # [1,]431 # [2,]522 # [3,]361 How's that? (But

Re: [R] Substitute NAs in a data frame

2010-03-18 Thread Sharpie
Marsh wrote: Excuse me for what I'm sure is a stupid beginner's question, but I've given up trying to find the answer to this question from the help, RSiteSearch, or any of the usual places. I have a list that looks like this: myList $first [1] -- 18 8 32 $second [1] -- -- 40

[R] Rcmdr plugins produce error

2010-03-18 Thread Robert Baer
I recently updated all my plugins, and for the fun of it, I added ALL the Rcmdr Plugins to my collection to see what functionality might exist. I started Rcmdr and loaded ALL the available Plugins from to the Rcdmdr Tools menu. To my suprise Rcmdr produced a number of warnings and finally an

[R] Imported tables from Access 2007

2010-03-18 Thread Ryan Utz
Hi all, I am very new to R and I'm trying to import data from Microsoft Access. So far, I've managed to do so successfully using the following code: testdb - file.path(c:\Databse.accdb) channel2 - odbcConnectAccess2007(testdb) data.table - sqlFetch(channel2,data) This successfully imports a

Re: [R] Locating an error

2010-03-18 Thread Worik R
Thank you everybody for your help. I am sure using the information you provided I'll be able to do better than my current approach of using cat to trace my programmes! cheers Worik [[alternative HTML version deleted]] __ R-help@r-project.org

[R] How to read.table with “Hebrew” column names (in R)?

2010-03-18 Thread Tal Galili
(I am reposting this question after a few months without a solution...) Hi all, I am trying to read a .txt file, with Hebrew column names, but without success. I uploaded an example file to: http://www.talgalili.com/files/aa.txt And tried the command:

Re: [R] Imported tables from Access 2007

2010-03-18 Thread David Winsemius
On Mar 18, 2010, at 4:46 PM, Ryan Utz wrote: Hi all, I am very new to R and I'm trying to import data from Microsoft Access. So far, I've managed to do so successfully using the following code: testdb - file.path(c:\Databse.accdb) I am surprised that worked. I was under the impression

Re: [R] Imported tables from Access 2007

2010-03-18 Thread David Winsemius
On Mar 18, 2010, at 5:43 PM, David Winsemius wrote: On Mar 18, 2010, at 4:46 PM, Ryan Utz wrote: Hi all, I am very new to R and I'm trying to import data from Microsoft Access. So far, I've managed to do so successfully using the following code: testdb - file.path(c:\Databse.accdb) I

Re: [R] Rcmdr plugins produce error

2010-03-18 Thread John Fox
Dear Robert, I don't know what specifically produced the problems that you encountered, but it's perfectly possible for Rcmdr plug-ins to be incompatible with each other: For example, one plug-in could remove a menu to which another tries to add an item. As to the Rcmdr detecting the errors or

[R] Please Post Planned Contrasts Example in lme {nlme}

2010-03-18 Thread Martin Turcotte
Hi I am running some linear and non-linear mixed effect models and would like to do some planned contrasts (a priori contrasts) I have looked in the help and in many forums and it seems possible to do so but don't understand how to write the function and I couldn't find an example in Pinheiro

Re: [R] recommendations on use of - operator

2010-03-18 Thread RICHARD M. HEIBERGER
PL1 used semi-colons, therefore so does SAS (Yes, SAS was originally written in PL1). [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] merge.zoo produces non unique chron time series

2010-03-18 Thread Gabor Grothendieck
Here is a shorter and improved version: # 2 Rnd - function(x) { time(x) - trunc(time(x), sec) x } zoo.ts.cor.2 - merge.zoo(Rnd(zoo.ts.pot), Rnd(zoo.ts)) # 3 MATCH.times - function(x, table, nomatch = NA, ...) match(trunc(x, sec), trunc(table, sec), nomatch = nomatch, ...)

Re: [R] How to read.table with “Hebrew” c olumn names (in R)?

2010-03-18 Thread William Dunlap
I tried this on R 2.11.0 unstable (2010-03-07 r51225) using encoding=UTF-8 and check.names=FALSE in read.table(). It seemed to basically work, except that the data.frame/matrix printing routine wants to print the Unicode codes for the characters in the names: data1 -

Re: [R] How to read.table with “Hebrew” column names (in R)?

2010-03-18 Thread Ista Zahn
Seems to work fine on my machine: data1 - read.table(http://www.talgalili.com/files/aa.txt;, + header = TRUE, sep = \t, encoding=UTF-8, check.names=FALSE) data1 אחת שתיים שלוש 1 12976 2 123 354 44 3 6 13 colnames(data1) [1] אחת שתיים שלוש colnames(data1)[1]

Re: [R] Imported tables from Access 2007

2010-03-18 Thread David Winsemius
(I am attaching your original question so it will be easier for me and those who choose to comment further,) Hi all, I am very new to R and I'm trying to import data from Microsoft Access. So far, I've managed to do so successfully using the following code: testdb -

Re: [R] probable timezone confusion with as.yearmon

2010-03-18 Thread Gabor Grothendieck
as.yearmon converts relative to GMT. If you want something else convert it to character first: as.yearmon(format(...)) On Thu, Mar 18, 2010 at 2:20 PM, Peter Keller keller...@gmail.com wrote: It looks like a timezone issue, and it's causing confusion to me at least. My original data: gmt -

Re: [R] Imported tables from Access 2007

2010-03-18 Thread David Winsemius
On Mar 18, 2010, at 7:04 PM, David Winsemius wrote: (I am attaching your original question so it will be easier for me and those who choose to comment further,) Hi all, I am very new to R and I'm trying to import data from Microsoft Access. So far, I've managed to do so successfully

Re: [R] Imported tables from Access 2007

2010-03-18 Thread Ryan Utz
David, Thanks for responding. You were right; I misplaced a backspace (\) with a forward space (/) in my posting. The c:\ doesn't actually work; in my true code there is a forward space. Anyway, the results of str(data) appears as follows: 'data.frame': 90 obs. of 9 variables: $ Fish

[R] Count of entries in a row of a data frame

2010-03-18 Thread Thomas Jensen
Dear R-list, I have data in the following format: Country 1 Country 2Country 3 ... 1 0 10 2 1 02 3 0 10 Now I would like to create a variable that counts

Re: [R] How to read.table with “Hebrew” c olumn names (in R)?

2010-03-18 Thread William Dunlap
My test was on Windows XP. On an old Linux distro I have access to (Ubuntu 8.04.3 hardy) it does work better, although the putty terminal emulator (on the Windows side) reverses all the lines containing any Hebrew text (pushing them against the right edge of the terminal window). When I look at

Re: [R] Count of entries in a row of a data frame

2010-03-18 Thread Phil Spector
Thomas - Two ways that come to mind are apply(dat,1,function(x)sum(x != 0)) and rowSums(dat!=0) (assuming your data frame is named dat). - Phil Spector Statistical Computing Facility

[R] Creating Rcpp RcppDatetime from string with millisecond

2010-03-18 Thread R_help Help
Hi, I was trying to generate RcppDatetime from a string. The main problem for me is that my string contains millisecond. I saw that RcppDatetime takes in double of seconds since epoch. I try to generate a double using boost but has no success. I'm wondering if you have any sample snippet? The

Re: [R] probable timezone confusion with as.yearmon

2010-03-18 Thread Peter Keller
Thanks, that clears that up. Is this behavior documented in the help? I've looked, but didn't see anything which noted a conversion to GMT. Perhaps I just don't understand the different time methods, which is entirely possible since I'm a relative beginner. Peter -- View this message in

Re: [R] probable timezone confusion with as.yearmon

2010-03-18 Thread Gabor Grothendieck
No, its not documented in the released version of zoo but it is in the development version of zoo. There is more on time date classes in R News 4/1. On Thu, Mar 18, 2010 at 7:47 PM, Peter Keller keller...@gmail.com wrote: Thanks, that clears that up. Is this behavior documented in the help?  

Re: [R] recommendations on use of - operator

2010-03-18 Thread Emmanuel Charpentier
Le jeudi 18 mars 2010 à 15:49 -0400, Duncan Murdoch a écrit : On 18/03/2010 3:10 PM, Emmanuel Charpentier wrote: An old (Lisp ? C ?) quote, whose author escapes me now, was : syntactic sugar causes cancer of the semicolon .. but nowadays semicolons are rarely used in real-life R.

Re: [R] can I rotate a matrix

2010-03-18 Thread Steve Taylor
How about this for a more generalised matrix rotation function (works with 1-column and 1-row matrices too) ... rotate = function(mat) t(mat[nrow(mat):1,,drop=FALSE]) From: seeliger.c...@epamail.epa.gov To:r-help@r-project.org Date: 19/Mar/2010 10:15a Subject: Re: [R] can I rotate a matrix

[R] error in map library

2010-03-18 Thread Nilza BARROS
Dear Ruser, I am trying to use the map library. But unfortunately I am facing the warning message above: Warning message: *In readGDAL(destfile, silent = TRUE) : GeoTransform values not available * I want to use that library because I intend to plot some station in a Brazilian map. I

[R] outputing text colors

2010-03-18 Thread rtist
Hi all, I was wondering if there is a way to output text tables with the color of the text corresponding to a condition. More specifically, Im outputting an time series table and want the console colors to be green0 and red0. This is very easy to do in excel using conditional formatting. Any

Re: [R] Please Post Planned Contrasts Example in lme {nlme}

2010-03-18 Thread Tobias Verbeke
Hi Martin, Martin Turcotte wrote: Hi I am running some linear and non-linear mixed effect models and would like to do some planned contrasts (a priori contrasts) I have looked in the help and in many forums and it seems possible to do so but don't understand how to write the function and I

Re: [R] multiple print commands in win.metafile()

2010-03-18 Thread Kim Jung Hwa
Nothing wrong with that, its working fine... thanks a lot! Kim On Thu, Mar 18, 2010 at 2:16 PM, jim holtman jholt...@gmail.com wrote: It depends on what you want them for. With win.metafile, what is the problem with multiple files? You can still include them in powerpoint/word. If you

[R] One main title and One legend for multiple lattice plots

2010-03-18 Thread Kim Jung Hwa
Hi All, Can anyone please help me with getting a single title and legend for both the plots in the following R code. I'll eventually be using .wmf file. # R code: library(lattice) p1 - xyplot(decrease ~ treatment, OrchardSprays, groups = rowpos, type = a, main=Same title / legend,

[R] lmer: mixed effects models: predictors as random slopes but not found in the fixed effects?

2010-03-18 Thread Hamish and Joy Wilman
Hello all, I using lmer to develop a mixed effects model. I start with an overly parameterized model (as suggested in Zuur et al. Mixed Effects Models and Extension in Ecology with R) that looks something like this: m1 - lmer( Y ~ aS + bS + c + d + e + (c|SpeciesId) + (d|SpeciesId) +

Re: [R] One main title and One legend for multiple lattice plots

2010-03-18 Thread David Winsemius
On Mar 18, 2010, at 10:10 PM, Kim Jung Hwa wrote: Hi All, Can anyone please help me with getting a single title and legend for both the plots in the following R code. I'll eventually be using .wmf file. This is either incredibly simple or you have not explained what you reall want.

[R] Maximum Data Size that works in RPART Routine

2010-03-18 Thread Ying Huang
Hi there, Can some R guru advise the maximum data size ( e.g. 100MB but 500 MB) that can be handled in RPART routine? I am running 32-bit R on 64 bit version of Windows. Thank you very much for your help! Ying [[alternative HTML version deleted]]

[R] How to plot two cumulative frequency graph together

2010-03-18 Thread Gundala Viswanath
Dear masters, I have data that looks like this: #val Freq1 Freq2 0.000 178 202 0.001 4611 5300 0.002 99 112 0.003 26 30 0.004 17 20 0.005 15 20 0.006 11 14 0.007 11 13 0.008 13 13 ...many more lines.. Full data can be found here: http://dpaste.com/173536/plain/ What I intend to do is to have

Re: [R] One main title and One legend for multiple lattice plots

2010-03-18 Thread Kim Jung Hwa
Hi David, Thank you for your reply. I'm sorry if I've misconveyed my question: here it goes again: *** I want a common main title and a common legend after I output/print four different lattice plots on a single .wmf or .pdf file*** Somewhat as in this image:

[R] chron package install fail in intel I7 - fedora 12

2010-03-18 Thread Juan Santiago Ramseyer
install packages chron fail in Fedora 12, cpu I7/860 See down. Regard, Juan S. Ramseyer. install.packages() Loading Tcl/Tk interface ... done --- Please select a CRAN mirror for use in this session --- Warning in install.packages() : argument 'lib' is missing: using '/usr/lib64/R/library'

Re: [R] outputing text colors

2010-03-18 Thread Peter Alspach
Tena koe Perhaps the thread started earlier this week ([R] How good is R at making publication quality tables?) would help you. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of rtist Sent: Friday, 19

[R] OT: Import HTML, was Re: How good is R at making publication quality tables?

2010-03-18 Thread Johannes Huesing
Jim Lemon j...@bitwrit.com.au [Wed, Mar 17, 2010 at 11:43:21PM CET]: [...] All of the word processing packages that I use can directly import HTML documents, and the result has been good enough for any application so far. I have only MS Word as work and failed to import HTML so far

<    1   2