Re: [R] problem for installing rgdal

2012-07-10 Thread Prof Brian Ripley
On 10/07/2012 17:35, stanislas rebaudet wrote: Hello, I run [R] 2.14 on Mac OS 10.6 and I've been desperately trying to install rpy2 in order to compute spatial statistics on QGIS 1.7.3. rpy2 is dependent upon the rgdal [R]package that I've been unable to install in spite of up to date version

Re: [R] How to connect .mdb file

2012-07-10 Thread Mikhail Titov
imnew writes: > Hi, I'm currently having some problem connect .mdb file into R. > I've installed the RODBC packages and I do the code this way: > > channel <- odbcConnectAccess("C:/Users/Documents/XYZ") > > I have a total of 5 tables in the .mdb database. any one can help me with > how to get t

Re: [R] Extracting arithmetic mean for specific values from multiple .txt-files

2012-07-10 Thread vimmster
Dear Rui, 1) With test subject I mean each file (I have posted three similar files above (2, 50 and 1112), but each test subject has one exact file (which differs of course! --> 2, 50 an 1112 are the same file but I renamed it for the problem described ans solved above). In this file the vpNum is

Re: [R] combining numeric vector and column in a data frame

2012-07-10 Thread Rui Barradas
Hello, Here are two ways of doing it. df1 <- read.table(text=" fileNametype status b N alive a Tdead d N alive c T dead f Nalive e Tdead ", header=TRUE) df1 my.num

Re: [R] How to connect .mdb file

2012-07-10 Thread Jeff Newmiller
Are you sure XYZ is the name of the MDB file? Perhaps you are being fooled by the default filename display that omits the extension? --- Jeff NewmillerThe . . Go Live... DCN:B

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread R. Michael Weylandt
On Tue, Jul 10, 2012 at 4:23 PM, FJ M wrote: > 3) attach the data so that the headers become objects that contain the data > attach(v_data) This is a discouraged practice as it leads to difficult to trace errors and non-local effects. Some "big names" of the R universe suggest it [I think V of V

Re: [R] The following object(s) are masked from ‘package:stats’

2012-07-10 Thread Charlie Friedemann
David, That message is not an error. It is simply telling you that there are functions named qqnorm an qqplot in the extRemes package that are "masking" functions of the same name in the stats package. Functions in a package being loaded with the same names as functions in a package already loaded

[R] The following object(s) are masked from ‘package:stats’

2012-07-10 Thread David
My apologies in advance as this seem like an easy thing to fix. I am quite new to using R. I am doing my thesis at the moment and I am trying to use the extremes package. However, when I try to access it I get this message: The following object(s) are masked from ‘package:stats’: > library( extRe

Re: [R] How to use external image with R plot?

2012-07-10 Thread Manish Gupta
Hi, I need to position arrow according to content of data dynamically. let's say i have vector c(2,3,56,9) and i need to put arrow at 56 dynamically. How can i use above method. Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-use-external-image-with-R-plot-tp4635

Re: [R] Read vector as multi-dimensional data in R by row

2012-07-10 Thread arun
Hi HJ, No problem. By changing the order of numbers in both perm and dim, you can create different combinations A.K. - Original Message - From: "yhj...@googlemail.com" To: arun Cc: Sent: Tuesday, July 10, 2012 7:25 PM Subject: Re: [R] Read vector as multi-dimensional data in R by r

[R] How to connect .mdb file

2012-07-10 Thread imnew
Hi, I'm currently having some problem connect .mdb file into R. I've installed the RODBC packages and I do the code this way: channel <- odbcConnectAccess("C:/Users/Documents/XYZ") channel and it gave me this : RODBC Connection 3 Details: case=nochange DBQ=C:\USers\JieYi\Documents\NYP\IPP\GCR D

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-10 Thread arun
Hi, Perl: perl -e 'print -1.1-0.1+1.2. "\n";' -2.22044604925031e-16 perl -e 'print -1.2-0.2+1.4. "\n";' 0 A.K. - Original Message - From: massimodisasha To: ollestrat ; r-help@r-project.org Cc: Sent: Tuesday, July 10, 2012 6:23 PM Subject: Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

Re: [R] combining numeric vector and column in a data frame

2012-07-10 Thread arun
Hi Try this: df1<-read.table(text="  fileName    type  status  b  N  alive  a  T    dead  d  N  alive  c  T  dead  f  N    alive  e  T    dead  ",sep="",header=TRUE) mynumeric.vec<-c(a=2,b=1,c=4,d=9,e=10

Re: [R] R-help Digest, Vol 113, Issue 13

2012-07-10 Thread Terry Therneau
--- A non-text attachment was scrubbed... Name: homo_jawt_pgtwhr24.png Type: image/png Size: 9100 bytes Desc: not available URL:<https://stat.ethz.ch/pipermail/r-help/attachments/20120710/754cabcd/attachment-0001.png> -- Message: 2 Date: Tue, 10 Jul 2012 06:58:20 -04

Re: [R] RGL 3D curvilinear shapes

2012-07-10 Thread PatGauthier
Well I've figures out a painful way of doing it with triangles 3d, as suggested in another post by Duncan Murdoch. The code is disgusting, but it works. x <- c(0,0.75,75.75,150.75,225.75,300.75,375.75,450.75,525.75,600.75,675.75, 675.75,0, 0,0.5,50.5,100.5,150.5,200.5,250.5,300.5,350.5,4

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-10 Thread Erdal Karaca
german "Null" == english "zero" :-) 2012/7/10 Rolf Turner > > > In addition to taking cognisance of Richard Heiberger's reply you > should also learn to distinguish between the concept of "null" and > "zero". They are not at all the same thing. > > cheers, > > Rolf Turner > > > On 1

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread FJ M
Try putting the data into some kind of object. I'm not sure what R does with the data from read.csv. I always 1) read the data into an object 2) print the data out 3) attach the data so that the headers become objects that contain the data 4) and yes, print the data out using ls 5) check the ou

Re: [R] ifelse help

2012-07-10 Thread Jeff Newmiller
You failed to tell us any of: the actual code you used, the data you were working with, or the actual error you got. Your "pseudo-code" looks okay to me, so I suggest you read the Posting Guide and try again. (Anything other than a complete reproducible example of your problem is unlikely to eli

Re: [R] ifelse help

2012-07-10 Thread Jeff
At 07:41 PM 7/10/2012, you wrote: Seems to work for me: > x <- data.frame(old1 = sample(c(1,2,8), 10, TRUE), old2 = 1:10) > x$new <- ifelse(x$old1 == 8, 1, x$old2) > x Thanks Jim and Dan. The problem ended up with a missing values issue that threw me off. When your post confirmed that my co

Re: [R] ifelse help

2012-07-10 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Jeff > Sent: Tuesday, July 10, 2012 5:26 PM > To: r-help > Subject: [R] ifelse help > > > I'm sure this is easy, but I'm new to R and can't find any example of > the following.

Re: [R] ifelse help

2012-07-10 Thread jim holtman
Seems to work for me: > x <- data.frame(old1 = sample(c(1,2,8), 10, TRUE), old2 = 1:10) > x$new <- ifelse(x$old1 == 8, 1, x$old2) > x old1 old2 new 1 11 1 2 22 2 3 23 3 4 84 1 5 15 5 6 86 1 7 87 1 8 28 8 9 2

[R] ifelse help

2012-07-10 Thread Jeff
I'm sure this is easy, but I'm new to R and can't find any example of the following. Here's what I'm trying to do in pseudo-code. data$newvar <- ifelse(data$oldvar1 == 8, 1,data$oldvar2) In other words, if the existing variable equals 8, then the new variable should equal 1, otherwise the n

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread peter dalgaard
On Jul 11, 2012, at 01:24 , Sarah Goslee wrote: > That is silly, but I have learned something. Thanks. > (The silliest bit was when someone decided that numeric data files should use locale-dependent conventions, notably decimal separators...) > Though honestly, I've never seen the advantage o

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread Sarah Goslee
That is silly, but I have learned something. Thanks. Though honestly, I've never seen the advantage of read.csv() over the more versatile read.table(). Sarah On Tuesday, July 10, 2012, peter dalgaard wrote: > > On Jul 10, 2012, at 21:44 , Sarah Goslee wrote: > > > > But note that if sep=";" the

[R] combining numeric vector and column in a data frame

2012-07-10 Thread Simon Knapp
combined <- data.frame(mnv=my.numeric.vec[df1$fileName], type=df1$type) sorted <- combined[order(rownames(combined)),] On Wed, Jul 11, 2012 at 8:38 AM, Adrian Johnson wrote: > Hi: > I am trying to map column names of a matrix to another data frame and > get values in a different column of data

Re: [R] Extracting arithmetic mean for specific values from multiple .txt-files

2012-07-10 Thread vimmster
Dear Rui, 1) With test subject I mean each file (I have posted three similar files above (2, 50 and 1112), but each test subject has one exact file (which differs of course! --> 2, 50 an 1112 are the same file but I renamed it for the problem described ans solved above). In this file the vpNum is

[R] combining numeric vector and column in a data frame

2012-07-10 Thread Adrian Johnson
Hi: I am trying to map column names of a matrix to another data frame and get values in a different column of data frame I have a matrix m. > my.numeric vec <- m[1,] > my.numeric.vec a b cd ef 2 1 49 10 3 ## my data frame = df1 > df1 fileNametype sta

[R] FastRWeb Examples

2012-07-10 Thread Roy Mendelssohn
Hi All: I just got FastRWeb up and working, and I am hoping someone might have some example scripts that demonstrate some more complicate interactions between the URL and the service. In particular, where multiple arguments are being passed to the function and one argument might be a URL itsel

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-10 Thread massimodisasha
Il 7/10/12 4:17 PM, ollestrat ha scritto: Hello, I fear its a stupid question,..but here it is: If I do this simple calculation with the R console, I surprisingly do not get a zero. Why? -1.1-0.1+1.2 [1] -2.220446e-16 greetings, Ole -- View this message in context: http://r.789695.n4.na

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread peter dalgaard
On Jul 10, 2012, at 21:44 , Sarah Goslee wrote: > > But note that if sep=";" then you don't have a csv file and should > properly use read.table() instead. That's not actually true. In a substantial part of the world, csv files are semicolon separated. That's what read.csv2() is for. (Yes, it i

Re: [R] Mann-Whitney by group

2012-07-10 Thread R. Michael Weylandt
Untested, I think you need to lapply() over thing with some sort of extractor: lapply(thing, function(x) x[['p.value']]) Michael On Jul 10, 2012, at 3:45 PM, Oxenstierna wrote: > This works very well--thanks so much. > > By way of extension: how would one extract elements from the result obj

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-10 Thread Rolf Turner
But R-ish NULL is *NOT* equal to R-ish zero, and that's what counts here. cheers, Rolf Turner On 11/07/12 09:19, Erdal Karaca wrote: > german "Null" == english "zero" :-) > > 2012/7/10 Rolf Turner > > > > > In addition to taking cognisance of Ri

[R] Thanks! RE: boxplot with "cut"

2012-07-10 Thread Vining, Kelly
Thanks for your help, Rui! That works and will save me a lot of trouble. --Kelly -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Tuesday, July 10, 2012 2:24 AM To: Vining, Kelly Cc: r-help@r-project.org Subject: Re: [R] boxplot with "cut" Hello, Maybe this is

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-10 Thread Rolf Turner
In addition to taking cognisance of Richard Heiberger's reply you should also learn to distinguish between the concept of "null" and "zero". They are not at all the same thing. cheers, Rolf Turner On 11/07/12 08:17, ollestrat wrote: Hello, I fear its a stupid question,..but her

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-10 Thread William Dunlap
It is for the same reason that if you must work with numbers stored with 2 significant decimal digits 1-(1/3+1/3+1/3) is 0.01 (== 10 ^ -2). Double precision numbers, supported by your computer hardware and used by R, are stored using 52 significant binary digits and 2^-52 is about -2.220446e-16.

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-10 Thread Richard M. Heiberger
This is the behavior of the floating point number representation. Decimal fractions do not come out even in binary notation. Please see FAQ 7.31 On Tue, Jul 10, 2012 at 4:17 PM, ollestrat wrote: > Hello, > > I fear its a stupid question,..but here it is: > > If I do this simple calculation with

[R] Download large file from https url with progress meter

2012-07-10 Thread Gregory Jefferis
Dear useRs, I would like to download a large (15Mb) file from a github https url with a progress meter. My first attempt was: zip_url="https://github.com/jefferis/AnalysisSuite/zipball/master"; zip_file=tempfile() > download.file(zip_url,zip_file) Error in download.file(zip_url, zip_file) : unsu

[R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-10 Thread ollestrat
Hello, I fear its a stupid question,..but here it is: If I do this simple calculation with the R console, I surprisingly do not get a zero. Why? -1.1-0.1+1.2 [1] -2.220446e-16 greetings, Ole -- View this message in context: http://r.789695.n4.nabble.com/1-1-0-1-1-2-is-NOT-null-Why-tp4636

Re: [R] Mann-Whitney by group

2012-07-10 Thread Oxenstierna
This works very well--thanks so much. By way of extension: how would one extract elements from the result object? For example: thing<=apply(Dtb[,3:10], 2, function(x) wilcox.test(x~Dtb$Group)) summary(thing)$p.value Does not provide a list of p-values as it would in a regression object. Idea

Re: [R] Need HELP: how find and use a csv file?

2012-07-10 Thread mlell08
On 10.07.2012 20:11, Faradj Koliev wrote: > However, when i enter:skatter.csv<-read.csv("skatter.csv", header=TRUE) i > get this message: > Error in file(file, "rt") : cannot open the connection > In addition: Warning message: > In file(file, "rt") : > I have tried with: skatter.csv<-fil

Re: [R] Need HELP: how find and use a csv file?

2012-07-10 Thread R. Michael Weylandt
On Jul 10, 2012, at 2:56 PM, Rich Shepard wrote: > On Tue, 10 Jul 2012, Faradj Koliev wrote: > >> I got a csv file ( skater.csv) which i could read by typing: >> read.csv(file="/Users/kama/Desktop/skatter.csv", header=TRUE, sep=";") > > Try: > > skatter <- read.csv('/Users/kama/Desktop/skat

Re: [R] R code help to change table format

2012-07-10 Thread Rui Barradas
Hello, You should say what is the package you are using, EstimateS returns hundreds of hits. [ package sos, findFn() ]. As for the question, try sp <- 1:5 ab <- c(3, 2, 2, 2, 4) rep(sp, ab) Hope this helps, Rui Barradas Em 10-07-2012 18:23, peziza escreveu: I am trying to input an OTU t

Re: [R] Changing x-axis values displayed on histogram

2012-07-10 Thread jlwoodard
Perfect! Thanks so much, Sarah! -- View this message in context: http://r.789695.n4.nabble.com/Changing-x-axis-values-displayed-on-histogram-tp4636032p4636051.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] calculating the difference between days?

2012-07-10 Thread Jorge I Velez
What's wrong with manipulating the results arun got? dat3<-read.table(text=" Begin_date End_date 01JAN2000:00:00:00:000 02FEB2002:00:00:00:000 24MAR2012:00:00:00:000 18MAY2012:00:00:00:000 01OCT2003:00:00:00:000 02FEB2004:00:00:00:000 01JAN2000:00:00:00:000

Re: [R] Use of Sappy and Tappy for Mathematical Calculation

2012-07-10 Thread R. Michael Weylandt
On Jul 10, 2012, at 11:30 AM, "Nordlund, Dan (DSHS/RDA)" wrote: >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of Rantony >> Sent: Tuesday, July 10, 2012 3:17 AM >> To: r-help@r-project.org >> Subject: [R] Use of Sappy an

Re: [R] Specify model with polynomial interaction terms up to degree n

2012-07-10 Thread William Dunlap
a) Please supply some context in your mail message. Not everyone reads R-help via nabble. b) poly(raw=TRUE, x, degree=degree) was changed for 2.15.0 to allow it to output a non-full-rank matrix. See the NEWS file in 2.15.0 or after: > # in R-2.15.1 > n <- news() > n[grepl("poly", n$Text),

Re: [R] Changing x-axis values displayed on histogram

2012-07-10 Thread Sarah Goslee
Hi, Thanks for providing a small reproducible example. You can disable the default axis and make your own custom version: hist(histexample,breaks=bins, xaxt="n") axis(1, at=seq(5.5, 15.5, by=2), labels=c("5-6", "7-8", "9-10", "11-12", "13-14", "15-16")) Sarah On Tue, Jul 10, 2012 at 3:34 PM, j

Re: [R] calculating the difference between days?

2012-07-10 Thread C W
Actually, when specifying unit="days" inside difftime() will do. -M On Tue, Jul 10, 2012 at 3:55 PM, C W wrote: > When the days and time are identical, difftime() gives difference in secs. > I still want difference in days. > > Say, below my last row is identical > dat3<-read.table(text=" > Beg

Re: [R] Need HELP: how find and use a csv file?

2012-07-10 Thread Rich Shepard
On Tue, 10 Jul 2012, Faradj Koliev wrote: I got a csv file ( skater.csv) which i could read by typing: read.csv(file="/Users/kama/Desktop/skatter.csv", header=TRUE, sep=";") Try: skatter <- read.csv('/Users/kama/Desktop/skatter.csv', header = T, sep = ';') Rich ___

Re: [R] Need HELP: how find and use a csv file?

2012-07-10 Thread Sarah Goslee
You don't actually have to post more than once. Really. skatter <- read.table(file.choose(), header=TRUE, sep=";") or skatter <- read.table(""/Users/kama/Desktop/skatter.csv", header=TRUE, sep=";") or whatever the actual path to the file is. As a new user of R, you should read the Introduction

Re: [R] calculating the difference between days?

2012-07-10 Thread C W
When the days and time are identical, difftime() gives difference in secs. I still want difference in days. Say, below my last row is identical dat3<-read.table(text=" Begin_date End_date 01JAN2000:00:00:00:000 02FEB2002:00:00:00:000 24MAR2012:00:00:00:000 18MAY

[R] Understanding cenros Error

2012-07-10 Thread Rich Shepard
Before reading water chemistry into a data frame I removed all missing data. Yet when I try to run cenros() to summarize a specific chemical I get an error that I do not understand: with( subset(chem, param=='Ag'), cenros(quant,ceneq1) ) Error in lm.fit(x, y, offset = offset, singular.ok = sin

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread Sarah Goslee
Hi, On Tue, Jul 10, 2012 at 12:48 PM, F86 wrote: > Hey, > > I am having problems with importing a csv file to R. > > I could read the file by typing: > read.csv(file="/Users/kama/Desktop/skatter.csv", header=TRUE, sep=";") So that command does work? > However, i can not analyze the "skatter" -

Re: [R] Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'

2012-07-10 Thread Rune Haubo
Hi Jeremy, I think Jessica is right that probably you could make polr converge and produce a Hessian if the data are better scaled, but there might also be other things not allowing you to get the Hessian/vcov. Could be insightful if you showed us the result of str(Jdata) Also, I am thinking that

[R] Need HELP: how find and use a csv file?

2012-07-10 Thread Faradj Koliev
Hey, I am having some problems with importing a csv file into R and then saving it for analyzing. I got a csv file ( skater.csv) which i could read by typing: read.csv(file="/Users/kama/Desktop/skatter.csv", header=TRUE, sep=";") However, when i enter:skatter.csv<-read.csv("skatter.c

[R] Changing x-axis values displayed on histogram

2012-07-10 Thread jlwoodard
Is it possible to change the x-axis values in a histogram to reflect binned values? Here are my data: histexample<-c(6,7,7,8,8,8,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,13,13,13,14,14,14,15,16) hist(histexample) Now, I'll bin pairs of adjacent values together (e.g., 5-6, 7-8

[R] Times Series Data using GLS

2012-07-10 Thread MRB305
I am trying to use regression to determine the interaction between a couple of variables while correcting for autocorrelation. Thus far, I have created the code: model <- gls(yvar~xvar1*xvar2, correlation = corARMA (p=2), method = "ML", data = data) I'm having a difficult time understanding the di

Re: [R] calculating the difference between days?

2012-07-10 Thread arun
Hi, Try this: dat3<-read.table(text=" Begin_date  End_date 01JAN2000:00:00:00:000  02FEB2002:00:00:00:000 24MAR2012:00:00:00:000  18MAY2012:00:00:00:000 01OCT2003:00:00:00:000  02FEB2004:00:00:00:000 01JAN2000:00:00:00:000  02FEB2000:00:00:00:000 01JAN2000:

Re: [R] Skipping lines and incomplete rows

2012-07-10 Thread arun
Hello Ravi, I was not aware that your dataset have special character "#" before NA.  If it was just plain NA, it would have worked.  So, It's not because of sep= ";". See below: #Without "#" dat1<-read.table(text="  Remove this line  Remove this line  Remove this line  Time;Actual Speed;Actual

[R] R code help to change table format

2012-07-10 Thread peziza
I am trying to input an OTU table into EstimateS, however, the format of the OTU table has to be changed to fit the format EstimateS will accept. In R, I would like to change the format of the OTU table (from excel). Here is what I need to do, take Example 1 and create Example 2. The problem is t

[R] problem for installing rgdal

2012-07-10 Thread stanislas rebaudet
Hello, I run [R] 2.14 on Mac OS 10.6 and I've been desperately trying to install rpy2 in order to compute spatial statistics on QGIS 1.7.3. rpy2 is dependent upon the rgdal [R]package that I've been unable to install in spite of up to date versions of GDAL and PROJ. More precisely, [R] console w

[R] HELP me please with import of csv to R

2012-07-10 Thread F86
Hey, I am having problems with importing a csv file to R. I could read the file by typing: read.csv(file="/Users/kama/Desktop/skatter.csv", header=TRUE, sep=";") However, i can not analyze the "skatter" - for ex, when i type: skatter = read.csv("skatter.csv") i get this message: Erro

Re: [R] Use of Sappy and Tappy for Mathematical Calculation

2012-07-10 Thread arun
Hi,  dat1<-data.frame(ABC=c(12,24,30),XYZ=c(20,35,40))  dat2<-as.matrix(dat1)  #mean  dat2mean<-apply(dat2,2,mean)  dat2mean   #   ABC  XYZ #22.0 31.7 dat2sum<-apply(dat2,2,sum)  dat2median<-apply(dat2,2,median)  dat2max<-apply(dat2,2,max) dat2min<-apply(dat2,2,min)  dat2range<-appl

Re: [R] Specify model with polynomial interaction terms up to degree n

2012-07-10 Thread YTP
Yep, that code is verbatim what I typed in, using version 2.14 ... seems weird. -- View this message in context: http://r.789695.n4.nabble.com/Specify-model-with-polynomial-interaction-terms-up-to-degree-n-tp4635130p4636031.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Laura Lee
Alain- Thanks again for your reply. Yes, the offset for effort is only in the count part of the model. Sorry I wasn't clear about why I was using 'sum'...my effort data set contains records of trips with the effort given for each trip. I thought using sum would get me the total number of turtle

Re: [R] fill 0-row data.frame with 1 line of NAs

2012-07-10 Thread Rui Barradas
Hello, Em 10-07-2012 18:59, Peter Ehlers escreveu: On 2012-07-10 08:50, Brian Diggs wrote: On 7/10/2012 7:53 AM, Peter Ehlers wrote: On 2012-07-10 06:57, Rui Barradas wrote: Hello, If you write a function, it becomes less convoluted... empty <- function(x){ if(NROW(x) == 0){

Re: [R] fill 0-row data.frame with 1 line of NAs

2012-07-10 Thread Peter Ehlers
On 2012-07-10 08:50, Brian Diggs wrote: On 7/10/2012 7:53 AM, Peter Ehlers wrote: On 2012-07-10 06:57, Rui Barradas wrote: Hello, If you write a function, it becomes less convoluted... empty <- function(x){ if(NROW(x) == 0){ y <- rep(NA, NCOL(x)) names(y) <- names(x)

Re: [R] Extracting arithmetic mean for specific values from multiple .txt-files

2012-07-10 Thread Rui Barradas
Hello, I'm glad it help. As for this second question, you should explain yourself better. 1. What is a test subject, which column records its id? vpNum? 2. You say "divided per trials or trialCount". Does this mean per trial number (example: divide by 1, by 2, by 3, etc, by 149) or per number

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Highland Statistics Ltd
*Laura Lee* laura.lee at ncdenr.gov /Tue Jul 10 18:27:16 CEST 2012/ ---

Re: [R] R to winbugs interface

2012-07-10 Thread Uwe Ligges
On 09.07.2012 19:27, PRAGYA SUR wrote: Yes that was the problem. Thank you very much. Can anyone tell me the meaning of The following object(s) are masked _by_ '.GlobalEnv': beta It means you have two instances of "beta", one in your workspace ('.GlobalEnv') and one that is probably i

[R] calculating the difference between days?

2012-07-10 Thread C W
Hi List, I have one column of beginning dates and one column of ending dates, I want to find their difference. And I want to ignore the trailing zeros, basically everything after the first colon mark. Begin_date End_date 01JAN2000:00:00:00:000 02FEB2002:00:00:00:0

Re: [R] Extracting arithmetic mean for specific values from multiple .txt-files

2012-07-10 Thread vimmster
Dear Rui, thank you very much. Your solution works perfectly. One last question: I need to write a function, with ONE value (here: a ratio) for the correct reactions divided per trials or trialCount, respectively, FOR EACH test subject. "/" means "divided by" in the following. I need the rati

Re: [R] Questions about doing analysis based on time

2012-07-10 Thread Rui Barradas
Hello, You can use cut.POSIXt from package base. cut(dat$SunDate, breaks="30 mins") Hope this helps, Rui Barradas Em 10-07-2012 13:43, APOCooter escreveu: Thanks to everyone for their help so far. It's been greatly appreciated. I have a new, but similar problem: I have data that I have b

Re: [R] Use of Sappy and Tappy for Mathematical Calculation

2012-07-10 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Rantony > Sent: Tuesday, July 10, 2012 3:17 AM > To: r-help@r-project.org > Subject: [R] Use of Sappy and Tappy for Mathematical Calculation > > Hi, > > i have a matrix like thi

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Laura Lee
I want to predict the number of turtles for different levels of effort and combinations of covariates. So, for my dataset from which I built the model, would I compare sum(predict(ZIP,type="response")) to the observed bycatch to compare numbers? In order to predict for the new data (called effort),

Re: [R] Help with vectors and rollapply

2012-07-10 Thread William Dunlap
It looks like you already have the zoo package loaded so you can use its na.locf(), which replaces NA's with the last non-NA value. Convert the 0s to NAs with replace() and feed the result into na.locf(): a <- c(-2,0,0,0,1,0,0,3,0,0,-4) aOut <- c(-2,-2,-2,-2,1,1,1,3,3,3,-4) na.locf(replace

[R] RGL 3D curvilinear shapes

2012-07-10 Thread PatGauthier
Dear useRs, I'm trying to simply fill in the area under a curve using RGL. Here' the set up: x <- c(0.75,75.75,150.75,225.75,300.75,375.75,450.75,525.75,600.75,675.75, 0.5,50.5,100.5,150.5,200.5,250.5,300.5,350.5,400.5,450.5, 0.25,25.25,50.25,75.25,100.25,125.25,150.25,175.25,200.2

Re: [R] Count of elements in coulmns of a matrix

2012-07-10 Thread arun
Hi, Try this: list1<-list(ABC=c(2,5),XYZ=c(3,4,4,2),PQR=c(4,5,3)) > lapply(list1,function(x) length(x)) $ABC [1] 2 $XYZ [1] 4 $PQR [1] 3  list2<-lapply(list1,function(x) length(x))  dat2<-data.frame(list2)  dat2   ABC XYZ PQR 1   2   4   3 A.K. - Original Message - From: Rantony To

Re: [R] multiple comparisons with generalised least squares

2012-07-10 Thread Ariel
racmar wrote > > I have also been searching various forums and books to see if there are > any methods I could use and have only found people, such as yourself, > asking the same question. > I was looking into this recently, as well, and found that the problem has to do with building the model

[R] Help with vectors and rollapply

2012-07-10 Thread Raghuraman Ramachandran
Hello I have a vector a =(-2,0,0,0,1,0,0,3,0,0,-4) I want to replace all zeros into previous non-zero state. So for instance the above vector should be converted into: a= (-2,-2,-2,-2,1,1,1,3,3,3,-4) I tried many things and finally concluded that probably(?) rollapply may be the best way? I

Re: [R] fill 0-row data.frame with 1 line of NAs

2012-07-10 Thread Brian Diggs
On 7/10/2012 7:53 AM, Peter Ehlers wrote: On 2012-07-10 06:57, Rui Barradas wrote: Hello, If you write a function, it becomes less convoluted... empty <- function(x){ if(NROW(x) == 0){ y <- rep(NA, NCOL(x)) names(y) <- names(x) y }else x } (.xb <- iris[ iris$S

Re: [R] define stuff to be only usable in the same file

2012-07-10 Thread Jessica Streicher
On 10.07.2012, at 16:45, Jessica Streicher wrote: > > On 10.07.2012, at 15:24, Duncan Murdoch wrote: > >> On 12-07-10 9:13 AM, Jessica Streicher wrote: >>> Hello R-Help! >>> >>> I've looked around and have not found: >>> >>> A simple(short) way to hide functions and variables from the global

Re: [R] fill 0-row data.frame with 1 line of NAs

2012-07-10 Thread Peter Ehlers
On 2012-07-10 06:57, Rui Barradas wrote: Hello, If you write a function, it becomes less convoluted... empty <- function(x){ if(NROW(x) == 0){ y <- rep(NA, NCOL(x)) names(y) <- names(x) y }else x } (.xb <- iris[ iris$Species=='zz

Re: [R] Mac OS X R uninstallation question

2012-07-10 Thread Prof Brian Ripley
Please ask Mac-specific questions on R-sig-mac. In particular, it is a little odd that these are not getting deleted when you install a new version. But *if all your packages are up to date* you do not need earlier versions of R.framework, so run update.packages(checkBuilt=TRUE) first. On

Re: [R] define stuff to be only usable in the same file

2012-07-10 Thread Jessica Streicher
On 10.07.2012, at 15:24, Duncan Murdoch wrote: > On 12-07-10 9:13 AM, Jessica Streicher wrote: >> Hello R-Help! >> >> I've looked around and have not found: >> >> A simple(short) way to hide functions and variables from the global >> environment. What i want is for a few of them to only be acc

Re: [R] Count of elements in coulmns of a matrix

2012-07-10 Thread Sarah Goslee
It depends: what's in those "empty" space? Some combination of apply() and something else, depending on what your matrix *actually* looks like, and here dput() would be vastly preferable to copy and paste of something that didn't even come from an R session. The something else might involve lengt

[R] gdata: Problem reading excel document containing non-US characters

2012-07-10 Thread Rolf Marvin Bøe Lindgren
I am using the gdata package to read in an Excel document. read.xls chokes on a “foreign” character. Here's the original code: require(gdata) dendro <- read.xls("/tmp/avitot.xlsv3WiXg",fileEncoding="Latin1") Now, the fileEncoding="Latin1" ought to work, because if i copy the code for rea

[R] Count of elements in coulmns of a matrix

2012-07-10 Thread Rantony
Could you please tell me what is the function or method to get count of elements in all the columns in a matrix ? for eg :- ABC XYZPQR -- - -- 234 4 5 54 3 2 Result will be like ABC

Re: [R] Questions about doing analysis based on time

2012-07-10 Thread APOCooter
Thanks to everyone for their help so far. It's been greatly appreciated. I have a new, but similar problem: I have data that I have broken down by hour (median/mean for each hour). I would like to break it down further, by each half hour (0:00-0:29, 0:30-0:59, 1:00-1:29, 1:30-1:59, etc). I tho

[R] Mac OS X R uninstallation question

2012-07-10 Thread Alastair
Hi, I've been using R for a number of years and have always installed the newest version when released. However I've just noticed that old versions of R are taking up quite a lot of disk space. lap-alastair:/ alastair$ du -h -d 1 /Library/Frameworks/R.framework/Versions/ 266M/Library/Framewor

[R] fitting power growth

2012-07-10 Thread Thomas Hoffmann
Dear all I am using the x and y vectors as defined below and want do to a power law regression: y = a x^b using > lm(log(y)~log(x)) gives reasonable values (b=1.23) but is not very popular due to biases of back-transformation from log to non-log values. Using > nls(y~a*x^b,start=list(a=1

[R] Use of Sappy and Tappy for Mathematical Calculation

2012-07-10 Thread Rantony
Hi, i have a matrix like this, ABCXYZ... . - -- 1220 ... . 2435 ... . 3040 ... . Here, i need to get Sum of each colu

[R] identify.hclust() doesn't cut tree at the vertical position of the mouse pointer

2012-07-10 Thread WATSON Mick
Dear All According to the identify.hclust documentation the function "cuts the tree at the vertical position of the pointer and highlights the cluster containing the horizontal position of the pointer". When I carry out this, the tree isn't cut where I click - in fact, there seems to be a limi

[R] customize packages' help index ( 00index.html file )

2012-07-10 Thread Damien Georges
Hi all, I'm writing my packages helps files and I'm not really satisfied by the visual results. I'm would like to make subsections in a package "function help index" file. I would like for example to put all S4 object documentation link together, then all the getters function.. and so on..

Re: [R] image.plot transparent?

2012-07-10 Thread Prof Brian Ripley
On 10/07/2012 13:41, Sarah Goslee wrote: This may be device and OS dependent, so please provide the information requested in the posting guide, at a minimum the output of sessionInfo(). A small reproducible example is also necessary. I think not. My guess is it is part of a package which we we

Re: [R] Plotting rpart trees with long list of class members

2012-07-10 Thread Jean V Adams
Thanks. Very helpful. You can use the information from the splits in the first tree, to define a new grouping variable, which will simplify the plot: suvar <- sort(unique(test_set$list_var)) test_set$var_grp <- as.factor(testtree$csplit[match(test_set$list_var, suvar)]) testtree2 <- rpart ( lis

Re: [R] fill 0-row data.frame with 1 line of NAs

2012-07-10 Thread Rui Barradas
Hello, If you write a function, it becomes less convoluted... empty <- function(x){ if(NROW(x) == 0){ y <- rep(NA, NCOL(x)) names(y) <- names(x) y }else x } (.xb <- iris[ iris$Species=='zz', ]) empty(.xb) Hope this helps, Rui B

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Achim Zeileis
On Tue, 10 Jul 2012, Laura Lee wrote: Alain- Thanks again for the response. I guess my question is more related to R, which I'm learning as I go along. Could you provide guidance as to how I would code this in R? That depends on what exactly you want to predict. As Alain said: The type="co

Re: [R] RGB components of plot() colours

2012-07-10 Thread Sarah Goslee
R uses the sandard X11 colors, I believe, and if you're using linux there's a rgb.txt file on your computer that contains them. It's also available here http://cvsweb.xfree86.org/cvsweb/*checkout*/xc/programs/rgb/rgb.txt?rev=1.1 and a less-authoritative but prettier version: http://en.wikipedia.o

Re: [R] define stuff to be only usable in the same file

2012-07-10 Thread Duncan Murdoch
On 12-07-10 9:13 AM, Jessica Streicher wrote: Hello R-Help! I've looked around and have not found: A simple(short) way to hide functions and variables from the global environment. What i want is for a few of them to only be accessable from the scriptfile they're in. I probably could do fun th

  1   2   >