Re: [R] Gradients in bar charts XXXX

2012-04-10 Thread Jim Lemon
On 04/10/2012 04:40 AM, Jason Rodriguez wrote: Hello, I have a graphics-related question: I was wondering if anyone knows of a way to create a bar chart that is colored with a three-part gradient that changes at fixed y-values. Each bar needs to fade green-to-yellow at Y=.10 and from

Re: [R] Creating Better Table in R

2012-04-10 Thread Jim Lemon
On 04/09/2012 06:55 PM, bobo wrote: Could anyone please direct me on how to make a nicer table in R? THANKS FOR ALL THE HELP! I would like to make a table with the following in it: estimate, t value, significance, beta, standard errors, adjusted r squared, and residual standard error (3 decimal

Re: [R] How to get the SS and MS from oneway.test?

2012-04-10 Thread lulumecindy
OK! Thank you for your generous help. I'll try to change the code by myself. -- View this message in context: http://r.789695.n4.nabble.com/How-to-get-the-SS-and-MS-from-oneway-test-tp4544417p4544741.html Sent from the R help mailing list archive at Nabble.com.

[R] Assign value to new variable based on conditions on other variables

2012-04-10 Thread aajit75
Hi Experts, This may be simple question, I want to create new variable seg and assign values to it based on some conditions satisfied by each observation. Here is the example: ##Below are the conditions ##if variable x2 gt 0 and x3 gt 200 then seg should take value 1, ##if variable x2 gt 100

Re: [R] Assign value to new variable based on conditions on other variables

2012-04-10 Thread aajit75
I have got solution using within function as below dd$Seg - 1 dd - within(dd, Seg[x2 0 x3 200] - 1) dd - within(dd, Seg[x2 100 x3 300] - 2) dd - within(dd, Seg[x2 200 x3 400] - 3) dd - within(dd, Seg[x2 300 x3 500] - 4) I sthere any better way of doing it!! -- View this message in

Re: [R] Building R on Solaris (OpenIndiana) with gcc 4.6.2 for amd64 target - relocation problems solved

2012-04-10 Thread Prof Brian Ripley
This was really a topic for R-devel rather than R-help. It depends on the fine details of your build of gcc. R's configure sets SHLIB_LDFLAGS=-shared for the GNU linker and SHLIB_LDFLAGS=-G for the Solaris linker. That used to work on Opteron and still does on Sparc. If the setting is

Re: [R] Assign value to new variable based on conditions on other variables

2012-04-10 Thread Berend Hasselman
On 10-04-2012, at 08:44, aajit75 wrote: Hi Experts, This may be simple question, I want to create new variable seg and assign values to it based on some conditions satisfied by each observation. Here is the example: ##Below are the conditions ##if variable x2 gt 0 and x3 gt 200 then

[R] compare two matrices

2012-04-10 Thread Kehl Dániel
Dear Members, I have two estimated transition matrices and I want to compare them. In fact I want to check the hypothesis if they come from the same process. I tried to look for some test but all I found was independence test of contingency tables. The following code shows that the usual

[R] How to display result of a calculation within panel

2012-04-10 Thread Subramanian S
How do i make rpanel print the value of a calculation in the rpanel itself - in a space just below the submit button? The calculation uses user inputs (using rp.textentry) and takes the values entered as input to the function via function (myRpanel) e.g. myfunction - function(myRpanel){ z-

Re: [R] Help Using Spreadsheets

2012-04-10 Thread Petr PIKAL
Hi You might want to re-read the Intro to R and the section on dataframes. Your spreadsheet is read into R as a dataframe which is very similar to an Excel spreadsheet. Exactly what problem are you having with it? Is it trying to access the data? 2012/4/6 Pedro Henrique

[R] how to plot 2d matrix as coloured squares?

2012-04-10 Thread Jonas Stein
i have a matrix like x1 x2 x3 y1 2 34 5656 y2 34 434 342 y3 234 43 34 i want to plot these values like here http://www.almob.org/content/2/1/12/figure/F5?highres=y The rainbow function could calculate a colour for each value. But how van i generate the square pattern? Kind

Re: [R] how to plot 2d matrix as coloured squares?

2012-04-10 Thread Jim Lemon
On 04/08/2012 02:11 AM, Jonas Stein wrote: i have a matrix like x1 x2 x3 y1 2 34 5656 y2 34 434 342 y3 234 43 34 i want to plot these values like here http://www.almob.org/content/2/1/12/figure/F5?highres=y The rainbow function could calculate a colour for each value. But how

[R] Odp: how to plot 2d matrix as coloured squares?

2012-04-10 Thread Petr PIKAL
Hi i have a matrix like x1 x2 x3 y1 2 34 5656 y2 34 434 342 y3 234 43 34 i want to plot these values like here http://www.almob.org/content/2/1/12/figure/F5?highres=y The rainbow function could calculate a colour for each value. But how van i generate the square

[R] Double precision calculation

2012-04-10 Thread Christofer Bogaso
Dear all, Does R use double precision for calculation as default? If not, how to enforce double precision calculation in R for my current calculation session? I Use R-2.14.0 with windows XP. Thanks, __ R-help@r-project.org mailing list

[R] Re : Double precision calculation

2012-04-10 Thread Pascal Oettli
Hi, I think that any web search engine is your friend:   http://rwiki.sciviews.org/doku.php?id=misc:r_accuracy Regards, Pascal De : Christofer Bogaso bogaso.christo...@gmail.com À : r-help@r-project.org Envoyé le : Mardi 10 avril 2012 18h18 Objet : [R]

[R] marginal HR in coxph() model with interaction

2012-04-10 Thread Reinhard Seifert
Dear community, I have a question regarding the standard error of marginal hazard ratio estimates from a cox proportional hazard model with an interaction term. I have to dichotomous variables ADMA and ALA (both low/high) where I have divided the continuous variables at a certain level. I am

[R] How to remove $ (Dollar sign) from string

2012-04-10 Thread Nevil Amos
How do I remove a $ character from a string sub() and gsub() with $ or \$ as pattern do not work. sub($,,ABC$DEF) [1] ABC$DEF sub(\$,,ABC$DEF) Error: '\$' is an unrecognized escape in character string starting \$ sub(\$,,ABC$DEF) Error: unexpected input in sub(\ Thanks -- Nevil Amos Molecular

[R] how to save multiple work space

2012-04-10 Thread ya
Hi guys, I have a question. I am running 3 R sessions simultaneously for different analysis. I found out that when R quit, only objects in one of these sessions was saved in the work space. How can I save objects of all 3 R sessions? Thank you very much. YA

Re: [R] How to remove $ (Dollar sign) from string

2012-04-10 Thread John Fox
Dear Nevil, You have the escape the backslash: sub(\\$, , ABC$DEF) [1] ABCDEF I hope this helps, John John Fox Sen. William McMaster Prof. of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada

Re: [R] How to remove $ (Dollar sign) from string

2012-04-10 Thread Ted Harding
On 10-Apr-2012 11:34:13 Nevil Amos wrote: How do I remove a $ character from a string sub() and gsub() with $ or \$ as pattern do not work. sub($,,ABC$DEF) [1] ABC$DEF sub(\$,,ABC$DEF) Error: '\$' is an unrecognized escape in character string starting \$ sub(\$,,ABC$DEF) Error: unexpected

Re: [R] How to remove $ (Dollar sign) from string

2012-04-10 Thread Ivan Calandra
Hi, Try with a double back slash: sub(\\$,,ABC$DEF) HTH, Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33(0)3.80.39.63.06 ivan.calan...@u-bourgogne.fr http://biogeosciences.u-bourgogne.fr/calandra Le 10/04/12 13:34,

Re: [R] how to save multiple work space

2012-04-10 Thread R. Michael Weylandt michael.weyla...@gmail.com
You'll need to save them manually to avoid name conflicts -- save.image() is the function to do so but you need to give a file name. Michael On Apr 10, 2012, at 7:41 AM, ya xinxi...@163.com wrote: Hi guys, I have a question. I am running 3 R sessions simultaneously for different

Re: [R] how to save multiple work space

2012-04-10 Thread R. Michael Weylandt
Best I understand it yes: I'm not sure if there's an easy way to combine sessions beyond loading them all into a single session and then saving that. Michael On Tue, Apr 10, 2012 at 8:01 AM, ya xinxi...@163.com wrote: so, objects in 3 different sessions would be saved separately into 3

Re: [R] how to save multiple work space

2012-04-10 Thread Petr PIKAL
Hi You'll need to save them manually to avoid name conflicts -- save.image() is the function to do so but you need to give a file name. Or it is necessary have separate folder for each R session. Regards Petr Michael On Apr 10, 2012, at 7:41 AM, ya xinxi...@163.com wrote: Hi

[R] Package boot, funtion cv.glm

2012-04-10 Thread Motte
Hey all, I need some help with a cross validation. I'm new with R and as well with statistics. I had a group work to create a tool for remote sensing class that extracts the best bands of hyperspectral satellite images that describe vegetation. Its a regression between a linear function of using

[R] “Within is working or not in loop”

2012-04-10 Thread Bharat Warule
“Within is working or not in loop” for(j in 1:10){ card_bal - as.numeric(segment_cuts$card_bal[[j]]) insurance_bal - as.numeric(segment_cuts$insurance_bal[[j]]) data$segment_rank - within(data,segment_rank[ data$Total_Balance = total_bal data$Insurance_Balance = insurance_bal] -

Re: [R] Word Count

2012-04-10 Thread Rui Barradas
Hello, vioravis wrote I have a sentence like the following: sentence - Part 1 is working, Part 2 is not working and Part 3 is working I would like th get the total count of working and not working as Working = 2 and Not Working = 1. Can someone help with how can this be done in

[R] Word Count

2012-04-10 Thread vioravis
I have a sentence like the following: sentence - Part 1 is working, Part 2 is not working and Part 3 is working I would like th get the total count of working and not working as Working = 2 and Not Working = 1. Can someone help with how can this be done in R??? Thank you. Ravi -- View this

Re: [R] How to remove $ (Dollar sign) from string

2012-04-10 Thread Gabor Grothendieck
On Tue, Apr 10, 2012 at 7:34 AM, Nevil Amos nevil.a...@monash.edu wrote: How do I remove a $ character from a string sub() and gsub() with $ or \$ as pattern do not work. sub($,,ABC$DEF) [1] ABC$DEF sub(\$,,ABC$DEF) Error: '\$' is an unrecognized escape in character string starting \$

Re: [R] Assign value to new variable based on conditions on other variables

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 3:16 AM, aajit75 wrote: I have got solution using within function as below dd$Seg - 1 dd - within(dd, Seg[x2 0 x3 200] - 1) In this instance the first of your assignments appears superfluous. dd - within(dd, Seg[x2 100 x3 300] - 2) dd - within(dd, Seg[x2 200 x3 400]

Re: [R] Assign value to new variable based on conditions on other variables

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 8:59 AM, David Winsemius wrote: On Apr 10, 2012, at 3:16 AM, aajit75 wrote: I have got solution using within function as below dd$Seg - 1 dd - within(dd, Seg[x2 0 x3 200] - 1) In this instance the first of your assignments appears superfluous. dd - within(dd,

[R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread ottorino
Deae R helpers, the problem I'm facing today is related to the manipulation of a string. The string is coming from a a porosimeter, whose control is under a complicate set-up of two computers One (running on DOS) is controlling directly the hardware, while the other (running on win XP) which

[R] X11 display problem

2012-04-10 Thread carol white
Hi, I run R on a unix server and login from a Mac with ssh -X. When I want to run a graphics function like hist, I get the following x11 message: Error in X11(d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype,   :    unable to start device X11cairo In addition: Warning message: In

Re: [R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 9:44 AM, ottorino wrote: Deae R helpers, the problem I'm facing today is related to the manipulation of a string. The string is coming from a a porosimeter, whose control is under a complicate set-up of two computers One (running on DOS) is controlling directly the

[R] plotting multiple plot in same graph

2012-04-10 Thread arunkumar1111
Hi I have four sets of datas x1, x2, x3,y I want to sactter plot between (x1,y) and line chart between (x2 ,y) and (x3,y) all these should come in a single graph Can anyone help - Thanks in Advance Arun -- View this message in context:

[R] taylor.diagram from plotrix package

2012-04-10 Thread anaraster
Is there a way to access the numeric results (standard deviation and correlation) obtained with the taylor.diagram ? -- View this message in context: http://r.789695.n4.nabble.com/taylor-diagram-from-plotrix-package-tp4545669p4545669.html Sent from the R help mailing list archive at Nabble.com.

[R] R2.11.1 seq.int difference between by and length.out

2012-04-10 Thread Alexander
I am working under R2.11.1 Windows and I was wondering why there is a difference between seq.int(0,1,by=0.1)[4]-0.3 seq.int(0,1,length.out=11)[4]-0.3 there is also the fact that seq(0,1,by=0.1)[4]-0.3 seq(0,1,length.out=11)[4]-0.3 but I think this can be explained by floating precision...

Re: [R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread ottorino
Il giorno mar, 10/04/2012 alle 09.54 -0400, David Winsemius ha scritto: Perhaps, modulo encoding issues I'm not expert in, one more backslash than you tried: gsub( \\\xb2 , 2, (MPa)\t(mm3)\t(nM)\t(mm3/g)\t(mm3/g)\t(%)\t(m \xb2/g)\t) [1]

Re: [R] plotting multiple plot in same graph

2012-04-10 Thread Jessica Streicher
Hello Arunkamar! Basically: plot(x1,y) lines(x2,y) lines(x3,y) You might need to adjust the first plot so all data is shown. For that you could use something like plot(c(min(x),max(x)) , c(min(y),max(y)),type=n) x is all data from x1,x2,x3. type=n says that these points won't be shown in the

[R] Scatterplot matrix with partly transformed axis

2012-04-10 Thread Johannes Radinger
Hi, I am wondering if anybody has experience with scatterplot matrices where some (but NOT all) axis are transformed and the labels are nicely plotted. So far I looked into 1) pairs() 2) scatterplotMatrix() from package 'car' 3) splom() from packagae 'lattice' 4) plotmatrix() from 'ggplot2' I

[R] Rotating margin text

2012-04-10 Thread Dennis Fisher
R 2.14.1 OS X Colleagues, I am making a graphic with two y-axes. I create the label for the right-side axis with: mtext(side=4, line=1, Some text) The label is rotated 90° counterclockwise. I would prefer that it be rotated 90° clockwise. However, srt is not supported for mtext and

Re: [R] R2.11.1 seq.int difference between by and length.out

2012-04-10 Thread Berend Hasselman
On 10-04-2012, at 15:54, Alexander wrote: I am working under R2.11.1 Windows and I was wondering why there is a difference between seq.int(0,1,by=0.1)[4]-0.3 seq.int(0,1,length.out=11)[4]-0.3 there is also the fact that seq(0,1,by=0.1)[4]-0.3 seq(0,1,length.out=11)[4]-0.3 but I

Re: [R] Rotating margin text

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 10:21 AM, Dennis Fisher wrote: R 2.14.1 OS X Colleagues, I am making a graphic with two y-axes. I create the label for the right-side axis with: mtext(side=4, line=1, Some text) The label is rotated 90° counterclockwise. I would prefer that it be rotated

[R] plyr: set '.progress' argument to default to text

2012-04-10 Thread Liviu Andronic
Dear all Is it possible to set globally the option .progress = text to all the apply functions in 'plyr'. For example, current default is daply(..., .progress = none). I would like to set it to daply(..., .progress = text), so as to avoid writing the argument every time I call such a function. I

[R] clock24.plot

2012-04-10 Thread Nick Fankhauser
I've got the strange problem with clock24.plot that only the first data point (phase = 23.38, size = 0.44) from the phases/sizes numeric vectors is plotted. Does anyone have an idea why this could be? library(plotrix) phases - c(23.38, 22.29, 22.71) sizes - c(0.44, 0.30, 0.30)

Re: [R] plotting multiple plot in same graph

2012-04-10 Thread R. Michael Weylandt
A slightly easier formulation of the second proposal from Jessica: plot(c(0,0) , xlim = range(x1, x2, x3), ylim = range(y), type = n) will set the canvas correctly. On Tue, Apr 10, 2012 at 10:10 AM, Jessica Streicher j.streic...@micromata.de wrote: Hello Arunkamar! Basically: plot(x1,y)

[R] Creating a loop with an indefinite end term

2012-04-10 Thread Steve Lavrenz
Everyone, I'm very new to R, especially when it comes to loops and functions, so please bear with me if this is an elementary question. I cannot seem to figure out how to construct a loop which runs a function until a certain value is computed. For example, say I have the following: num =

[R] lm()

2012-04-10 Thread Mariam
People, help me please! How to use lm() function to defind a cofficient for 7-polinom, and what expression should I put in /formula/ -- View this message in context: http://r.789695.n4.nabble.com/lm-tp4545740p4545740.html Sent from the R help mailing list archive at Nabble.com.

[R] [R-pkgs] new version of QCA

2012-04-10 Thread Adrian Dusa
Dear All, I have just uploaded a new version of the QCA (Qualitative Comparative Analysis) on CRAN, and it will be propagated in a couple of days. This is version 1.0-0 (Easter edition) of the package, straight from the previous version 0.6-5, and it represent a major re-write of the package in

[R] cbind, data.frame | numeric to string?

2012-04-10 Thread Anser Chen
Complete newbie to R -- struggling with something which should be pretty basic. Trying to create a simple data set (which I gather R refers to as a data.frame). So a - c(1,2,3,4,5); b - c(0.3,0.4,0.5,0,6,0.7); Stick the two together into a data frame (call test) using cbind test -

[R] [R-pkgs] rockchalk_1.5.4 posted

2012-04-10 Thread Paul Johnson
Greetings: rockchalk is a collection of functions to facilitate presentation of regression models. It includes some functions that I have been circulating for quite some time (such as outreg) as well as several others. The main aim is to allow people who do not understand very much R to survive

Re: [R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread Rui Barradas
Hello, To use the octal code works with me. # I've created a file with that byte only. x - readLines(ascii0178) y - c(as.character(1:4), x, as.character(6:10)) y grep(\262, y) # should return 5 gsub(\262, HERE, y) Hope this helps, Rui Barradas -- View this message in context:

[R] Error: cannot allocate vector of size...

2012-04-10 Thread Frederico Mestre
Hello: While running R doing the analysis of my data I (using packages such as BIOMOD or e1071) get the following error as a result of several of my analysis: Error: cannot allocate vector of size 998.5 Mb In addition: Warning messages: 1: In array(c(rep.int(c(1, numeric(n)), n - 1L),

Re: [R] reclaiming lost memory in R

2012-04-10 Thread Drew Tyre
A few days ago I responded to Ramiro with a suggestion that turns out to be incorrect. Ramiro I think the problem is the loop - R doesn't release memory allocated inside an expression until the expression completes. A for loop is an expression, so it duplicates fit and dataset on every

Re: [R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread Rui Barradas
P.S. : \xb2 works but must be used with perl = TRUE. # 'y' defined as above. grep(\xb2, y, perl = TRUE) gsub(\xb2, HERE, y, perl = TRUE) Rui Barradas -- View this message in context:

Re: [R] R2.11.1 seq.int difference between by and length.out

2012-04-10 Thread Alexander
Berend Hasselman wrote On 10-04-2012, at 15:54, Alexander wrote: I am working under R2.11.1 Windows and I was wondering why there is a difference between seq.int(0,1,by=0.1)[4]-0.3 seq.int(0,1,length.out=11)[4]-0.3 there is also the fact that seq(0,1,by=0.1)[4]-0.3

Re: [R] plyr: set '.progress' argument to default to text

2012-04-10 Thread R. Michael Weylandt
You might try the Defaults package. Michael On Tue, Apr 10, 2012 at 10:54 AM, Liviu Andronic landronim...@gmail.com wrote: Dear all Is it possible to set globally the option .progress = text to all the apply functions in 'plyr'. For example, current default is daply(..., .progress = none). I

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread R. Michael Weylandt
You might want to use a while loop instead, something like: while(TRUE){ # Do things # Test: if your condition has occured if(conditionHappened) break # break will end loop. } Michael On Tue, Apr 10, 2012 at 10:48 AM, Steve Lavrenz stevelavr...@hotmail.com wrote: Everyone, I'm very new

Re: [R] lm()

2012-04-10 Thread Jorge I Velez
Hi Mariam, Check out the ?poly function. Best, Jorge.- On Tue, Apr 10, 2012 at 10:12 AM, Mariam wrote: People, help me please! How to use lm() function to defind a cofficient for 7-polinom, and what expression should I put in /formula/ -- View this message in context:

Re: [R] cbind, data.frame | numeric to string?

2012-04-10 Thread R. Michael Weylandt
Don't use cbind() -- it forces everything into a single type, here string, which in turn becomes factor. Simply, data.frame(a, b, c) Like David mentioned a few days ago, I have no idea who is promoting this data.frame(cbind(...)) idiom, but it's a terrible idea (albeit one that seems to be very

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Jessica Streicher
http://cran.r-project.org/doc/manuals/R-lang.html#while i-2 while(value =100){ num[i] - num[i-1] +5 value - num[i] i - i+1 } something like this? greetings Jessi Am 10.04.2012 um 16:48 schrieb Steve Lavrenz: Everyone, I'm very new to R, especially when it comes to

Re: [R] Error: cannot allocate vector of size...

2012-04-10 Thread R. Michael Weylandt
You probably have more objects in your workspace than you did previously. Clean them out (or just use a new R session) and things should go back to normal. You might also want to follow up on the help(memory.size) hint though -- doesn't Windows impose a memory limit unless you ask it for more?

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Albyn Jones
Here are a couple of constructions that work. albyn === num - rep(0,10) for (i in 2:10) { num[i] - num[i-1] + 5 if(num[i] 20) break } num [1] 0 5 10 15 20 25 0 0 0 0 or num - rep(0,10) done - FALSE i - 2 while(!done){

Re: [R] R2.11.1 seq.int difference between by and length.out

2012-04-10 Thread R. Michael Weylandt
What difference is it you are worried about:? identical(seq.int(0,1,length.out = 11), seq.int(0,1, by = 0.1)) # TRUE Though that may be OS dependent. M On Tue, Apr 10, 2012 at 10:51 AM, Alexander juschitz_alexan...@yahoo.de wrote: Berend Hasselman wrote On 10-04-2012, at 15:54, Alexander

Re: [R] lm()

2012-04-10 Thread Bert Gunter
Incoherent. Please read the posting guide . Also, no homework. Bert Sent from my iPhone -- please excuse typos. On Apr 10, 2012, at 7:12 AM, Mariam bahshi_m...@mail.ru wrote: People, help me please! How to use lm() function to defind a cofficient for 7-polinom, and what expression should I

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Steve Lavrenz
Albyn, Thanks for your help. This however, still assumes that I have to define an array of length 10. Is there a way that I can construct this so that my array is exactly as long as the number of spots I need to reach my threshold value? Thanks, -Steve -Original Message- From: Albyn

Re: [R] cbind, data.frame | numeric to string?

2012-04-10 Thread Jessica Streicher
Still didn't work for me without cbind , although you really don't need it ;) worked after i set options(stringsAsFactors=F). options(stringsAsFactors=F) df-data.frame(intVec,chaVec) df intVec chaVec 1 1 a 2 2 b 3 3 c df$chaVec [1] a b c documentation of

Re: [R] cbind, data.frame | numeric to string?

2012-04-10 Thread Rainer Schuermann
cbind() works as well, but only if c is attached to the existing test variable: tst - cbind( test, c ) tst ab c

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Jessica Streicher
x-numeric(1) x [1] 0 x[2]-2 x [1] 0 2 you don't really need to define the length? Am 10.04.2012 um 17:45 schrieb Albyn Jones: Here are a couple of constructions that work. albyn === num - rep(0,10) for (i in 2:10) { num[i] -

[R] multicore/mcparallel error

2012-04-10 Thread Wyatt McMahon
Hello everyone, I'm trying to parallelize an R script I have written. To do this, I am first trying to use the multicore package, because I've had some previous success with that. The function I'm trying to parallelize is illumqc. I'd like to create a separate process for each of 8

Re: [R] Package boot, funtion cv.glm

2012-04-10 Thread Drew Tyre
The key to using cv.glm is that you have to have a fitted model object with all the data to validate. In your case, that would appear to be a model like this: lm(base[,ncol(base)]~NDI) where NDI is calculated from two bands in the dataframe base. However, if the ground truth data is independently

[R] Re : taylor.diagram from plotrix package

2012-04-10 Thread Pascal Oettli
Hi, ?sd ?cor.test ... Regards, Pascal De : anaraster rrast...@gmail.com À : r-help@r-project.org Envoyé le : Mardi 10 avril 2012 22h50 Objet : [R] taylor.diagram from plotrix package Is there a way to access the numeric results (standard deviation and

Re: [R] Error: cannot allocate vector of size...

2012-04-10 Thread Drew Tyre
As the error message suggests, see ?memory.size, and you'll find that the problem is arising because R is running out of memory. If you were able to run this analysis before, then one possible reason why it now fails is that the workspace has increased in size in the interim - more objects and

Re: [R] plyr: set '.progress' argument to default to text

2012-04-10 Thread Liviu Andronic
On Tue, Apr 10, 2012 at 5:32 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: You might try the Defaults package. Thanks for the hint. Unfortunately library(Defaults) setDefaults('create_progress_bar', name = text) doesn't do the trick. But one can set defaults for each *ply()

Re: [R] cbind, data.frame | numeric to string?

2012-04-10 Thread R. Michael Weylandt
Sorry, I missed that the OP's real question was in character/factor, not in the why are these all factors bit...good catch. Rant about cbind() still stands though. :-) [Your way with cbind() would give him all characters, not some characters and some numerics since cbind() gives a matrix by

Re: [R] multicore/mcparallel error

2012-04-10 Thread R. Michael Weylandt
I don't know the multicore package, but if possible, it might be easier to upgrade to 2.15 and use the new built-in parallel package that was introduced in R 2.14. Then your syntax would be something like mclapply(files, illumqc) Michael On Tue, Apr 10, 2012 at 11:33 AM, Wyatt McMahon

Re: [R] cbind, data.frame | numeric to string?

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 11:58 AM, Rainer Schuermann wrote: cbind() works as well, but only if c is attached to the existing test variable: tst - cbind( test, c ) tst ab c 1 1 0.3 y1 2 2 0.4 y2 3 3 0.5 y3 4 4 0.6 y4 5 5 0.7 y5 str( tst ) 'data.frame': 5 obs. of 3

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 11:53 AM, Steve Lavrenz wrote: Albyn, Thanks for your help. This however, still assumes that I have to define an array of length 10. Is there a way that I can construct this so that my array is exactly as long as the number of spots I need to reach my threshold

Re: [R] cbind, data.frame | numeric to string?

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 12:19 PM, David Winsemius wrote: On Apr 10, 2012, at 11:58 AM, Rainer Schuermann wrote: cbind() works as well, but only if c is attached to the existing test variable: tst - cbind( test, c ) tst ab c 1 1 0.3 y1 2 2 0.4 y2 3 3 0.5 y3 4 4 0.6 y4 5

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Albyn Jones
What's wrong with num - rep(0,10) done - FALSE i - 2 while(!done){ num[i] - num[i-1] + 5 if(num[i] 20) done - TRUE i - i + 1 } num - num[1:(i-1)] You can delete the unused tail when you finish.

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Jean V Adams
Do you need a loop at all? Will this do the trick? seq(from=0, to=100, by=5) Jean Steve Lavrenz wrote on 04/10/2012 09:48:34 AM: Everyone, I'm very new to R, especially when it comes to loops and functions, so please bear with me if this is an elementary question. I cannot seem to

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Steve Lavrenz
I definitely need a loop - the example I gave was only a simple one. Say I want to do more complex calculations in each step, such that the numeric difference between consecutive terms is not constant. I will try out some of the methods that have been shared so far. Thank you! -Steve

Re: [R] R2.11.1 seq.int difference between by and length.out

2012-04-10 Thread Alexander
Thank you Michael It is indeed the OS identical(seq.int(0,1,length.out = 11), seq.int(0,1, by = 0.1)) # FALSE Michael Weylandt wrote What difference is it you are worried about:? identical(seq.int(0,1,length.out = 11), seq.int(0,1, by = 0.1)) # TRUE Though that may be OS dependent.

[R] Get part of a GO term

2012-04-10 Thread stella
Hi, Sorry, I am bad with regular expression and a beginner with R. How do I get only the numbers 0009987 from the following entry? GO:0009987~cellular process Thanks a lot, Stella -- View this message in context: http://r.789695.n4.nabble.com/Get-part-of-a-GO-term-tp4546125p4546125.html Sent

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Drew Tyre
While you can build up a vector like this in a for loop, this is exactly the sort of construction that leads to excessive memory growth because on each iteration of the loop R creates a new copy of the vector x - old copies have no references to them, but are not deallocated until the next

[R] mgcv::gam in splus?

2012-04-10 Thread David Katz
Is mgcv and particularly its gam available for Splus? I've been using it happily in R and need to implement something in Splus for which the automatic smoothing parameter selection is needed. Thanks for any guidance, David Katz da...@davidkatzconsulting.com -- View this message in context:

Re: [R] compare two matrices

2012-04-10 Thread Rui Barradas
Hello, In Reply To compare two matrices Apr 10, 2012; 9:26am — by Kehl Dániel Kehl Dániel Dear Members, I have two estimated transition matrices and I want to compare them. In fact I want to check the hypothesis if they come from the same process. I tried to look for some test but all

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 1:08 PM, Steve Lavrenz wrote: I definitely need a loop - the example I gave was only a simple one. Say I want to do more complex calculations in each step, such that the numeric difference between consecutive terms is not constant. You can always use: for( i in

Re: [R] Get part of a GO term

2012-04-10 Thread Martin Morgan
On 04/10/2012 09:11 AM, stella wrote: Hi, Sorry, I am bad with regular expression and a beginner with R. How do I get only the numbers 0009987 from the following entry? GO:0009987~cellular process sub(.*:(.*)~.*, \\1, GO:009987~cellular process) but you might also be interested in

Re: [R] reclaiming lost memory in R

2012-04-10 Thread Ramiro Barrantes
Hi everyone, Thank you so much for your help. I see that one can use tricks, such as double brackets, and sparing use of gc() to help with memory usage in R, the fact is that a new copy of the object is made every time a named object is assigned, and R's garbage collection should take care

Re: [R] Creating a loop with an indefinite end term

2012-04-10 Thread Charilaos Skiadas
On Apr 10, 2012, at 1:08 PM, Steve Lavrenz wrote: I definitely need a loop - the example I gave was only a simple one. Say I want to do more complex calculations in each step, such that the numeric difference between consecutive terms is not constant. I will try out some of the methods

Re: [R] R2.11.1 seq.int difference between by and length.out

2012-04-10 Thread R. Michael Weylandt
So it's a machine/OS issue: if you really want to trace it down, take a look here: http://svn.r-project.org/R/trunk/src/main/seq.c seq.int() in R goes to do_seq() in C, but at this point it's probably best to identify it as floating-point gremlins and to work around. Michael On Tue, Apr 10,

[R] object '---' not found

2012-04-10 Thread MLE
Hi, I am very new to R and the stats world. I have enjoyed working with R so far but I have come across an error message in a very simple command that I am unable to resolve. I bring data in through excel .csv files and check them to be sure R reads them correctly and has everything assigned as

[R] Building customized R for Windows installer using 'make myR'

2012-04-10 Thread Josh O'Brien
I am attempting to build a customized R installer on Windows, using the Inno Setup installer. I am following the instructions in Section 3.1.8 of the R Installation and Administration Manual (Building the Inno Setup installer), which includes the following passage: An alternative way to

[R] a trivial question

2012-04-10 Thread Liang, Hua
How many levels can the the nlme function in nlme library handle when a multilevel dataset is fitted? It will be greatly appreciated if any examples with 3 or 4 levels can be shared. Thanks for your attention. Hua [[alternative HTML version deleted]]

Re: [R] object '---' not found

2012-04-10 Thread jim holtman
If you brought the data in from Excel, it is probably a dataframe. You probably need to read the Intro to R on how to access information in a dataframe. You should at least show what you did. most likely VIQ is a column in your Excel file and depending on how you read it in, you would probably

[R] re-install a package

2012-04-10 Thread Hui Du
Hi All, I have a self-cooked package and save it to a zip file after running make, say named xxx.zip. After installing it to R by running Install packages from local zip files under Packages menu in R (Windows), I realized I needed to change some source codes and re-make it. My

Re: [R] re-install a package

2012-04-10 Thread Jeff Newmiller
you need to re-install it. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live:

[R] nls function

2012-04-10 Thread nerak13
Hi, I've got the following data: x-c(1,3,5,7) y-c(37.98,11.68,3.65,3.93) penetrationks28-dataframe(x=x,y=y) now I need to fit a non linear function so I did: fit - nls(y ~ I(a+b*exp(1)^(-c * x)), data = penetrationks28, start = list(a=0,b = 1,c=1), trace = T) The error message I get is: Error

Re: [R] nls function

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 4:03 PM, nerak13 wrote: Hi, I've got the following data: x-c(1,3,5,7) y-c(37.98,11.68,3.65,3.93) penetrationks28-dataframe(x=x,y=y) now I need to fit a non linear function so I did: fit - nls(y ~ I(a+b*exp(1)^(-c * x)), data = penetrationks28, start = list(a=0,b =

  1   2   >