Re: [R] find value between two other numbers?

2010-08-12 Thread baptiste auguie
Hi, I see no need to construct the vector, try this instead, belong = function(x=4, y=c(1,10)) x <= y[2] && x >= y[1] see also ?findInterval HTH, baptiste On 13 August 2010 01:10, fishkbob wrote: > > So basically I want to do this - > > 4 %in% 1:10 > should return true > > Would there be an

Re: [R] find value between two other numbers?

2010-08-12 Thread Jorge Ivan Velez
Hi, Here is one way: > is.there <- function(mynumber, a, b) mynumber %in% a:b > is.there(4, 1, 10) [1] TRUE > is.there(459124, 103000, 983000) [1] TRUE > is.there(4, 103000, 983000) [1] FALSE HTH, Jorge On Thu, Aug 12, 2010 at 7:10 PM, fishkbob <> wrote: > > So basically I want to do this -

[R] mlogit error

2010-08-12 Thread Maha Bakoben
Hi, I'm trying to fit a multinomial logistic regression to my data which consists of 5 discrete variables (scales 1:10) and 1000 observations. I get the following error: Error in `row.names<-.data.frame`(`*tmp*`, value = c("NA.NA", "NA.NA", : duplicate 'row.names' are not allowed In addition:

[R] find value between two other numbers?

2010-08-12 Thread fishkbob
So basically I want to do this - 4 %in% 1:10 should return true Would there be another way of doing this without having to do the 1:10 part? I am using a very large data set and trying to do 459124 %in% 103000:983000 multiple times for many values, and it is taking quite a long time Also, I

Re: [R] build.pl in building library with Rtools211

2010-08-12 Thread Hintzen, Niels
R CMD build (lower case) indeed works. I was confused with older versions of Rtools where it didn't matter if you used lower or upper case (as well as that I thought under DOS upper and lower cases don't make a difference). I was wrong however. Thanks for the help __

[R] help

2010-08-12 Thread milly
I need a code to export my output to excel 2007.I am dealing with observations of 15,000.Thank you -- View this message in context: http://r.789695.n4.nabble.com/help-tp2323542p2323542.html Sent from the Export many data to Excel 2007 mailing list archive at Nabble.com.

[R] subsetting data points within confidence limit

2010-08-12 Thread Keun-Hyung Choi
Dear R-list Suppose I have a data set stored in hmet, for which I did get confidence limit on a linear regression as shown below. My question is how I can subset only data points which are within the confidence limit. Thank you. Keun-Hyung ---

Re: [R] Learning ANOVA

2010-08-12 Thread Stephen Liu
Hi David, Thanks for your advice. The remaining commands will be; ### Create a side-by-side boxplot of the test01 boxplot(test01$DO ~ test01$Stream) ### Create an ANOVA table dotest01.aov <-(test01$DO ~ test01$Stream) summary(dotest01.aov) ### Conduct a Tukey's multiple comparison procedure Tu

Re: [R] Learning ANOVA

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 11:34 PM, Stephen Liu wrote: Hi folks, File to be used is on; data(InsectSprays) I can't figure out where to insert it on following command; test01 <- read.csv(fil.choose(), header=TRUE) Don't think that would work, even if you did spell file.choose() correctly. ?d

[R] Learning ANOVA

2010-08-12 Thread Stephen Liu
Hi folks, File to be used is on; data(InsectSprays) I can't figure out where to insert it on following command; test01 <- read.csv(fil.choose(), header=TRUE) Please help. TIA B.R. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] How to calculate the concentration

2010-08-12 Thread Yi
Thank you both for response! Enh, I never think about function though. Good. My way is using 'aggregate' and 'merge' but it is a little bit trivial. On Wed, Aug 11, 2010 at 9:13 PM, Dennis Murphy wrote: > Hi: > > Try this from package plyr: > > library(plyr) > # function to compute sum of sq

Re: [R] Need help to understand integrate function

2010-08-12 Thread Ravi Varadhan
The magic is not in setting options(digits=10). I did that just to show you the accuracy of the answer. The magic is in setting a more stringent error tolerance, rel.tol=1.e-10. The divergent error is due to the fact that the default tolerance of (roughly) 1.e-04 is too large. Ravi. __

[R] 64 bit RSQLite

2010-08-12 Thread Stephen Liu
Hi folks, Ubuntu 10.04 64 bit Where can I find 64 bit RSQLite? It seems not there; RSQLite: SQLite interface for R http://cran.r-project.org/web/packages/RSQLite/index.html TIA B.R. Stephen L __ R-help@r-project.org mailing list https://stat.eth

Re: [R] R 64-bit and Revolution

2010-08-12 Thread David Smith
On Thu, Aug 12, 2010 at 4:12 PM, Lars Bishop wrote: > The company where I work is considering getting a license for Revolution > Enterprise - Windows 64-bit. I'll appreciate for those familiar with the > product if can share your experiences with it? In particular, how does it > compare to the "fr

Re: [R] factor failure

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 9:00 PM, elaine kuo wrote: Dear list, factor function was tried but failed. Pls kindly help and thank you. E. code rm(list=ls()) library(faraway) data (pima) pima$test < - factor (pima$test) There is a space between your "<" and your "-". R is interppreting that a

Re: [R] Need help to understand integrate function

2010-08-12 Thread R_help Help
Hi Ravi - Thank you. I'm wondering how the magic happens here with options(digits=10)? And the most important point, I do not quite understand why divergent error could occur. In this case, the function is analytically integrable. Any insight would be greatly appreciated so that I learn something o

Re: [R] storing the results of an apply call

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 7:54 PM, Greg Snow wrote: -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Thursday, August 12, 2010 3:13 PM To: Greg Snow Cc: Joshua Wiley; r-help@r-project.org Subject: Re: [R] storing the results of an apply call On Aug 12, 2010, at

Re: [R] factor failure

2010-08-12 Thread Erik Iverson
On 08/12/2010 08:00 PM, elaine kuo wrote: Dear list, factor function was tried but failed. Pls kindly help and thank you. E. code rm(list=ls()) library(faraway) data (pima) pima$test< - factor (pima$test) [1] NA NA NA NA NA NA The unreported warning message should have given you a hi

[R] factor failure

2010-08-12 Thread elaine kuo
Dear list, factor function was tried but failed. Pls kindly help and thank you. E. code rm(list=ls()) library(faraway) data (pima) pima$test < - factor (pima$test) [1] NA NA NA NA NA NA [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] storing the results of an apply call

2010-08-12 Thread Greg Snow
> -Original Message- > From: David Winsemius [mailto:dwinsem...@comcast.net] > Sent: Thursday, August 12, 2010 3:13 PM > To: Greg Snow > Cc: Joshua Wiley; r-help@r-project.org > Subject: Re: [R] storing the results of an apply call > > > On Aug 12, 2010, at 5:07 PM, Greg Snow wrote: > >

Re: [R] storing the results of an apply call

2010-08-12 Thread Greg Snow
> -Original Message- > From: Marc Schwartz [mailto:marc_schwa...@me.com] > Sent: Thursday, August 12, 2010 3:32 PM > To: Greg Snow; Joshua Wiley > Cc: r-help@r-project.org Forum > Subject: Re: [R] storing the results of an apply call > > P.S. Pardon me while I go visit with the Emacs Psy

Re: [R] R 64-bit and Revolution

2010-08-12 Thread TGS
I downloaded their Academic version and installed it on a Windows virtual machine (as there is not a Mac version available). I played around with it a little bit and wasn't overly impressed. I still like my current configuration: textmate with R bundle on Mac OSX. With textmate data entry is a

[R] R 64-bit and Revolution

2010-08-12 Thread Lars Bishop
Dear users, The company where I work is considering getting a license for Revolution Enterprise - Windows 64-bit. I'll appreciate for those familiar with the product if can share your experiences with it? In particular, how does it compare to the "free" version of R 64-bit? Thanks in advance. Re

Re: [R] storing the results of an apply call

2010-08-12 Thread Joshua Wiley
On Thu, Aug 12, 2010 at 2:31 PM, Marc Schwartz wrote: > On Aug 12, 2010, at 4:07 PM, Greg Snow wrote: > >>> -Original Message- >>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- >>> project.org] On Behalf Of Joshua Wiley >>> Sent: Wednesday, August 11, 2010 6:31 PM >>> To: Lo

[R] Revolutions Blog: July Roundup

2010-08-12 Thread David Smith
I write about R every weekday at the Revolutions blog:  http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related to R from the month of July: http:/

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 6:15 PM, David Winsemius wrote: On Aug 12, 2010, at 5:20 PM, Toby Gass wrote: Hi, I do want to look only at slope. If there is one negative slope measurement for a given day and a given chamber, I would like to remove all other slope measurements for that day and that c

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 5:20 PM, Toby Gass wrote: Hi, I do want to look only at slope. If there is one negative slope measurement for a given day and a given chamber, I would like to remove all other slope measurements for that day and that chamber, even if they are positive. On one day, I will

Re: [R] Plotting one dot in a graph

2010-08-12 Thread David Winsemius
OK, looks sensible, although I said either abs() OR squared differences. I don't think it makes sense to use both the L1 and the L2 metric at the same time. -- David. On Aug 12, 2010, at 4:58 PM, TGS wrote: # just to clean it up for my own understanding, the "difference" approach as you ha

Re: [R] Fiting a trend + periodic signal

2010-08-12 Thread Carl Witthoft
Use nls(). But you should also take the time to learn a bit about data fits in general. I'm far from expert, but it sure looks like that P(t) is overconstrained. Since cos(wt) = sin(wt+pi/2), why do you have all those different terms? Dear all, I have a time series and I like to fit S

Re: [R] storing the results of an apply call

2010-08-12 Thread Marc Schwartz
On Aug 12, 2010, at 4:07 PM, Greg Snow wrote: >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- >> project.org] On Behalf Of Joshua Wiley >> Sent: Wednesday, August 11, 2010 6:31 PM >> To: Lorenzo Cattarino >> Cc: r-help@r-project.org >> Subject: Re: [R]

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Toby Gass
Hi, I do want to look only at slope. If there is one negative slope measurement for a given day and a given chamber, I would like to remove all other slope measurements for that day and that chamber, even if they are positive. On one day, I will have 20 slope measurements for each chamber.

Re: [R] Scatterplot - Overlap Frequency

2010-08-12 Thread Greg Snow
If you want a grid of hexagons, look at the examples in the my.symbols function (TeachingDemos package), one of those gives a way to create the grid of hexagons (not as efficient as the hexbin package, but allows you to set your own colors). For choosing colors you may want to look at the RColo

Re: [R] storing the results of an apply call

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 5:07 PM, Greg Snow wrote: [1] "metacarpal sit-down unfriendliness chapel ME" My wife gives "ME" the "middle phalangeal unfriendliness" message about once a week. -- David Winsemius, MD West Hartford, CT __ R-help@r-proje

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Marc Schwartz
On Aug 12, 2010, at 3:06 PM, Toby Gass wrote: > Thank you all for the quick responses. So far as I've checked, > Marc's solution works perfectly and is quite speedy. I'm still > trying to figure out what it is doing. :) > > Henrique's solution seems to need some columns somewhere. David's

Re: [R] storing the results of an apply call

2010-08-12 Thread Greg Snow
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Joshua Wiley > Sent: Wednesday, August 11, 2010 6:31 PM > To: Lorenzo Cattarino > Cc: r-help@r-project.org > Subject: Re: [R] storing the results of an apply call > > What foll

[R] send and receiving objects with Rmpi

2010-08-12 Thread Remi Gagne
Hi all, I'm having difficulties passing data from the master to the children. I haven't seen any complete tutorial, all the tutorial broadcast data where I would like to send parts of my big tablechip list. Everytime I run this, the last line always jams. I even tried to reduce the number of r

Re: [R] reading fixed width format data with 2 types of lines

2010-08-12 Thread Charles C. Berry
On Thu, 12 Aug 2010, Tim Gruene wrote: I don't know if it's elegant enough for you, but you could split the file into two files with 'grep "^3" file > file_3' and 'grep "^4" file > file_4' and then read them in separately. along the same lines, but all in R (untested) original.lines <- readL

Re: [R] Plotting one dot in a graph

2010-08-12 Thread TGS
# just to clean it up for my own understanding, the "difference" approach as you had suggested would be x <- seq(.2, .3, by = .1) f1 <- function(x){ x*cos(x)-2*x**2+3*x-1 } plot(x,f1(x), type = "l") abline(h = -.1) abline(v = x[which.min(abs(diff((f1(x) - (-.1))**2)))], lty = 'dotted'

Re: [R] Scatterplot - Overlap Frequency

2010-08-12 Thread Wu Gong
Hi Marcio, Your friend has given the answer. x <- rnorm(10) y <- rnorm(10) ind <- c(3,0,1,0,3,0,2,2,0,0) plot(x, y, col = grey(0:max(ind)/max(ind))[ind], pch = 16) Mestat wrote: > > I am working o a scatterplot where I would like to plot the variables > according with another frequency var

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 4:06 PM, Toby Gass wrote: Thank you all for the quick responses. So far as I've checked, Marc's solution works perfectly and is quite speedy. I'm still trying to figure out what it is doing. :) Henrique's solution seems to need some columns somewhere. David's solution do

Re: [R] how to eliminate an element of a list

2010-08-12 Thread Henrique Dallazuanna
Try this: setdiff(list, s) On Thu, Aug 12, 2010 at 5:32 PM, André de Boer wrote: > Hi, > > I want to eliminate an element of a list: > > list <- seq(1,5,1) > s <- sample(list,1) > > lets say s=3 > Now I want to remove 3 from the list: list2 = {1,2,4,5} > > Can someone give me a tip? > > Thanks,

[R] how to eliminate an element of a list

2010-08-12 Thread André de Boer
Hi, I want to eliminate an element of a list: list <- seq(1,5,1) s <- sample(list,1) lets say s=3 Now I want to remove 3 from the list: list2 = {1,2,4,5} Can someone give me a tip? Thanks, André [[alternative HTML version deleted]] __ R-hel

[R] Scatterplot - Overlap Frequency

2010-08-12 Thread Mestat
Hi listers... I am working o a scatterplot where I would like to plot the variables according with another frequency variable. Another friend here proposed this code... x <- rnorm(10) y <- rnorm(10) ind <- c(1,0,1,0,1,0,1,1,0,0) plot(x, y, col = ind + 1, pch = 16) # 1 is black, 2 is red But in

Re: [R] build.pl in building library with Rtools211

2010-08-12 Thread Uwe Ligges
What did you try? R CMD build (build all lower case) does work for me Uwe Ligges On 09.08.2010 22:30, Hintzen, Niels wrote: Dear all, As I couldn't find any thread on the internet I hope the help-list might help me out. I've tried to update Rtools from R210 used in combination with R2.9.1

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Toby Gass
Thank you all for the quick responses. So far as I've checked, Marc's solution works perfectly and is quite speedy. I'm still trying to figure out what it is doing. :) Henrique's solution seems to need some columns somewhere. David's solution does not find all the other measurements, possibl

Re: [R] Plotting one dot in a graph

2010-08-12 Thread TGS
I was meaning something like the following: x <- seq(.2, .3, by = .01) f <- function(x){ x*cos(x)-2*x**2+3*x-1 } plot(x,f(x), type = "l") abline(h = -.1) But I'm guessing "uniroot" will do this?---I haven't looked far into the uniroot function to see if it will solve this. On Aug 12, 20

Re: [R] reading fixed width format data with 2 types of lines

2010-08-12 Thread Tim Gruene
I don't know if it's elegant enough for you, but you could split the file into two files with 'grep "^3" file > file_3' and 'grep "^4" file > file_4' and then read them in separately. Tim On Thu, Aug 12, 2010 at 01:57:19PM -0400, Denis Chabot wrote: > Hi, > > I know how to read fixed width forma

Re: [R] Plotting one dot in a graph

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 3:54 PM, TGS wrote: Actually I spoke too soon David. I'm looking for a function that will either tell me which point is the intersection so that I'd be able to plot a point there. Or, if I have to solve for the roots in the ways which were demonstrated yesterday, then

Re: [R] help usin scan on large matrix (caveats to what has been discussed before)

2010-08-12 Thread Martin Tomko
I did. Did not work. Did you try your code? The matrix did not result into integer numbers as expected. MY approach resulted in a correct scan result, at least. M. > Martin Tomko wrote: >> Hi Peter, >> apologies, too fast copying and pasting. >> So, here is the explanation: >> f<-"C:/test/mytab.tx

Re: [R] Plotting one dot in a graph

2010-08-12 Thread TGS
Actually I spoke too soon David. I'm looking for a function that will either tell me which point is the intersection so that I'd be able to plot a point there. Or, if I have to solve for the roots in the ways which were demonstrated yesterday, then would I be able to specify what the horizontal

Re: [R] Plotting one dot in a graph

2010-08-12 Thread TGS
Yes, I'm playing around with other things but the "points()" function is what I was looking for. Thanks On Aug 12, 2010, at 12:47 PM, David Winsemius wrote: On Aug 12, 2010, at 3:43 PM, TGS wrote: > I'd like to plot a point at the intersection of these two curves. Thanks > > x <- seq(.2, .3,

Re: [R] x-axis label print in 45 degree

2010-08-12 Thread array chip
I searched with "print x-axis label in 45 degree" which didn't return useful links. Apparently I used poor search keywords. - Original Message From: David Winsemius To: Marc Schwartz Cc: array chip ; r-help@r-project.org Sent: Thu, August 12, 2010 12:34:16 PM Subject: Re: [R] x-ax

Re: [R] x-axis label print in 45 degree

2010-08-12 Thread array chip
Than you Marc. John - Original Message From: Marc Schwartz To: array chip Cc: r-help@r-project.org Sent: Thu, August 12, 2010 12:17:12 PM Subject: Re: [R] x-axis label print in 45 degree On Aug 12, 2010, at 2:14 PM, array chip wrote: > Hi how can print x-axis labels in 45 degree in

[R] Plotting one dot in a graph

2010-08-12 Thread TGS
I'd like to plot a point at the intersection of these two curves. Thanks x <- seq(.2, .3, by = .01) f <- function(x){ x*cos(x)-2*x**2+3*x-1 } plot(x,f(x), type = "l") abline(h = 0) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

Re: [R] rpart package

2010-08-12 Thread Boris Reiss
Hi Olga, not directly related to your question. We have also a server installation and subsequently our IT department determines which version and packages I can use on R. A few days ago I have switched to R-portable. Works without any problems from my USB stick on any locked-for-installation W

Re: [R] x-axis label print in 45 degree

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 3:17 PM, Marc Schwartz wrote: On Aug 12, 2010, at 2:14 PM, array chip wrote: Hi how can print x-axis labels in 45 degree in boxplot() (or plot in general)? I can use las=2 to print in 90 degree, but it looks ugly. Is there a simple option to do 45 degree easily? Thank

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Marc Schwartz
On Aug 12, 2010, at 2:24 PM, Marc Schwartz wrote: > On Aug 12, 2010, at 2:11 PM, Toby Gass wrote: > >> Dear helpeRs, >> >> I have a dataframe (14947 x 27) containing measurements collected >> every 5 seconds at several different sampling locations. If one >> measurement at a given location is

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Marc Schwartz
On Aug 12, 2010, at 2:11 PM, Toby Gass wrote: > Dear helpeRs, > > I have a dataframe (14947 x 27) containing measurements collected > every 5 seconds at several different sampling locations. If one > measurement at a given location is less than zero on a given day, I > would like to delete al

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Henrique Dallazuanna
Try this: subset(toy, !rowSums(mapply(is.element, toy[c('CH', 'DAY')], subset(toy, SLOPE < 0, CH:DAY))) > 1 | SLOPE < 0) On Thu, Aug 12, 2010 at 4:11 PM, Toby Gass wrote: > Dear helpeRs, > > I have a dataframe (14947 x 27) containing measurements collected > every 5 seconds at several differen

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 3:11 PM, Toby Gass wrote: Dear helpeRs, I have a dataframe (14947 x 27) containing measurements collected every 5 seconds at several different sampling locations. If one measurement at a given location is less than zero on a given day, I would like to delete all measuremen

Re: [R] x-axis label print in 45 degree

2010-08-12 Thread Marc Schwartz
On Aug 12, 2010, at 2:14 PM, array chip wrote: > Hi how can print x-axis labels in 45 degree in boxplot() (or plot in > general)? I > can use las=2 to print in 90 degree, but it looks ugly. Is there a simple > option > to do 45 degree easily? > > Thanks > > John John, See R FAQ 7.27 How c

[R] x-axis label print in 45 degree

2010-08-12 Thread array chip
Hi how can print x-axis labels in 45 degree in boxplot() (or plot in general)? I can use las=2 to print in 90 degree, but it looks ugly. Is there a simple option to do 45 degree easily? Thanks John __ R-help@r-project.org mailing list https://stat.

[R] conditional selection of dataframe rows

2010-08-12 Thread Toby Gass
Dear helpeRs, I have a dataframe (14947 x 27) containing measurements collected every 5 seconds at several different sampling locations. If one measurement at a given location is less than zero on a given day, I would like to delete all measurements from that location on that day. Here is a t

Re: [R] shrout & fleiss ICC´s with varying numbers o f judges

2010-08-12 Thread aleahmad
hi Peter, There's no single function for ICC with variable number of judges. To estimate the variances in that case you need hierarchical linear modeling. I posted code for this at Stackoverflow in answer to your question there: http://stackoverflow.com/questions/3205176/ Stats questions get

Re: [R] Error in rowSums

2010-08-12 Thread Peter Ehlers
Another suggestion: compare -1:4 with -(1:4) -Peter Ehlers On 2010-08-12 12:28, Amit Patel wrote: Hi I am trying to calculate the row sums of a matrix i have created The matrix ( FeaturePresenceMatrix) has been created by 1) Read csv 2) Removing unnecesarry data using [-1:4,] command

Re: [R] Error in rowSums

2010-08-12 Thread TGS
Yes, please do as Erik said in the future but here's one way to do it. (A <- matrix(data = rnorm(n = 9, mean = 0, sd = 1), nrow = 3, ncol = 3, byrow = FALSE, dimnames = NULL)) matrix(rowSums(A)) On Aug 12, 2010, at 11:28 AM, Amit Patel wrote: Hi I am trying to calculate the row sums of a matr

Re: [R] Error in rowSums

2010-08-12 Thread Erik Iverson
Amit Patel wrote: Hi I am trying to calculate the row sums of a matrix i have created The matrix ( FeaturePresenceMatrix) has been created by 1) Read csv 2) Removing unnecesarry data using [-1:4,] command 3) replacing all the NA values with as.numeric(0) and all others with as.numeric (1)

[R] Error in rowSums

2010-08-12 Thread Amit Patel
Hi I am trying to calculate the row sums of a matrix i have created The matrix ( FeaturePresenceMatrix) has been created by 1) Read csv 2) Removing unnecesarry data using [-1:4,] command 3) replacing all the NA values with as.numeric(0) and all others with as.numeric (1) When I carry out the

Re: [R] drawing dot plots with size, shape affecting dot characteristics

2010-08-12 Thread Hadley Wickham
On Wed, Aug 11, 2010 at 10:14 PM, Brian Tsai wrote: > Hi all, > > I'm interested in doing a dot plot where *both* the size and color (more > specifically, shade of grey) change with the associated value. > > I've found examples online for ggplot2 where you can scale the size of the > dot with a va

Re: [R] rpart package

2010-08-12 Thread Erik Iverson
Olga Shaganova wrote: Hi, I am a brand new user and may be my question is too simple. I have R on our (not Unix) server. I am trying to build a decision tree and the error message says "couldn't find function rpart". Does it mean I have to ask our server guy to install an additional package?

Re: [R] multicore mclapply error

2010-08-12 Thread Jarrett Byrnes
Ah. Indeed, this is from the glmulti. I had not realized there would be problems using Java. Is there a way around this to still use a multicore approach? For what other packages that use multiple cores will this not be a problem? -Jarrett On Aug 12, 2010, at 11:02 AM, Thomas Lumley wrote:

Re: [R] Creating vectors

2010-08-12 Thread JesperHybel
You can use following scriptI think #create a vector of random numbers on which to test script v<-sample(1:3,size=90,replace=TRUE) #creates two matrixes out of vector v which can be assigned to M to test script M2<-matrix(v,ncol=2) M3<-matrix(v,ncol=3) M<- #Assign you're matrix or a te

Re: [R] Creating vectors

2010-08-12 Thread clips10
I think your code will work but only for the two columns I gave. I used those as an example but my actual data is 200 in length with two columns and I need code that will give a label to each unique pair but still have the original length for instance, one that will turn something such as

[R] rpart package

2010-08-12 Thread Olga Shaganova
Hi, I am a brand new user and may be my question is too simple. I have R on our (not Unix) server. I am trying to build a decision tree and the error message says "couldn't find function rpart". Does it mean I have to ask our server guy to install an additional package? Thank you, Olga [

Re: [R] multicore mclapply error

2010-08-12 Thread Thomas Lumley
On Thu, 12 Aug 2010, Jarrett Byrnes wrote: I'm running r 2. on a mac running 10.6.4 and a dual-core macbook pro. I'm having a funny time with multicore. When I run it with 2 cores, mclapply, R borks with the following error. The process has forked and you cannot use this CoreFoundation func

[R] reading fixed width format data with 2 types of lines

2010-08-12 Thread Denis Chabot
Hi, I know how to read fixed width format data with read.fwf, but suddenly I need to read in a large number of old fwf files with 2 types of lines. Lines that begin with "3" in first column carry one set of variables, and lines that begin with "4" carry another set, like this: … 3A00206546L070

[R] multicore mclapply error

2010-08-12 Thread Jarrett Byrnes
I'm running r 2. on a mac running 10.6.4 and a dual-core macbook pro. I'm having a funny time with multicore. When I run it with 2 cores, mclapply, R borks with the following error. The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on

Re: [R] Running something without a loop when the result from the previous iteration is require for the current iteration

2010-08-12 Thread Adrienne Wootten
Thanks everyone for your help and advice. For the R-help archives, here is what I ended up doing. First creating a separate function to handle one day at a time - byrow.gen2 <- function(genmat,rownum,use1,use2,num,ortho_obs_used){ prev = rownum-1 ran = runif(length(rownum),0,1) if(genmat[rownum,

Re: [R] help usin scan on large matrix (caveats to what has been discussed before)

2010-08-12 Thread Peter Dalgaard
Martin Tomko wrote: > Hi Peter, > apologies, too fast copying and pasting. > So, here is the explanation: > f<-"C:/test/mytab.txt"; > R<-readLines(con=f); > > where mytab.txt is a table formatted as noted in previous post (space > delimited, with header, rownames, containing integers). > > Now,

Re: [R] R install: documentation

2010-08-12 Thread Duncan Murdoch
On 12/08/2010 12:10 PM, Tim Gruene wrote: Hello, when I ran "R CMD INSTALL circular_0.4.tar.gz" on a machine with Debian stable, the command also created the documentation in various fomrats (latex, html, online). The same command on Debian testing only provides the online documentation. How c

Re: [R] non-linear regression for 3D data

2010-08-12 Thread Duncan Murdoch
On 12/08/2010 10:35 AM, szisziszilvi wrote: I've tried lm, but something is wrong. I've made a test dataset of 599 data points, my original equation is zz = 1 +0.5*xx -3.2*xx*xx -1*yy +4.2*yy*yy but the R gives this result: --- > mp <- read.cs

[R] R install: documentation

2010-08-12 Thread Tim Gruene
Hello, when I ran "R CMD INSTALL circular_0.4.tar.gz" on a machine with Debian stable, the command also created the documentation in various fomrats (latex, html, online). The same command on Debian testing only provides the online documentation. How can I persuade R to create the different form

Re: [R] Regression Error: Otherwise good variable causes singularity. Why?

2010-08-12 Thread asdir
@JLucke: As for the africa variable: I took it out of the model, so that we can exclude this variable itself and collinearity between the africa and the litrate variable as causes for the litrate-problem. This also removed the singularity remark at the top. However, the problem with litrate-varia

Re: [R] Where the data file is stored?

2010-08-12 Thread Barry Rowlingson
On Thu, Aug 12, 2010 at 4:51 PM, Stephen Liu wrote: > Hi Barry, > > > Following 2 commands are useful to me; >> row.names(subset(file.info(list.files(getwd(),full.name=TRUE)),isdir)) > showing directories. > >> row.names(subset(file.info(list.files(getwd(),full.name=TRUE)),!isdir)) > showing files

Re: [R] Where the data file is stored?

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 11:51 AM, Stephen Liu wrote: Hi Barry, Following 2 commands are useful to me; row .names(subset(file.info(list.files(getwd(),full.name=TRUE)),isdir)) showing directories. row.names(subset(file.info(list.files(getwd(),full.name=TRUE)),! isdir)) showing files What is

Re: [R] Median abline how-to ?

2010-08-12 Thread David martin
thanks !!! On 12/08/10 17:49, William Dunlap wrote: segments(x0=ix-w, x1=ix+w, y0=mediansByGroup, col=ix) __ 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/post

[R] XML file from scratch using XML package

2010-08-12 Thread Mark Heckmann
I would like to build an XML file from scratch using the XML package. I would like to save the following vector in it: 1:10 Could someone help me by briefly outlining how I go about it ? And maybe provide a few lines of code? Thanks! Mark ––– Mark Heckmann Di

Re: [R] Where the data file is stored?

2010-08-12 Thread Stephen Liu
Hi Barry, Following 2 commands are useful to me; > row.names(subset(file.info(list.files(getwd(),full.name=TRUE)),isdir)) showing directories. > row.names(subset(file.info(list.files(getwd(),full.name=TRUE)),!isdir)) showing files What is "!" for? TIA B.R. Stephen L - Original Messa

Re: [R] Median abline how-to ?

2010-08-12 Thread William Dunlap
> From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David martin > Sent: Thursday, August 12, 2010 7:42 AM > To: r-h...@stat.math.ethz.ch > Subject: [R] Median abline how-to ? > > Hi, > I'm newbie with R and don't really know how to add a median > line to ea

Re: [R] normality tests

2010-08-12 Thread Bert Gunter
?RsiteSearch or consult package sos. Learn how to use R's search resources! -- Bert Gunter Genentech Nonclinical Statistics On Wed, Aug 11, 2010 at 8:21 PM, Geoffrey Smith wrote: > Hello, does anyone know how to compute the following two normality tests > using R: > > (1) the Kiefer-Salmon (1

Re: [R] Creating vectors

2010-08-12 Thread TGS
I think I understand your question and the following would produce the result you've posted. (x <- matrix(c(1, 2, 2, 3, 1, 2, 1, 2, 3, 4), nrow=5, byrow=TRUE)) On Aug 12, 2010, at 5:41 AM, clips10 wrote: Thanks for the help, I tried to apply this to a vector with two columns, well I suppose i

Re: [R] Where the data file is stored?

2010-08-12 Thread Stephen Liu
> You're not seeing the .Rdata file containing the data objects. Try: > list.files(getwd(),full.name=TRUE, all.files=TRUE) Hi Keith, Thanks for your advice On R console running > list.files(getwd(),full.name=TRUE,all.files=TRUE) The output is similar to running following command on Ubuntu

Re: [R] Regression Error: Otherwise good variable causes singularity. Why?

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 10:35 AM, asdir wrote: This command cdmoutcome<- glm(log(value)~factor(year) +log(gdppcpppconst)+log(gdppcpppconstAII) +log(co2eemisspc)+log(co2eemisspcAII) +log(dist) +fdiboth +odapartnertohost

[R] Median abline how-to ?

2010-08-12 Thread David martin
Hi, I'm newbie with R and don't really know how to add a median line to each of the groups that is not all the plot long. Here is a small working code that i have adapted for my purpose. If somebody could tell me how to draw median lines on each group and not all plot long. ctl <- c(4.17,5

[R] Linear regression on several groups

2010-08-12 Thread JesperHybel
I have a simple dataset of a numerical dependent Y, a numerical independent X and a categorial variable Z with three levels. I want to do linear regression Y~X for each level of Z. How can I do this in a single command that is without using lm() applied three isolated times? -- View this message

Re: [R] non-linear regression for 3D data

2010-08-12 Thread szisziszilvi
right. How does it come that if I devide the result vector with 10*interception, I get a much better result? > zz2 <- 25.86 -2239.86*mp$xx -595.01*mp$xx*mp$xx + 2875.54*mp$yy + > 776.84*mp$yy*mp$yy > mp$zz2 <- zz2 > library(lattice) > cloud(zz2/258.6 + zz ~ xx * yy, data=mp) looks quite pretty.

[R] Error: evaluation nested too deeply

2010-08-12 Thread abotaha
Hi guys, I have a code in R and it was work well but when I decrease the epsilon value (indicated in the code) , then I am getting this error Error: evaluation nested too deeply: infinite recursion / options(expressions=)? any help please y = 6.8; w = 7.4; z = 5.7; muy = 7; muw = 7; muz =

Re: [R] non-linear regression for 3D data

2010-08-12 Thread szisziszilvi
I've tried lm, but something is wrong. I've made a test dataset of 599 data points, my original equation is zz = 1 +0.5*xx -3.2*xx*xx -1*yy +4.2*yy*yy but the R gives this result: --- > mp <- read.csv(file="sample.csv",sep=";",header=TRUE) > lm

Re: [R] Creating vectors

2010-08-12 Thread clips10
Thanks for the help, I tried to apply this to a vector with two columns, well I suppose it is not a vector but for instance like this: [,1] [,2] [1,]1 2 [2,]2 3 [3,]1 2 [4,]1 2 [5,]3 4 and return a vector : 1,2,1,1,3, so that it recognises b

Re: [R] help to polish plot in ggplot2

2010-08-12 Thread Mahbubul Majumder
baptiste, I have two more questions. How can I get the category labels right justified? It seems that I need to change the size of the text too. Since in my real data the text size are big and they appears to be even bigger than my plot area. So, my second question is how can I change the text siz

  1   2   >