Re: [R] Match() on raw objects ?

2010-07-29 Thread bruno Piguet
On Tue, 27 Jul 2010, Prof Brian Ripley wrote : Note that raw values in R are really intended to be passed around and not manipulated: if you do much of the latter, coercing to integer, say, is likely to be much more efficient. Indeed : I tried a minimal benchmark : a -

Re: [R] Sweaving quotes

2010-07-29 Thread Prof Brian Ripley
The alternative is to tell LaTeX what encoding the file is in. For those using UTF-8 locales this means adding the line \usepackage[utf8]{inputenc} Now Murray mentions 'Vista', and so is presumably using cp1252 (the Western-European-language Windows default). That is spported by inputenc,

[R] Spearman's Correlation Coefficient to compare distributions?

2010-07-29 Thread Ralf B
Hi, I have distributions from two different data sets and I would like to measure how similar their distributions (in terms of their bin frequencies) are. In other words, I am not interested in the exact sequence of data points but rather in the their distributional properties and in their

[R] New Open Source Community

2010-07-29 Thread CJN
Equalis just announced it's public beta today http://www.equalis.com http://www.equalis.com . It has forums dedicated to lots of math topics including open source software. It specifically has an R forum and an R user group. Also has forums and groups for Octave, Scilab, and Sage.

[R] precision of minus operation and if statments

2010-07-29 Thread yoni gavish
Hi Everyone, as part of a larger script, I need to insert the result of a simple minus operation into an if statement. I have noticed that the precision that appear on the screen is not the precision in which R stores the result of the minus operation, and that this change alters the

[R] xlsx [path input]

2010-07-29 Thread nero
Good morning , i want to read in a file with the xlsx package... the documentation says, that i could define the desired destination with an absolute path. the argument 'file' in the function-call should be: quote : file-the absolute path to the file which the data are to be read from

[R] Multiple binomial tests on a large table

2010-07-29 Thread Wilson, Andrew
I need to run binomial tests (binom.test) on a large set of data, stored in a table - 600 tests in total. The values of x are stored in a column, as are the values of n. The data for each test are on a separate row. For example: X N 11 19 9 26 13 21 13 27 18 30

Re: [R] precision of minus operation and if statments

2010-07-29 Thread ONKELINX, Thierry
This is FAQ 7.31: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg Gaverstraat

Re: [R] Statistical mailing list

2010-07-29 Thread Liviu Andronic
On Wed, 28 Jul 2010 22:36:08 -0400 Ralf B ralf.bie...@gmail.com wrote: I am looking for a mailing list for general statistical questions that are not R related. Do you have any suggestions for lists that are busy and helpful and/or lists that you use and recommend? Maybe StackExchange [1]?

Re: [R] Adding lines to two graphs alternately

2010-07-29 Thread Jim Lemon
On 07/29/2010 07:02 AM, Dennis Fisher wrote: Colleagues I do a series of calculations, then add some output as a line in a graphic. This is repeated a large number of times. Then, I move to the next panel and do a similar set of calculations, add lines, Many of the calculations are

Re: [R] Displaying Counts of Unused Factors in Contingency Tables with table()

2010-07-29 Thread Dennis Murphy
Hi, table() is behaving as documented with respect to your example. local.labels is a *character* vector with two distinct values and local.preds is a *character* variable with one distinct value. If you were expecting your table to divine that you wanted to include 'ah~' as a missing value in

[R] Different decimal places in a matrix

2010-07-29 Thread Nicola Sturaro Sommacal
Hi! I have a ftable object in which some row contains integers and some other contains a percentage that I would like to show with two digits after the dot. I tried something like ftblP[index,] = as.character(round(ftblP[index, ], 2)) where the index vector contains the number of the rows

Re: [R] Different decimal places in a matrix

2010-07-29 Thread Ted Harding
On 29-Jul-10 09:08:22, Nicola Sturaro Sommacal wrote: Hi! I have a ftable object in which some row contains integers and some other contains a percentage that I would like to show with two digits after the dot. I tried something like ftblP[index,] = as.character(round(ftblP[index,],2))

Re: [R] xlsx [path input]

2010-07-29 Thread Stefan Grosse
Am 29.07.2010 09:24, schrieb nero: But it doesn´t work. It only works, if i put the file into the xlsx-directory and set a dynamic path. a short example: http://r.789695.n4.nabble.com/file/n2306056/example_loading_xls.png But the file is there... Am i missing something? Lukas, You

Re: [R] Multiple binomial tests on a large table

2010-07-29 Thread Dennis Murphy
Hi: Here's one approach (not unique), and dragged out a bit to illustrate its different components. 1. Create a list object, something like l - vector('list', 600) 2. Populate it. There are several ways to do this, but one is to initially create a vector of file names and then populate the

[R] where did the column names go to?

2010-07-29 Thread pdb
I've just tried to merge 2 data sets thinking they would only keep the common columns, but noticed the column count was not adding up. I've then replicated a simple example and got the same thing happening. q1. why doesn't 'b' have a column name? q2. when I merge, why does the new column 'y'

Re: [R] Multiple binomial tests on a large table

2010-07-29 Thread Dennis Murphy
Hi: As it turns out, this is pretty straightforward using plyr's ldply() function. Here's a toy example: d1 - structure(list(X = c(11L, 9L, 13L, 13L, 18L), N = c(19L, 26L, 21L, 27L, 30L)), .Names = c(X, N), class = data.frame, row.names = c(NA, -5L)) w - sample(1:50, 5) d2 - data.frame(X =

Re: [R] where did the column names go to?

2010-07-29 Thread Dennis Murphy
Hi: On Thu, Jul 29, 2010 at 3:28 AM, pdb ph...@philbrierley.com wrote: I've just tried to merge 2 data sets thinking they would only keep the common columns, but noticed the column count was not adding up. I've then replicated a simple example and got the same thing happening. q1. why

[R] how to 'stack' data frames?

2010-07-29 Thread pdb
I have 2 data frames (A B) with some common column names. A has 10 rows. B has 20 rows. How do I combine them so I end up with a data frame with 30 rows that only contains the common columns. I was trying 'merge' (Merge two data frames by common columns .etc. ) but that is not giving me

Re: [R] Reading timestamp column from MySQL

2010-07-29 Thread Allan Engelhardt
On 29/07/10 00:20, harsh yadav wrote: Hi, I am reading a SQL (MySQL) table in R data frame. When I read in the table that has a timestamp data-type field, R gives it the following format:- 1.236887e+12 So when I want to manipulate a column with timestamp = 1236887146615 It returns me

[R] I need the dataset--thank you

2010-07-29 Thread 笑啸
dear: I am a user of R project.And now ,I have a problem. I want to know what is the name of the datasets in the web page--Draw a Nomogram Representing a Regression Fit which come from the R-home(http://www.r-project.org/ Package rms version 3.0-0). And can you supply the dataset to me?

Re: [R] how to 'stack' data frames?

2010-07-29 Thread Dennis Murphy
Hi: Here's a *reproducible* example: a - data.frame(w = rnorm(10), x = rnorm(10), y = rnorm(10), z = rnorm(10)) b - data.frame(w = rnorm(20), x = rnorm(20), x2 = rnorm(20), x3 = rnorm(20)) commonCols - intersect(names(a), names(b)) commonCols [1] w x rbind(a[commonCols], b[commonCols])

Re: [R] Sweaving quotes

2010-07-29 Thread Murray Jorgensen
I am happy enough with options(useFancyQuotes = FALSE) (or = TeX) but I will test Brian's suggestion tomorrow and report back. Murray Prof Brian Ripley wrote: The alternative is to tell LaTeX what encoding the file is in. For those using UTF-8 locales this means adding the line

Re: [R] Function to return variable name

2010-07-29 Thread Allan Engelhardt
On 29/07/10 04:21, Jeremy Miles wrote: I'd like a function that returns the variable name. As in: MyData$Var1 Would return: Var1 Not quite sure what you mean, but does this get you started? nn - function(x) deparse(substitute(x)) str( z - nn(airquality$Month) ) # chr airquality$Month

Re: [R] how to 'stack' data frames?

2010-07-29 Thread Gabor Grothendieck
On Thu, Jul 29, 2010 at 6:53 AM, pdb ph...@philbrierley.com wrote: I have 2 data frames (A B) with some common column names. A has 10 rows. B has 20 rows. How do I combine them so I end up with a data frame with 30 rows that only contains the common columns. I was trying 'merge' (Merge

Re: [R] how to 'stack' data frames?

2010-07-29 Thread pdb
Thanks Dennis - easy when you know how ! -- View this message in context: http://r.789695.n4.nabble.com/how-to-stack-data-frames-tp2306284p2306309.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Replace last element in a vector - elegant solution?

2010-07-29 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I have to replace the last element of a vector with 0, but the length of x is not known at coding time. So I do the following: x - 1:10 x x[length(x)] - 0 x it is working nicely, but I am wondering: is there a more elegant solution( like

Re: [R] ...more values follow?

2010-07-29 Thread Uwe Ligges
See ?options and its argument max.print. Uwe Ligges On 28.07.2010 09:50, nero wrote: Hello! I´m playing arround with rJava... Always when i want to print(list), it only shows me the first values, and then (900534 more values follow)... How can i get shure, that all list-values are printed?

[R] Detecting seasonality

2010-07-29 Thread vikrant
I have a hourly time series and I am interested in finding presence of seasonality in this data. I know one method of finding seasonality using autocorrelation function(ACF). But I dont want to use any graphical technique. I want to know is there any theorotical method using R which can be

[R] newton.method

2010-07-29 Thread sammyny
Hi, Is this method broken in R? I am using it to find roots of the following function: f(x) = 2.5*exp(-0.5*(2*0.045 - x)) + 2.5*exp(-0.045) + 2.5*exp(-1.5*x) - 100 It is giving an answer of -38.4762403 which is not even close (f(x) = 2.903809e+25 for x=-38.4762403). The answer should be around

Re: [R] I need the dataset--thank you

2010-07-29 Thread David Winsemius
On Jul 29, 2010, at 7:00 AM, 笑啸 wrote: dear: I am a user of R project.And now ,I have a problem. I want to know what is the name of the datasets in the web page--Draw a Nomogram Representing a Regression Fit which come from the R-home(http://www.r-project.org/ Package rms version

Re: [R] newton.method

2010-07-29 Thread David Winsemius
On Jul 29, 2010, at 4:32 AM, sammyny wrote: Hi, Is this method broken in R? ?newton.method No documentation for 'newton.method' in specified packages and libraries: you could try '??newton.method' If you are asking about a non-base function, you are asked by the Posting Guide to

Re: [R] message box

2010-07-29 Thread Uwe Ligges
On 28.07.2010 14:00, bruno Piguet wrote: Martin du Saire asked : I need some help figuring out how to make a pop-up message box appear with error messages when running a script using Rterm. Windows XP R2.10.1 Or see ?winDialog Uwe Ligges Have you tried the

Re: [R] newton.method

2010-07-29 Thread Dennis Murphy
Hi: Interesting. Try the following; f is copied and pasted directly from your e-mail: f - function(x) 2.5*exp(-0.5*(2*0.045 - x)) + 2.5*exp(-0.045) + 2.5*exp(-1.5*x) - 100 curve(f, -3, 8) # plot it in a localized region abline(0, 0, lty = 2) There are two places where the function

Re: [R] Replace last element in a vector - elegant solution?

2010-07-29 Thread Henrique Dallazuanna
Another way: x - replace(x, length(x), 0) On Thu, Jul 29, 2010 at 8:12 AM, Rainer M Krug r.m.k...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I have to replace the last element of a vector with 0, but the length of x is not known at coding time. So I do the

Re: [R] does package QuantPsych function lm.beta can handle resultsof a regression with weights?

2010-07-29 Thread Dimitri Liakhovitski
Thanks a lot, Tom! On Mon, Jul 26, 2010 at 9:24 AM, Tom Fletcher tom.fletcher.m...@statefarm.com wrote: The original function was created for a simple example. It never was written to address weighted regression. A quick fix will work for you situation. ### The original is: lm.beta -

[R] Mailing list for download

2010-07-29 Thread Sigbert Klinke
Hi, is it possible to get all the mails of the mailing list / mail archives for download (preferably in XML format)? Thanks Sigbert __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Mailing list for download

2010-07-29 Thread Henrique Dallazuanna
Yes, https://stat.ethz.ch/pipermail/r-help/ On Thu, Jul 29, 2010 at 10:13 AM, Sigbert Klinke sigb...@wiwi.hu-berlin.dewrote: Hi, is it possible to get all the mails of the mailing list / mail archives for download (preferably in XML format)? Thanks Sigbert

Re: [R] Mailing list for download

2010-07-29 Thread Jonathan Baron
This is what I do to make the search database at http://finzi.psych.upenn.edu, which is also used for RSiteSearch. Here is an example: wget -r -np -p --no-check-certificate https://stat.ethz.ch/pipermail/r-help/2009-February/ I do this for each month. But you could probably modify this to do

Re: [R] Help Creating a Stacked Bar Chart with Color Coding

2010-07-29 Thread Wu Gong
It is a little complicate for me to transform the table. Hope it works for you. x - read.table(textConnection(Johnson 4 Smith4 Smith2 Smith3 Garcia 1 Garcia 4 Rodriguez 2 Adams 2 Adams 3 Adams 4 Turner 4 Turner 3

Re: [R] Statistical mailing list

2010-07-29 Thread Tal Galili
This is the new and exiting kid on the block: http://stats.stackexchange.com/ There is also: http://metaoptimize.com/qa For more machine learning type questions. Best, Tal http://stats.stackexchange.com/ Contact Details:---

Re: [R] Replace last element in a vector - elegant solution?

2010-07-29 Thread Wu Gong
Hi, The function head also works. x - 1:10 head(x,-1) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Replace-last-element-in-a-vector-elegant-solution-tp2306315p2306471.html Sent from the R help mailing list archive at Nabble.com.

[R] (no subject)

2010-07-29 Thread Dévaványai Agamemnón
Dear R Users! I have a dataframe with duplicate cases. Var1 duplicated by var2. var1var2

Re: [R] Displaying Counts of Unused Factors in Contingency Tables with table()

2010-07-29 Thread ntyson
Dennis, Thank you for your response. For clarification, I was not expecting table() to divinely figure out the intent that I was making two levels out of one (given my character vectors). Since table() is a generic function that behaves differently with character and factor vectors, I

[R] Residuals of mixed effects model

2010-07-29 Thread will . eagle
Dear all, how do I get the residuals from a lme() output objects which are adjusted for fixed AND (!) random effects? I tried residuals(), but it seems they just give me the residuals adjusted for the fixed effects of the regression model. The model I use is: lme.out -

[R] Odp: (no subject)

2010-07-29 Thread Petr PIKAL
Hi Your data came rather corrupted but probably you can split your data frame according to var1, select highest rank in var2 and reconstruct data frame from the result see split, lapply, Regards Petr r-help-boun...@r-project.org napsal dne 29.07.2010 15:48:26: Dear R Users! I

Re: [R] Displaying Counts of Unused Factors in Contingency Tables with table()

2010-07-29 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.07.2010 16:03:30: Dennis, Thank you for your response. For clarification, I was not expecting table() to divinely figure out the intent that I was making two levels out of one (given my character vectors). Since table() is a generic

[R] Question about geoR package.

2010-07-29 Thread Alaios
Hello in geoR package there is a function called grf() According to the geoR short manual grf() takes the following arguments * n number of points (spatial locations) in each simulations. * grid optional. An n × 2 matrix with coordinates of the simulated data. * nx

[R] Fwd: duplicates

2010-07-29 Thread Dévaványai Agamemnón
-- Eredeti üzenet -- Feladó: Dévaványai Agamemnón lt;devavan...@citromail.hugt;Címzett: r-...@r-project.org, r-...@r-project.orgelküldve: 2010. július 29. 16:29Tárgy : duplicates Sorry! I try it again Dear R Users! I have a dataframe with duplicatecases. Var1 duplicated by

[R] [R-pkgs] heplots 0.9-3 and candisc 0.5-18 released to CRAN

2010-07-29 Thread Michael Friendly
I've just released the latest R-Forge versions of heplots 0.9-3 and candisc 0.5-18 to CRAN. They should appear there within a day or two. == heplots The heplots package provides functions for visualizing hypothesis tests in multivariate linear models (MANOVA, multivariate multiple regression,

[R] duplicates

2010-07-29 Thread Dévaványai Agamemnón
Sorry! I try it again Dear R Users! I have a dataframe with duplicatecases. Var1 duplicated by var2. var1 var2 var3 var4 var5 14 500 12 13 200 25 18 125 19 22 120 252 2622 1

Re: [R] Fwd: duplicates

2010-07-29 Thread ONKELINX, Thierry
Does this works? (Untested) library(plyr) ddply(your_dataframe, var1, function(x){ x[which.max(x$var2), ] }) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg

Re: [R] newton.method

2010-07-29 Thread Ravi Varadhan
Yes, there are two roots. Try this to get the 2 roots: require(BB) p0.mat - matrix(rnorm(10), 10, 1) # 10 random starting values ans - multiStart(par=p0, fn=f) ans$par You can see that the 2 roots are -2.438285 and 7.419378. Hope this helps, Ravi.

Re: [R] New Open Source Community

2010-07-29 Thread Tal Galili
You mean along with: http://stats.stackexchange.com/ and http://stats.stackexchange.com/http://metaoptimize.com/qa/ We have passed the online-over-proliferation stage for out topic of interest... :) Tal Contact Details:---

Re: [R] Meaning of proc.time()

2010-07-29 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Christofer Bogaso Sent: Thursday, July 29, 2010 7:51 AM To: jim holtman Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] Meaning of proc.time() Ok, but what are user CPU and

[R] how to get higher derivatives with deriv

2010-07-29 Thread Marius Hofert
Dear ExpeRts, I have trouble implementing a function which computes the k-th derivative of a specified function f and returns it as a function. I tried to adapt what I found under ?deriv but could not get it to work. Here is how it should look like: ## specify the function f - function

[R] Fry Plots

2010-07-29 Thread cassandra browne
Does anyone know how to do a fry plot in R? I have 600-800 points per image, and I really don't want to attempt that manually. Thank you! Cassie [[alternative HTML version deleted]] __

[R] How to run this video link

2010-07-29 Thread Velappan Periasamy
Pls tell me how to run this video in R http://nptel.iitm.ac.in/video.php?courseId=1083p=4 __ 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

Re: [R] Fwd: duplicates

2010-07-29 Thread Wu Gong
Hi, Please try ?rle t.x - x[order(x[,1],x[,2]),] t.x[cumsum(rle(t.x[,1])$lengths),] - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Fwd-duplicates-tp2306555p2306617.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] read.delim()

2010-07-29 Thread Ben Bolker
Doran, Harold HDoran at air.org writes: Thank you, Phil. Unfortunately, there are quotes used properly elsewhere. - Original Message - From: Phil Spector spector at stat.berkeley.edu To: Doran, Harold Cc: r-help at r-project.org r-help at r-project.org Sent: Wed Jul 28 18:29:32

[R] locator function and connecting segment

2010-07-29 Thread Erin Hodgess
Dear R People: I'm using the locator() function on a chart and I select two values. Is there a way already in place to connect the two values with a line segment, please? Just thought I'd check before I started coding. Thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor

[R] 3d data plot

2010-07-29 Thread szisziszilvi
Hello! I'm a newbe, and a bit confused amongst the data types and functions... The problem to be solved is the following: We have measurements. They are in a csv file, in 3 columns. So this would be an x-y-z plot, where z is the measurement at (x,y) conditions. Just a simple plot, nothing

[R] Crash report: projection pursuit predict

2010-07-29 Thread Horace Tso
Folks, The projection pursuit regression function in the base R seems to crash when the optimization level is set to zero, i.e. the initial ridge terms are accepted without refitting. I encountered this problem in an out-of-sample prediction exercise using predict. But further investigation

[R] Help on installation of R Packages

2010-07-29 Thread Raghu
Hi I tried installing the packages with: *install.packages(quantstrat, repos=http://R-Forge.R-project.org;) * *install.packages(blotter, repos=http://R-Forge.R-project.org;) **install.packages(FinancialInstrument, repos= http://R-Forge.R-project.org;)* But non of these packages is getting

Re: [R] Crash report: projection pursuit amp; predict

2010-07-29 Thread Ben Bolker
Horace Tso Horace.Tso at pgn.com writes: I'm using 2.11.1 under the 32-bit Windows XP. I've also tested the codes under a 64-bit Ubuntu and the same problem occurred. By the way, right before Rgui shuts down, the \ pop-up window suggests it's a runtime error in C++. Here are the codes

Re: [R] Help on installation of R Packages

2010-07-29 Thread Uwe Ligges
On 29.07.2010 15:34, Raghu wrote: Hi I tried installing the packages with: *install.packages(quantstrat, repos=http://R-Forge.R-project.org;) * *install.packages(blotter, repos=http://R-Forge.R-project.org;) **install.packages(FinancialInstrument, repos= http://R-Forge.R-project.org;)* But

Re: [R] Fry Plots

2010-07-29 Thread Ben Bolker
cassandra browne cassandra-browne at hotmail.com writes: Does anyone know how to do a fry plot in R? I have 600-800 points per image, and I really don't want to attempt that manually. Thank you! Cassie library(sos) ## you'll have to install this first findFn(fry plot)

[R] Reset R environment through R command

2010-07-29 Thread Ralf B
Is it possible to remove all variables in the current environment through a R command. Here is what I want: x - 5 y 10:20 reset() print(x) print(y) Output should be NULL for x and y, and not 5 and 10:20. Can one do that in R? Best, Ralf __

Re: [R] Reset R environment through R command

2010-07-29 Thread Ralf B
With environment I actually meant workspace. On Thu, Jul 29, 2010 at 1:22 PM, Ralf B ralf.bie...@gmail.com wrote: Is it possible to remove all variables in the current environment through a R command. Here is what I want: x - 5 y 10:20 reset() print(x) print(y) Output should be NULL

Re: [R] 3d data plot

2010-07-29 Thread Sarah Goslee
You don't really give a lot of information about exactly what you want. Some time spent browsing the R Graph Gallery at http://addictedtor.free.fr/graphiques/ might be helpful. Each plot has associated the code necessary to reproduce it. Especially look at the lattice and scatterplot3d sections.

Re: [R] Reset R environment through R command

2010-07-29 Thread Henrique Dallazuanna
rm(list = ls(all = TRUE)) On Thu, Jul 29, 2010 at 2:26 PM, Ralf B ralf.bie...@gmail.com wrote: With environment I actually meant workspace. On Thu, Jul 29, 2010 at 1:22 PM, Ralf B ralf.bie...@gmail.com wrote: Is it possible to remove all variables in the current environment through a R

[R] Installing a newer version of a package - problems

2010-07-29 Thread Raghu
Hi I am trying to install the latest version of the package quantstrat but I get the following error: install.packages(quantstrat, repos=http://R-Forge.R-project.org;) Warning in install.packages(quantstrat, repos = http://R-Forge.R-project.org;) : argument 'lib' is missing: using

[R] reading dates in Excel into R

2010-07-29 Thread Hongying Li
I am reading dates in Excel2007 into R. Here are the functions I used: library(RODBC) channel-odbcConnectExcel2007(myfile.xlsx) tmp-sqlFetch(channel,1,as.is=T) The dates in myfile.xlsx are all in this format: mm/dd/. But when I read it to R, some columns look like -mm-dd 00:00:00,

Re: [R] Reset R environment through R command

2010-07-29 Thread Stefan Grosse
Am Donnerstag, den 29.07.2010, 13:22 -0400 schrieb Ralf B: Is it possible to remove all variables in the current environment through a R command. Can one do that in R? see ?rm __ R-help@r-project.org mailing list

Re: [R] R and WinBUGS (via R2WinBUGS) error

2010-07-29 Thread Uwe Ligges
Since this requert seems to be unanswered so far: On 19.07.2010 23:34, YL Grize wrote: Hi I have got the same error than you Who? This is a mailing list with thousands of readers ... had, calling BUGS from R with the bugs() function: / Error in FUN(X[[1L]], ...) : //.C(..): 'type'

[R] Colour points in plot according to third variable

2010-07-29 Thread Anna Berthinussen
Hi, I am using the plot function to make a simple plot of my data with one variable against another and want to colour the data points according to a third variable. The third variable is continuous (Time) and I want to try two different ways of colouring the data points, either: Divide

Re: [R] Colour points in plot according to third variable

2010-07-29 Thread Henrique Dallazuanna
Try this: library(RColorBrewer) plot(iris$Sepal.Length, col = as.character(cut(iris$Sepal.Length, c(4,6,7,8), labels = brewer.pal(3, 'Blues' On Thu, Jul 29, 2010 at 2:51 PM, Anna Berthinussen bs0...@leeds.ac.ukwrote: Hi, I am using the plot function to make a simple plot of my

Re: [R] Installing a newer version of a package - problems

2010-07-29 Thread Duncan Murdoch
On 29/07/2010 8:43 AM, Raghu wrote: Hi I am trying to install the latest version of the package quantstrat but I get the following error: install.packages(quantstrat, repos=http://R-Forge.R-project.org;) Warning in install.packages(quantstrat, repos = http://R-Forge.R-project.org;) :

Re: [R] newton.method

2010-07-29 Thread sammyny
newton.method is in package 'animation'. Thanks Ravi. BBSolve/BBOptim seems to work very well although I am not familiar with the optimization methods being used there. Is there a way to specify a tolerance in the function to get the required precision. I did something like this to use newton

[R] adding new devices and plots

2010-07-29 Thread Erin Hodgess
Dear R People: I have the following function: eplot function (x) { plot(x) z - locator(2) dev.new() plot(window(x, start = min(z$x), end = max(z$x))) } I want to generate a new plot from a subset of the original, but I want to keep the original plot up. When I use this, it

[R] KLdiv question

2010-07-29 Thread Ralf B
I am having a data set that causes flexmix::KLdiv to produce NA as a result and I was told that increasing the sensitivity of the 'esp' value can be used to avoid a lot of values being set to a default (which presumably causes the problem). Now here my question. When running KLdiv on a normal

Re: [R] Fry Plots

2010-07-29 Thread bbolker
[cc'ing back to r-help] At this point it sounds like you may need to poke around some more on your own -- I'm guessing you're not familiar with R. Reading through the various documentation on these packages (try help(package=...) to see if there is a vignette too) and/or the Introduction to

[R] looking for setdiff equivalent on dataset

2010-07-29 Thread BaKaLeGuM
Hi everybody ! little question. I have 2 dataset TheLittleOne-data.frame(cbind(c(2,3),c(2,3))) TheBigOne-data.frame(cbind(c(1,1,2),c(1,1,2))) And I would like to obtain the TheBigOne - TheLittleOne (the row in TheBigOne not in TheLittleOne The result should be: cbind(c(1,1),c(1,1)) Have you

Re: [R] package xpose4 in Vista - Update

2010-07-29 Thread Uwe Ligges
The binary package you downloaded is a binary for R 2.11.x. Since it is a package bndle, it cannot work on R-2.11.x anymore: Package bundles are no longer supported. Best, Uwe Ligges On 29.07.2010 02:11, Santosh wrote: Dear R experts, There seems to be a problem (please see the error

Re: [R] Different decimal places in a matrix

2010-07-29 Thread Ted Harding
On 29-Jul-10 09:25:37, Ted Harding wrote: On 29-Jul-10 09:08:22, Nicola Sturaro Sommacal wrote: Hi! I have a ftable object in which some row contains integers and some other contains a percentage that I would like to show with two digits after the dot. I tried something like ftblP[index,]

Re: [R] looking for setdiff equivalent on dataset

2010-07-29 Thread Hadley Wickham
Here's one way, using a function from the plyr package: TheLittleOne-data.frame(cbind(c(2,3),c(2,3))) TheBigOne-data.frame(cbind(c(1,1,2),c(1,1,2))) keys - plyr:::join.keys(TheBigOne, TheLittleOne) !(keys$x %in% keys$y) TheBigOne[!(keys$x %in% keys$y), ] Hadley On Thu, Jul 29, 2010 at 1:38

Re: [R] looking for setdiff equivalent on dataset

2010-07-29 Thread Bert Gunter
Well, here's one way that might work (explanation below): The ideas is to turn each row into a character vector and then work with the two character vectors. bigs - do.call(paste,TheBigOne) ix - which(bigs %in% setdiff(bigs,do.call(paste,TheLittleOne))) TheBigOne[ix,] However, this may not

Re: [R] looking for setdiff equivalent on dataset

2010-07-29 Thread BaKaLeGuM
perfect ! thx ( I found prob::setdiff too.. but not really what i want) 2010/7/29 Hadley Wickham had...@rice.edu Here's one way, using a function from the plyr package: TheLittleOne-data.frame(cbind(c(2,3),c(2,3))) TheBigOne-data.frame(cbind(c(1,1,2),c(1,1,2))) keys -

Re: [R] Residuals of mixed effects model

2010-07-29 Thread ONKELINX, Thierry
Dear Will, residuals() should take both the fixed and random effects into account. Can you give us a reproducible example if you get something different? Use residuals(model, type = normalized) if you also want to account for the correlation structure. What do you want to do with the residuals?

Re: [R] newton.method

2010-07-29 Thread Berend Hasselman
sammyny wrote: If someone could point me a correct working version of newton method for finding roots and its usage, that would be helpful. You mentioned in your original post that you had no idea how to use nleqslv. nleqslv provides a Broyden and Newton method with several different

[R] Odp: Fwd: duplicates

2010-07-29 Thread Petr PIKAL
Hi rather complicated one liner assuming your data frame has name test do.call(rbind,lapply(split(test,test$var1), function(x) x[which.max(x[,var2]),])) Here it is in 3 lines test.s - split(test,test$var1) # splits data frame result - lapply(test.s, function(x) x[which.max(x[,var2]),]) #

[R] multiple graphics windows open

2010-07-29 Thread Erin Hodgess
Dear R People: Now I have a function with 3 graphics windows. I'd like for them all to be visible. However, the first window goes blank. Here is the basic setup. The first plot is the entire series. The user selects two points, which in turns generates a subset plot and an EWMA subset plot.

Re: [R] newton.method

2010-07-29 Thread Yihui Xie
The function newton.method() in the package 'animation' is merely for demonstration purpose instead of serious computation -- it illustrates how Newton's method works step by step. But I'm unable to reproduce your bogus results: library(animation) par(pch = 20) ani.options(nmax = 50, interval =

Re: [R] Meaning of proc.time()

2010-07-29 Thread Christofer Bogaso
Ok, but what are user CPU and system CPU? If I know corrrectly, I only have a single CPU in my system. It is not a multi-corer system. Should I read that, system CPU time is the time that my CPU took for actual calculation, and the user CPU time is the time that my CPU took to analyze my code that

Re: [R] Detecting seasonality

2010-07-29 Thread Jannis
Your question is really vague and it is hard to guess what you are after. And the possible answer is that a huge variety of methods exist, all designed for specific questions (that you did not specify). How about fourier transform? ?fft() Or SSA? library(simssalabim) Or the Hewitt test?

Re: [R] Colour points in plot according to third variable

2010-07-29 Thread Jannis
check out the Plotrix package and the color.scale() or similar functions. Henrique Dallazuanna schrieb: Try this: library(RColorBrewer) plot(iris$Sepal.Length, col = as.character(cut(iris$Sepal.Length, c(4,6,7,8), labels = brewer.pal(3, 'Blues' On Thu, Jul 29, 2010 at 2:51 PM, Anna

Re: [R] Beginner stucked with raster + geoR package.

2010-07-29 Thread Alaios
I would like to thank you for your kindness to help me. But I am not sure if temp - grf(ncell(r), cov.pars=c(1, .25)) is correct as this will create around 64.000 locations (not sure what the parameter location is in grf package). Unfortunately it seems that I have a more serious problem when

Re: [R] duplicates

2010-07-29 Thread Jannis
There is most probably a function doing exactly this, but i would give this solution a try: dataframe=dataframe[order(dataframe[,1],-dataframe[,2]),] kept.rows-which(diff(dataframe[,1])+1 new.dataframe - dataframe[kept.rows,] Dévaványai Agamemnón schrieb: Sorry! I try it again Dear R

Re: [R] locator function and connecting segment

2010-07-29 Thread Greg Snow
Do you mean like: plot(1:10) locator(2, type='l') -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Erin

Re: [R] adding new devices and plots

2010-07-29 Thread Greg Snow
It is possible that the plot function starts to plot before the new device is fully in place, you could try sleeping for a second or 2 between the call to dev.new and the call to plot. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org

  1   2   >