[R] how to update R10.0 to R11.0 in Ubuntu linux

2010-05-24 Thread Mao Jianfeng
Dear R-listers, I am new to R in linux. And, I am now confused by updating R in Ubuntu 9.10 linux system. I would like to seek some advice on that problem. I have done what are listed in CRAN linux installation guide: 1. add an entry like "deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu karmic

[R] getQ0 gives different results

2010-05-24 Thread shakira M
getQ0 function is used in arima. I am trying to recode arima function in perl ( I have to use this function in grid. We have restrictions to install R package in large set of machines ) The getQ0 acts differently for same kind of input ( I hope ). > init [1] 18.368400 0.415422 0.415422 > arma [

[R] segplot (latticeExtra)

2010-05-24 Thread Sebastian P. Luque
Hi, I'm having a bit of trouble with 'scales="free"' in the segplot() function of latticeExtra. Say we need panels for each year, showing only those counties that are represented in each one: ------ library(latticeExtra) data(U

Re: [R] finding the best cubic spline fitting

2010-05-24 Thread David Winsemius
On May 24, 2010, at 6:39 PM, Usman Munir wrote: Hi, I am trying to fit cubic spline to a data on mortality rate by age and year (1900-2008). The data is noisy and hence I would like to smooth using spline and also extrapolate beyond 2008. Data from 1900 to 1948 are very unreliable while

Re: [R] Best Server Options

2010-05-24 Thread Cedrick W. Johnson
this *may* help, my setup is as follows: I have 2 boxes, one a Windows Server 2008 instance. I installed R 2.10.1 and 2.11 on them, and used the Remote App function to create a remote app "icon" that users (x 4 currently) put on their desktop. Yes, that setup needs Terminal Services to work, b

Re: [R] Means do not tally

2010-05-24 Thread Ruijie
Yes thank you very much! I knew i had different data points for each subject per condition but didn't realise that it would affect the averages of the averages! Thank you for helping me solve this big headache of mine for the past 2 days =) Regards, Ruijie (RJ) He who has a why can endu

[R] Error during wrapup: cannot open the connection

2010-05-24 Thread Sheila Reynolds
I am trying to use a new (to me) package (samr) and even when I try to run a very simple example, I get this "cannot open the connection" error. The reason I am writing to r-help rather than to the authors of samr is I think this may be a more general R problem rather than a samr-specific problem.

[R] Fixed Effects Estimations (in Panel Data)

2010-05-24 Thread ivo welch
dear readers---I struggled with how to do nice fixed-effects regressions in large economic samples for a while. Eventually, I realized that nlme is not really what I needed (too complex), and all I really wanted is the plm package. so, I thought I would share a quick example. sa

[R] finding the best cubic spline fitting

2010-05-24 Thread Usman Munir
Hi, I am trying to fit cubic spline to a data on mortality rate by age and year (1900-2008). The data is noisy and hence I would like to smooth using spline and also extrapolate beyond 2008. Data from 1900 to 1948 are very unreliable while data from 1948 to 2008 are reliable. I would like to have

Re: [R] rounding up to nearest integer

2010-05-24 Thread Nikhil Kaza
?round On May 24, 2010, at 9:26 PM, Mohan L wrote: Dear All, I have a data frame "data" and the below is the str of "data" : $ Feb : int 1 1195 0 11 28 152 24 2 1 1470 ... $ Mar : int 0 1212 0 17 27 184 15 1 1 1311 ... $ Apr : int 2 1244 1 15 23 135 11 0 1 991 ... $ May : int 2

[R] rounding up to nearest integer

2010-05-24 Thread Mohan L
Dear All, I have a data frame "data" and the below is the str of "data" : $ Feb : int 1 1195 0 11 28 152 24 2 1 1470 ... $ Mar : int 0 1212 0 17 27 184 15 1 1 1311 ... $ Apr : int 2 1244 1 15 23 135 11 0 1 991 ... $ May : int 2 1158 2 10 23 111 16 1 1 1237 ... $ Jun : int 0 84

Re: [R] Tutorial on rgl Graphics

2010-05-24 Thread David Winsemius
On May 24, 2010, at 2:36 PM, vincent.deluard wrote: Hi Duncan, I love your plotlm3d function! I want to plot the following data: x [1] 1 2 3 4 5 6 7 8 9 10 y [1] 0.5678042 0.3986702 0.3063544 0.2554426 0.1954868 0.1238850 0.1161249 0.1689951 0.1826783 0.2406300 z [1] 0.2558

Re: [R] sparse matrices in lme4

2010-05-24 Thread Douglas Bates
On Mon, May 24, 2010 at 6:24 PM, Robin Jeffries wrote: > I read somewhere (help list, documentation) that the random effects in lme4 > uses sparse matrix "technology". Yes. That is why there is such a close link between the Matrix and lme4 packages. The sparse matrix methods in the Matrix packa

Re: [R] excluding on element from a list

2010-05-24 Thread Daisy Englert Duursma
Thanks for your help and for the info on the website. I did not know what to call regular expressions and so I could not search for them. Cheers! d On Mon, May 24, 2010 at 7:08 PM, wrote: >> I am making a list of all the files in a folder and I want to exclude >> one file called "proj.current".

Re: [R] Accessing functions from a package

2010-05-24 Thread jim holtman
Put some numbers on your request. How much slower was it? Did you measure the user and system CPU? Was there a difference? Was there a large amount of I/O or other system calls being done? On Mon, May 24, 2010 at 2:01 PM, Peter Holt wrote: > Hi Folks, > > I created a .R file with source code t

[R] Best Server Options

2010-05-24 Thread dherrlin
I am planning to purchase a server to dedicate to running R processes. 4-5 analysts will use the server and it must have capabilities to process large data sets fast. I am not sure if Windows or Linux based servers are better or what specs I should be focused on for optimum production. Also is Lin

[R] Anybody has experience with plotlm3d function and can help me?

2010-05-24 Thread vincent.deluard
Hi Duncan, I am trying to use the plotlm3d function which I believe was written by John Fox and later modified by Jose Claudio Faria and Duncan Murdoch. It is a great way to plot data points in a 3D environment but I do not see how to customize the size of the axes. I want to plot the followi

[R] sparse matrices in lme4

2010-05-24 Thread Robin Jeffries
I read somewhere (help list, documentation) that the random effects in lme4 uses sparse matrix "technology". I'd like to confirm with others that I can't use a sparse matrix as a fixed effect? I'm getting an "Invalid type (S4) " error. Thanks. ~~~ -Robin Jeffries Dr.P.H. Candidat

Re: [R] Data reconstruction following PCA using Eigen function

2010-05-24 Thread Julia El-Sayed Moustafa
Hi Thomas, Thanks very much for your reply. I used svd and it worked perfectly for my purposes! Thanks again, Julia -- View this message in context: http://r.789695.n4.nabble.com/Data-reconstruction-following-PCA-using-Eigen-function-tp2226535p2229191.html Sent from the R help mailing list arc

Re: [R] Tutorial on rgl Graphics

2010-05-24 Thread Duncan Murdoch
vincent.deluard wrote: Hi Duncan, I love your plotlm3d function! That's not really my function. I think I suggested some changes to it, but I didn't write most of it. Duncan Murdoch I want to plot the following data: x [1] 1 2 3 4 5 6 7 8 9 10 y [1] 0.5

[R] breakpoints in rqss()

2010-05-24 Thread zugi young
Dear list, I used rqss() in quantreg package for a piecewise linear regression. Can someone tell me how to find the x values corresponding to the breakpoints and the slopes for the phases before and after the breakpoints? I searched the list and gather that there is another package "segmented" th

[R] "Optional" package dependency

2010-05-24 Thread Peter Langfelder
Hi all, apologies if this has been answered before, I didn't find the answer in the archives. I am putting together a package that I would like to have optional functionality if another package is installed. In normal, non-package code, I would simply write something like if (require(qvalue)) {

Re: [R] calling Perl script from R on Windows 7

2010-05-24 Thread Greg Snow
Try your same system command, but set intern=TRUE in the call and see if that does what you want. -- 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-b

Re: [R] Table to matrix

2010-05-24 Thread William Dunlap
> From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Kathryn Lord > Sent: Monday, May 24, 2010 11:16 AM > To: r-help@r-project.org > Subject: [R] Table to matrix > > Dear R users, > > I am trying to make this (3 by 10) matrix A > > --A---

[R] calculating "treatment effects" (differences) in a data frame?

2010-05-24 Thread derek eder
I am trying to calculating the treatment effect for individual subjects ("ID") of a ("score") between 2 time-points ("visit") (see example below). The data is in an unbalanced data.frame in "long" format with some missing data. I suspect that I am overlooking a very simple function, somethin

Re: [R] multiple pages of plot in one image file

2010-05-24 Thread Marc Schwartz
On May 24, 2010, at 2:32 PM, array chip wrote: > Hi, is there a way to create one image file (like using win.metafile(), > bmp(), etc) that contained multiple pages of plots, just like what > postscript() does in creating PDF file? > > Thanks > > John John, There is no notion of pages with b

[R] normalizing branch length with ape or similar

2010-05-24 Thread Joris Meys
Dear all, I'm trying to compare trees from different methods and originating from different genes (thus different lengths of sequences). Problem is that I can't really use the branch lengths, as they mean different things. If I calculate the geodesic distance between those trees, I need to make su

Re: [R] Table to matrix

2010-05-24 Thread Dennis Murphy
Hi: Here's one way, but not especially elegant. The idea is to initialize a matrix of zeros, produce an index matrix from two of your objects and then assign the third object to the specified indices. x <- matrix(0, nrow = 3, ncol = 10) row <- rep(1:nrow(x), unname(sapply(y.covar, nrow))) row [1]

[R] multiple pages of plot in one image file

2010-05-24 Thread array chip
Hi, is there a way to create one image file (like using win.metafile(), bmp(), etc) that contained multiple pages of plots, just like what postscript() does in creating PDF file? Thanks John __ R-help@r-project.org mailing list https://stat.ethz.ch/m

[R] Two-Sample Kuiper Test

2010-05-24 Thread Thomas La Bone
Can anyone recommend an R package that offers a two-sample Kuiper test? Tom __ 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 provide comme

Re: [R] From date to week day

2010-05-24 Thread Stephan Kolassa
Or: weekdays(as.Date("2010-05-24")) HTH, Stephan Wu Gong schrieb: ?strptime will helps. d <- as.Date("01/05/2007","%m/%d/%Y") format(d, "%A, %b %d, %Y") [1] "Friday, Jan 05, 2007" - A R learner. __ R-help@r-project.org mailing list https:/

[R] Table to matrix

2010-05-24 Thread Kathryn Lord
Dear R users, I am trying to make this (3 by 10) matrix A --A 0 0 00 1 0 0 0 0 0 0 0 00 0 1 0 0 0 0 0 0.5 0.5 0 0 0 0 0 0 0 --- from "mass.func" --

Re: [R] From date to week day

2010-05-24 Thread Wu Gong
?strptime will helps. > d <- as.Date("01/05/2007","%m/%d/%Y") > format(d, "%A, %b %d, %Y") [1] "Friday, Jan 05, 2007" - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/From-date-to-week-day-tp2228954p2228992.html Sent from the R help mailing list archive at Nab

Re: [R] Tutorial on rgl Graphics

2010-05-24 Thread vincent.deluard
Hi Duncan, I love your plotlm3d function! I want to plot the following data: > x [1] 1 2 3 4 5 6 7 8 9 10 > y [1] 0.5678042 0.3986702 0.3063544 0.2554426 0.1954868 0.1238850 0.1161249 0.1689951 0.1826783 0.2406300 > z [1] 0.2558812 0.2619668 0.2585930 0.2563669 0.2588323 0.2734029

Re: [R] Means do not tally

2010-05-24 Thread Ruijie
Thanks for your help jim. I have attached the raw data to see if anyone else can replicate my problem. Regards, Ruijie (RJ) He who has a why can endure any how. ~ Friedrich Nietzsche On 25 May 2010 00:17, jim holtman wrote: > Are you sure that you have the same number of data points

[R] Accessing functions from a package

2010-05-24 Thread Peter Holt
Hi Folks, I created a .R file with source code that accesses functions from a R package (example, fTrading). I then run the created application in two different configurations: 1. I started a R session, and then ran the application using the source ("my_application.R") command, and I measured th

Re: [R] Means do not tally

2010-05-24 Thread jim holtman
Notice that only column 19 in your original had the same for the average of the average and every entry had 32 data points. On Mon, May 24, 2010 at 1:47 PM, jim holtman wrote: > A quick check of you data shows that there are not the same number of > sample in each of the different conditions, the

Re: [R] Means do not tally

2010-05-24 Thread jim holtman
A quick check of you data shows that there are not the same number of sample in each of the different conditions, therefore trying to take the average of the averages will not work. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 32 31 29 30 24 23 31 32 32 31 24 2

Re: [R] adding one line to a plot

2010-05-24 Thread Dimitri Liakhovitski
Thanks a lot, Peter, that's exactly what I was looking for: plot(density(tstat),xlim=c(-5,8),ylim=c(0,.4),lwd=2,col='red') z <- tstat[order(tstat)] lines(z,dt(z,df=18),col='blue') legend(4,.3,c("exact","t(18)"),lwd=c(2,1),col=c('red','blue')) Dimitri On Mon, May 24, 2010 at 1:26 PM, Peter Ehler

Re: [R] lattice 'scales' option help

2010-05-24 Thread Kim Jung Hwa
Thanks Dennis and Peter, it worked. On Mon, May 24, 2010 at 12:44 PM, Peter Ehlers wrote: > On 2010-05-24 9:38, Kim Jung Hwa wrote: > >> Hi All, >> >> I'm trying to draw boxplots. I'm having a hard time to get "ticks labels" >> on >> multiple panels using 'alternating' option. >> >> # R Code: >>

Re: [R] Means do not tally

2010-05-24 Thread Ruijie
Thanks for your help jim. I have attached the raw data to see if anyone else can replicate my problem. Correction: i realise my attachment was too large, I have uploaded it to another site. The link is: http://dl.dropbox.com/u/1443460/List%20-%20Raw%20Data.csv Regards, Ruijie (RJ) He w

Re: [R] adding one line to a plot

2010-05-24 Thread Peter Ehlers
On 2010-05-24 10:50, Dimitri Liakhovitski wrote: Hello! I am running a very simple mini Monte-Carlo below using the function tstatistic (right below this sentence): tstatistic = function(x,y){ m=length(x) n=length(y) sp=sqrt( ((m-1)*sd(x)^2 + (n-1)*sd(y)^2)/(m+n-2) )

Re: [R] How to set parameters constraints in a function?

2010-05-24 Thread Ravi Varadhan
There are many ways to impose the constraint: 1. Use a constrained optimization routine (e.g. "constrOptim") 2. Reparametrize alpha and kappa such that the inequality will be always satisfied 3. Re-define your log-likelihood by putting a barrier such that the optimization algorithm will not vent

Re: [R] Path Analysis

2010-05-24 Thread John Fox
Dear Sam, > -Original Message- > From: R Help [mailto:rhelp.st...@gmail.com] > Sent: May-24-10 1:04 PM > To: John Fox > Cc: r-help > Subject: Re: [R] Path Analysis > > That's an interesting idea, I got the same impression from your SEM > appendix to "Companion to applied regression" in th

Re: [R] Path Analysis

2010-05-24 Thread R Help
That's an interesting idea, I got the same impression from your SEM appendix to "Companion to applied regression" in the paragraph just before Section 3. So I could get the same results if I built the following two models: mod1 = lm(intent~exposure+benefit+norms+childBarrier+parentBarrier+knowBe

Re: [R] [R-pkgs] New package: `lavaan' for latent variable analysis (including structural equation modeling)

2010-05-24 Thread Yves Rosseel
On 05/24/2010 06:31 PM, Michael Friendly wrote: Hi Yves lavaan looks like a very nice package. From the tutorial introduction I see you create path diagrams for some of the models you describe. How did you do this? I don't see a function for this in the package. I know there is a path.diagram f

Re: [R] writing function

2010-05-24 Thread Joshua Wiley
Just thought I would add, if you want to specifically specify to look in the function environment, you can do something like: myfun <- function(x) { env <- environment() #createa variable of the function environment rest of your stuff mget(grep("DailyPL",ls(, envir=env),value=TRUE),envir=env)) #

[R] adding one line to a plot

2010-05-24 Thread Dimitri Liakhovitski
Hello! I am running a very simple mini Monte-Carlo below using the function tstatistic (right below this sentence): tstatistic = function(x,y){ m=length(x) n=length(y) sp=sqrt( ((m-1)*sd(x)^2 + (n-1)*sd(y)^2)/(m+n-2) ) t=(mean(x)-mean(y))/(sp*sqrt(1/m+1/n))

Re: [R] lattice 'scales' option help

2010-05-24 Thread Peter Ehlers
On 2010-05-24 9:38, Kim Jung Hwa wrote: Hi All, I'm trying to draw boxplots. I'm having a hard time to get "ticks labels" on multiple panels using 'alternating' option. # R Code: # May not be the best example, please just look into 'scales' option library(lattice) data(OrchardSprays) dta<- subs

Re: [R] writing function

2010-05-24 Thread arnaud Gaboury
Thank you so much. You are totally right. > -Original Message- > From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] > Sent: Monday, May 24, 2010 6:33 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] writing function > > My guess is that either ls(), called inside g

Re: [R] import data from a csv file

2010-05-24 Thread Peter Ehlers
On 2010-05-24 9:51, li li wrote: Hi all, I have some trouble reading data from a csv file. I used command "read.delim("clipboard") to read in the data. aalpha.data<- read.delim("clipboard") class(aalpha.data) [1] "data.frame" dim(aalpha.data) [1] 8 25 colnames(aalpha.data) [1]

Re: [R] [R-pkgs] New package: `lavaan' for latent variable analysis (including structural equation modeling)

2010-05-24 Thread Michael Friendly
Hi Yves lavaan looks like a very nice package. From the tutorial introduction I see you create path diagrams for some of the models you describe. How did you do this? I don't see a function for this in the package. I know there is a path.diagram function in the sem package that uses dot to dra

Re: [R] writing function

2010-05-24 Thread Joshua Wiley
My guess is that either ls(), called inside grep() or mget() is looking in an environment you do not want it to. When you create a function, it has it's own environment. If you want the dataframes to be created inside the function call (which is what I think you were doing before), you should set

Re: [R] Need help to retrieve the previous commands by usin g ↑ and ↓ keys.

2010-05-24 Thread Marc Schwartz
On May 24, 2010, at 9:49 AM, makhdoomi wrote: > To: r-help@r-project.org > > >> hi, >> I am using R version 2.10.0,OS fedora 11i terminal.when i am trying to > retrieve the previous used R commands >> by using ↑ and ↓ keys,but i get the output like this > ^[[A^[[A^[[A^[[B^[[C^[[A. >> can any one

Re: [R] Means do not tally

2010-05-24 Thread jim holtman
Are you sure that you have the same number of data points in each of the summary cells that you show in your csv file that was sent? You need to provide a reproducible example of all the data so we can see what you did. The best information I can provide at this point is that you have a "bug" in

[R] writing function

2010-05-24 Thread arnaud Gaboury
Dear group, Here is my environment after I run a function, myfun() >myfun() > ls() [1] "allcon""avprix16" "DailyPL100416" "DailyPL100419" "DailyPL100420" "l" "ll""myl" "PL" "PLdaily" "PLglobal" "PLmonthly" [13] "Pos100415" "Pos100

Re: [R] Path Analysis

2010-05-24 Thread John Fox
Dear sstewart, The model appears to reflect the path diagram, assuming that you intend to allow the exogenous variables to be correlated and want the errors to be uncorrelated. This is one way to model the binary variable reuse. An alternative would be to fit the equation for intent by least-squ

Re: [R] import data from a csv file

2010-05-24 Thread Steve Lianoglou
Hi, On Mon, May 24, 2010 at 11:51 AM, li li wrote: > Hi all, >   I have some trouble reading data from a csv file. >   I used command "read.delim("clipboard") to read in the data. > > >> aalpha.data <- read.delim("clipboard") >> class(aalpha.data) > [1] "data.frame" >> dim(aalpha.data) > [1]  8 2

[R] import data from a csv file

2010-05-24 Thread li li
Hi all, I have some trouble reading data from a csv file. I used command "read.delim("clipboard") to read in the data. > aalpha.data <- read.delim("clipboard") > class(aalpha.data) [1] "data.frame" > dim(aalpha.data) [1] 8 25 > colnames(aalpha.data) [1] "X" "V1" "V2" "V3" "V4" "V5"

[R] lattice 'scales' option help

2010-05-24 Thread Kim Jung Hwa
Hi All, I'm trying to draw boxplots. I'm having a hard time to get "ticks labels" on multiple panels using 'alternating' option. # R Code: # May not be the best example, please just look into 'scales' option library(lattice) data(OrchardSprays) dta <- subset(OrchardSprays, OrchardSprays$rowpos %i

Re: [R] writing function:loop and rbind

2010-05-24 Thread arnaud Gaboury
Do you think there is a way to add somewhere the argument row.names=NULL ? Or should I have to write another line to remove the row.names? > -Original Message- > From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] > Sent: Monday, May 24, 2010 5:07 PM > To: arnaud Gaboury > Cc: r-help@r

Re: [R] writing function:loop and rbind

2010-05-24 Thread arnaud Gaboury
Maybe is there a neater solution, but the function mget() does the trick. So until further advice, I will work with your solution. Thank you > -Original Message- > From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] > Sent: Monday, May 24, 2010 5:07 PM > To: arnaud Gaboury > Cc: r-help

[R] Path Analysis

2010-05-24 Thread R Help
Hello list, I'm trying to make sure that I'm performing a path analysis correctly using the sem package. the figure at http://flame.cs.dal.ca/~sstewart/regressDiag.png has a detailing of the model. The challenge I'm having is that reuse is an indicator (0/1) variable. Here's the code I'm using:

Re: [R] Means do not tally

2010-05-24 Thread Ruijie
Noted. I have attached a list of some data in csv format. The first column is the SubID and the rest of the column are the mean of each condition for the particular subject. Average 1 is the average computed from each column in the list. Average 2 is computed from the raw data of all the data po

Re: [R] writing function:loop and rbind

2010-05-24 Thread Joshua Wiley
On Mon, May 24, 2010 at 7:00 AM, arnaud Gaboury wrote: > One solution is to create a list, then do.call. > Here is my environment: > >> ls() >  [1] "DailyPL100416" "DailyPL100419" "DailyPL100420" "l"             "ll" > "PLglobal"      "Pos100415"     "Pos100416"     "Pos100419"     "Pos100420" > "

Re: [R] Means do not tally

2010-05-24 Thread Ben Bolker
Ruijie gmail.com> writes: > In my experiment, I expose 10 subjects to 24 different conditions of > stimuli. Each condition is exposed to the same subject 3x. > This would make each subject have 24x3=72 data points. All the subjects > combined would have 72x10=720 data points with each condition h

Re: [R] Data frames, passing by value, and performance (Matt Shotwell)

2010-05-24 Thread biostatmatt
R is pretty smart about duplicating only when necessary. That is, arguments passed to a function are copy-on-write. Also, I think (someone more knowledgeable please correct if I'm wrong) it may be better to use the data frame, which is just a list internally, because if you only modify one column,

[R] Need help to retrieve the previous commands by usin g ↑ and ↓ keys.

2010-05-24 Thread makhdoomi
To: r-help@r-project.org >hi, >I am using R version 2.10.0,OS fedora 11i terminal.when i am trying to retrieve the previous used R commands >by using ↑ and ↓ keys,but i get the output like this ^[[A^[[A^[[A^[[B^[[C^[[A. >can any one tell me how i can solve this problem. -- Regards Ab Rauf Sh

[R] Means do not tally

2010-05-24 Thread Ruijie
Hi all, here is my situation In my experiment, I expose 10 subjects to 24 different conditions of stimuli. Each condition is exposed to the same subject 3x. This would make each subject have 24x3=72 data points. All the subjects combined would have 72x10=720 data points with each condition having

Re: [R] Data frames, passing by value, and performance

2010-05-24 Thread Gabor Grothendieck
If you don't modify the data frame in your function it won't physically make a new copy. On Mon, May 24, 2010 at 10:29 AM, wrote: > I understand that everything passed to an R function is passed "by > value".  This would seem to include data frames, which my current > application uses heavily, b

[R] Data frames, passing by value, and performance

2010-05-24 Thread gschultz
I understand that everything passed to an R function is passed "by value". This would seem to include data frames, which my current application uses heavily, both for storing program inputs, and holding intermediate and final results. In trying to get greater performance out of my R code, I am wo

Re: [R] need help to retrieve the previous commands by usin g ↑ and ↓ keys.

2010-05-24 Thread Liviu Andronic
On 5/24/10, makhdoomi wrote: > > > >I am using R version 2.10.0,os fedora 11i terminal.when i am trying to > retrieve the previous used > There might be an issue with your terminal. Did you try with xterm? Here accessing history items with R running in an xterm works just fine. Liviu ___

Re: [R] help required state wise count

2010-05-24 Thread David Winsemius
On May 24, 2010, at 8:21 AM, Mohan L wrote: Hi Mohan, Try this: table(dummy$State,dummy$Months) Jim Thanks for your time. table(dummy$State,dummy$Months) in this case the state column becomes the row index. I want the state name as the first column. There may be a way to do it. ?as.

Re: [R] switching elements of a vector

2010-05-24 Thread Bert Gunter
And, just for kicks, a yet another (somewhat inefficient)solution: match(unique(a),a) Cheers, Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of speretti Sent: Monday, May 24, 2010 3:03 A

Re: [R] Random Forest for Ecological Prediction under presence of Spatial Autocorrelation

2010-05-24 Thread Gabor Grothendieck
You could also try the Boruta package for variable selection. 2010/5/24 Andreas Béguin : > Dear R-help list members, > > I have a statistical question regarding the Random Forest function (RF) as > applied to ecological prediction of species presences and absences. > > RF seems to perform very wel

Re: [R] Optimization

2010-05-24 Thread Berend Hasselman
Berend Hasselman wrote: > > > Bogaso wrote: >> >> Hi all, I need to minimize following function : >> >> dat <- matrix(rnorm(2), ncol=2) >> targetFn <- function(x) { >> dat <- as.matrix(dat) >> dat1 <- 1*dat[,1] - (x^2)*dat[,2] >> return(sd(dat1))

Re: [R] writing function:loop and rbind

2010-05-24 Thread arnaud Gaboury
One solution is to create a list, then do.call. Here is my environment: > ls() [1] "DailyPL100416" "DailyPL100419" "DailyPL100420" "l" "ll" "PLglobal" "Pos100415" "Pos100416" "Pos100419" "Pos100420" "position" "r" [13] "result""sel"

Re: [R] need help to retrieve the previous commands by usin g ↑ and ↓ keys.

2010-05-24 Thread Liviu Andronic
Hello On 5/24/10, makhdoomi wrote: > >hi, > >I am using R version 2.10.0.when i am trying to retrieve the previous used > R commands > >by using ↑ and ↓ keys,but i get the output like this > ^[[A^[[A^[[A^[[B^[[C^[[A. > >can any one tell me how i can solve this problem. > It would help to kno

Re: [R] switching elements of a vector

2010-05-24 Thread speretti
it works as well! -- View this message in context: http://r.789695.n4.nabble.com/switching-elements-of-a-vector-tp2228373p2228485.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/m

[R] Random Forest for Ecological Prediction under presence of Spatial Autocorrelation

2010-05-24 Thread Andreas Béguin
Dear R-help list members, I have a statistical question regarding the Random Forest function (RF) as applied to ecological prediction of species presences and absences. RF seems to perform very well for prediction of species ranges or prevalences. However, the problem with my dataset is a high de

Re: [R] How to set parameters constraints in a function? (Matt Shotwell)

2010-05-24 Thread Matt Shotwell
When there is a constraint like this, it is often the case that the likelihood function may the value zero. Hence, the log-likelihood may take the value -Inf. You could impose this constraint with something like if( kappa >= alpha ) { ll <- -Inf } else ll <- n*log(alpha/gamma(kappa))+

Re: [R] Functioning and source code location of .Primitive()

2010-05-24 Thread Stefano Baraldo
Thank you Barry! Telling the truth, I found the function definition this morning too... I really don't know how could I have missed it (I've been searching for it for a pair of days...). I work on a Mac and I'm learning to use Unix systems in general, so I'm not very accustomed to grep and emacs

[R] writing function:loop and rbind

2010-05-24 Thread arnaud Gaboury
Dear group, I have a function, let's call it myfun, wich give me a list of result: R1,R2,R3... There is a loop in this function to get my results. Here is the structure of my function: Myfun<-function() { For (i in X ){ ---instructions- Ri { { All Results (R1,R2...) are Data.

Re: [R] ROC curve

2010-05-24 Thread Frank E Harrell Jr
On 05/24/2010 02:14 AM, Claudia Beleites wrote: Dear Changbin, I want to know how to select the optimal decision threshold from the ROC curve? Depends on what optimal means. I think there are a bunch of different criteria used: - point closest to the ideal model - point furthest from the "gue

[R] need help to retrieve the previous commands by usin g ↑ and ↓ keys.

2010-05-24 Thread makhdoomi
>hi, >I am using R version 2.10.0.when i am trying to retrieve the previous used R commands >by using ↑ and ↓ keys,but i get the output like this ^[[A^[[A^[[A^[[B^[[C^[[A. >can any one tell me how i can solve this problem. -- Regards Ab Rauf Shah -- Regards Ab Rauf Shah [[alternati

[R] How to set parameters constraints in a function?

2010-05-24 Thread Carol Gao
Dear R list, I have a function specifying my log-likelihood, and now I need to set the constraint that *alpha > kappa*, could anyone help me with setting this in my function? the function is defined as follows: mll <- function(param){ n <- length(x) psi <- numeric(n) psi[1] <- 1.0 a0 <-

Re: [R] help required state wise count

2010-05-24 Thread Mohan L
>> >> Hi Mohan, > Try this: > > table(dummy$State,dummy$Months) > > Jim > > Thanks for your time. table(dummy$State,dummy$Months) in this case the state column becomes the row index. I want the state name as the first column. There may be a way to do it. Thanks & Rg Mohan L [[alternativ

Re: [R] switching elements of a vector

2010-05-24 Thread speretti
Thank you ! Great answers...now it seems very easy... As usual...a the obviousness of a solution depends on how you face the problem... Thank you for help me in find the good approaches... -- View this message in context: http://r.789695.n4.nabble.com/switching-elements-of-a-vector-tp2228373p2

Re: [R] retrieve path analysis coefficients (package agricolae)

2010-05-24 Thread Peter Ehlers
On 2010-05-23 18:16, Zack Holden wrote: Dear list, I'd like to use path.analysis in the package agricolae in batch format on many files, retrieving the path coefficients for each run and appending them to a table. I don't see any posts in the help files about this package or the path.analysis pac

Re: [R] switching elements of a vector

2010-05-24 Thread Gabor Grothendieck
Try this: > which(diff(a) > 0) + 1 [1] 2 6 9 12 14 15 On Mon, May 24, 2010 at 6:02 AM, speretti wrote: > > Hi, > > I would like to receive help for the following matter: > > If I'm dealing with a numeric vectors containing increasing elements. > i.e. > > a<-c(1,2,2,2,2,3,3,3,4,4,4,5,5,6,7,7,

Re: [R] switching elements of a vector

2010-05-24 Thread schuster
Hi, is this what you need? b <- c(NA, a[1:length(a)-1]) # shift values of a one step to the right which(a-b == 1) On Monday 24 May 2010 12:02:55 pm speretti wrote: > Hi, > > I would like to receive help for the following matter: > > If I'm dealing with a numeric vectors containing increasin

Re: [R] switching elements of a vector

2010-05-24 Thread Chuck Cleland
On 5/24/2010 6:02 AM, speretti wrote: > Hi, > > I would like to receive help for the following matter: > > If I'm dealing with a numeric vectors containing increasing elements. > i.e. > > a<-c(1,2,2,2,2,3,3,3,4,4,4,5,5,6,7,7,7) > > There exist an efficient way to obtain an vector that indicate

Re: [R] help required state wise count

2010-05-24 Thread Jim Lemon
On 05/24/2010 07:44 PM, Mohan L wrote: I have the data like this: dummy State Months No 1xxxJan 1 2xxxJan 2 3xxxJan 1 4yyyJan 1 5yyyJan 2 6yyyJan 1 7zzzJan 3 8zzzJan 1 9zzzJan 2 10 xxxFeb 3 11 xxx

Re: [R] lme: model variance and error by group

2010-05-24 Thread Tursiops
Thanks a lot for the help. I am quite new to R and every bit of information is very valuable for me. Best wishes Juan A. Balbuena El 21/05/2010 17:05, ONKELINX, Thierry [via R] escribió: Have a look at ?varClasses. You could you something like varIdent(form = ~ 1|areatrai) or varE

[R] R Training - Bath, UK

2010-05-24 Thread Sarah Lewis
Mango Solutions is pleased to announce that we will be running an Introduction to R course in Bath on the 24th and 25th June; there are currently a couple of places still available on this course for anyone interested in learning about R, the programming language

[R] switching elements of a vector

2010-05-24 Thread speretti
Hi, I would like to receive help for the following matter: If I'm dealing with a numeric vectors containing increasing elements. i.e. a<-c(1,2,2,2,2,3,3,3,4,4,4,5,5,6,7,7,7) There exist an efficient way to obtain an vector that indicates the position of the changing element of "a"? In this ca

Re: [R] excluding on element from a list

2010-05-24 Thread Jim Lemon
On 05/24/2010 05:40 PM, Daisy Englert Duursma wrote: Dear List, I am making a list of all the files in a folder and I want to exclude one file called "proj.current". This is the 31st file in a folder. Currently I use the command: tdirs<- list.files(pattern="proj.")[-31] However I would like t

[R] help required state wise count

2010-05-24 Thread Mohan L
I have the data like this: > dummy State Months No 1xxxJan 1 2xxxJan 2 3xxxJan 1 4yyyJan 1 5yyyJan 2 6yyyJan 1 7zzzJan 3 8zzzJan 1 9zzzJan 2 10 xxxFeb 3 11 xxxFeb 4 12 xxxFeb 2 13 yyyFeb

Re: [R] Optimization

2010-05-24 Thread Berend Hasselman
Bogaso wrote: > > Hi all, I need to minimize following function : > > dat <- matrix(rnorm(2), ncol=2) > targetFn <- function(x) { > dat <- as.matrix(dat) > dat1 <- 1*dat[,1] - (x^2)*dat[,2] > return(sd(dat1)) } > > i.e. I want ro find for which "x"

Re: [R] Error in inspect(), package asuR

2010-05-24 Thread Liviu Andronic
Hello On 5/24/10, Joanne Hosking wrote: > I am using R version 2.11.0, asuR_0.08-24, and lme4_0.999375-33 > You might want to try asuR_0.10 [1]. The CRAN version seems badly outdated. Liviu [1] http://www.evolution.unibas.ch/teaching/r_course/asuR.htm _

  1   2   >