[R] clogit, modeling change...

2012-05-25 Thread Stefan Petersson
Hi, I've set up a discrete choice experiment on magazine preference following the guidelines from Azaiki. H Nishimura K. Design and Analysis of Choice Experiments Using R. A Brief Introuction from Agricultural Informatin Research 17(2), 2008. 86-94. I'm working with the clogit() function from

Re: [R] Manually modifying an hclust dendrogram to remove singletons

2012-05-25 Thread r-help . 20 . trevva
Hi all, Thanks for the replies - they have helped shaped my thinking and are starting to push me in a better direction. Maybe I should explain a little more about what I'm trying to achieve. I am analysing satellite data across the global ocean, and am interested in trying to classify areas of

Re: [R] Fwd: help needed

2012-05-25 Thread Jim Lemon
On 05/25/2012 02:45 AM, QAMAR MUHAMMAD UZAIR wrote: ... I want to reshape it in the following FORMAT 19671968196919701971197219731974 10.870.870.870.870.71 20.870.870.870.870.72 OBVIOUSLY, I

Re: [R] levels of comma separated data

2012-05-25 Thread Stefan
analyst41 at hotmail.com analyst41 at hotmail.com writes: I have a data set that has some comma separated strings in each row. I'd like to create a vector consisting of all distinct strings that occur. The number of strings in each row may vary. Thanks for any help. # # # Some data:

[R] Collecting results of a test with array

2012-05-25 Thread Francesca
Dear contributors I have tried this experiment: x-c() for (i in 1:12){ x[i]-list(cbind(x1[i],x2[i])) #this is a list of 12 couples of time series I am using to perform a test } # that compares them 2 by 2 # # #trace statistic test-data.frame() cval-array( , dim=c(2,3,12)) for (i

Re: [R] glm(weights) and standard errors

2012-05-25 Thread peter dalgaard
Weighting can be confusing: There are three standard forms of weighting which you need to be careful not to mix up, and I suspect that the imputation weights are really a 4th version. First, there is case (replication) vs. precision weighting. A weight of 10 means one of - I have 10

Re: [R] RODBC connect to Excel (64-bit Windows 7)

2012-05-25 Thread Paul Bivand
If you're using (R)ODBC, you need a workflow that is either 32bit or 64-bit, but not mixed. On a 64-bit Windows 7 machine, I can use 32-bit R and RODBC to read and write 32-bit Excel (etc) and similarly xlsreadwrite works 32-bit. I can use 64-bit R and XLConnect to read and write from excel

[R] R+Stata batch mode

2012-05-25 Thread Francesco
Dear R help, I am using Stata, and I use a Stata ado file (Rsource) to run R in batch mode within Stata Everything works fine except for the fact that I cannot export the graphics that I obtain with my computations written in my R source file I believe this is related to the global

[R] Multiple cbind according to filename

2012-05-25 Thread Matthew Ouellette
Hi all, I'm just a beginner with R but I have not been able to search for any relevant answer to my problem. I apologize if it has in fact been asked before. Recently I've realized that I need to combine hundreds of pairs of data frames. The filenames of the frames I need to combine have

Re: [R] Manually modifying an hclust dendrogram to remove singletons

2012-05-25 Thread Mark Payne
Hi, Thanks for the replies - they have helped shaped my thinking and are starting to push me in a better direction. Maybe I should explain a little more about what I'm trying to achieve. I am analysing satellite data across the global ocean, and am interested in trying to classify areas of the

Re: [R] levels of comma separated data

2012-05-25 Thread analys...@hotmail.com
On May 25, 4:46 am, Stefan ste...@inizio.se wrote: analyst41 at hotmail.com analyst41 at hotmail.com writes: I have a data set that has some comma separated strings in each row. I'd like to create a vector consisting of all distinct strings that occur.  The number of strings in each

Re: [R] set tkscale by tkentry

2012-05-25 Thread Alexander
Hi Greg and jverzaniNWBKZ, thank you very much for your help. I already thought about your solution jverzaniNWBKZ. I hoped I could find a simpler solution (such as refering to the global variable of scale). As this is not possible for some intervals, I will take your solution. Thanks again for

[R] Using robust std.errors instead of OLS std.errors in regression

2012-05-25 Thread Dunken
I have to make a robust resettest. I have already calculated the robust standard errors but I don't know how to use these in my resettest. I have made the following code: labmodel2 - lm(formula = log(L) ~ log(W) + log(K) + log(Y), data=labordat) hc.cv - hccm(labmodel2, hc0) hc.cv robusttest -

[R] KS test and plot max distance between two ecdf curves

2012-05-25 Thread maxbre
Given this example a-c(0,70,50,100,70,650,1300,6900,1780,4930,1120,700,190,940, 760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430) b-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90, 3220,490,20790,290,740,5350,940,3910,0,640,850,260)

[R] edgeR Time Series

2012-05-25 Thread rmje
I have a time serie of 10 time points, including Treated and Control samples. In total my data contains 20 columns. I have grouped Treated and Control samples into 3 categories, Early, mid and late. I want to compare The early Treated Group with the early Control group, The mid Treated with the

Re: [R] Collecting results of a test with array

2012-05-25 Thread R. Michael Weylandt
My first thought is to unlist them and stick them in a vector and then to form that vector into an array of the desired shape. Something like this: x - vector(list,12) for(i in 6*(1:12)){x[[i/6]] - matrix(i:(i+5), ncol = 2) } print(x) x.out - array(unlist(x), dim = c(2,3,12)) print(x.out)

[R] Java problem - XLConnect/xlsx package

2012-05-25 Thread Rainer Haidinger
Hi, I hope you guys can help me, I already posted this question on stackoverflow but did not get any help (which worked). And I need to solve this problem as quick as possible: In our firm we migrated to windows 7 (64-bit) and also updated the java packages (1.6.0_24) and also R (to 2.15). Then

Re: [R] R+Stata batch mode

2012-05-25 Thread peter dalgaard
On May 25, 2012, at 14:46 , Francesco wrote: Dear R help, I am using Stata, and I use a Stata ado file (Rsource) to run R in batch mode within Stata Everything works fine except for the fact that I cannot export the graphics that I obtain with my computations written in my R source

Re: [R] RODBC connect to Excel (64-bit Windows 7)

2012-05-25 Thread Gabor Grothendieck
On Sun, Dec 4, 2011 at 9:40 AM, andrija djurovic djandr...@gmail.com wrote: Hi to all.  I have a problem to connect to an Excel database using RODBC. There are tips for RODBC as well as some alternatives listed here: http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows -- Statistics

[R] R memory allocation

2012-05-25 Thread swaraj basu
Dear All, I am running R in a system with the following configuration *Processor: Intel(R) Xeon(R) CPU X5650 @ 2.67GHz OS: Ubuntu X86_64 10.10 RAM: 24 GB* The R session info is * R version 2.14.1 (2011-12-22) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8

Re: [R] levels of comma separated data

2012-05-25 Thread analys...@hotmail.com
On May 25, 7:23 am, analys...@hotmail.com analys...@hotmail.com wrote: On May 25, 4:46 am, Stefan ste...@inizio.se wrote: analyst41 at hotmail.com analyst41 at hotmail.com writes: I have a data set that has some comma separated strings in each row. I'd like to create a vector

[R] Breakpoint in logistic GLM with 'segmented' package - error: replacement length zero

2012-05-25 Thread Peter Hoitinga
Hello all, I've been having trouble with assessing a breakpoint in a logistic GLM with two explanatory variables. For this analysis I've been using the 'segmented' package version 0.2-9.1. But I keep getting an error and I don't see where I would be going awry. The situation is the following:

Re: [R] R+Stata batch mode

2012-05-25 Thread Francesco
Dear Peter, You are absolutely right... I did not know that ;-) What to say ? Many thanks for your right answer to my silly question ;-) Best Regards On 25 May 2012 15:19, peter dalgaard pda...@gmail.com wrote: On May 25, 2012, at 14:46 , Francesco wrote: Dear R help, I am using

[R] Correlograms: using boxes and different variables on rows and columns

2012-05-25 Thread dadrivr
I'm trying to make correlograms using corrgram. See below for a simple example. library(corrgram) data(baseball) vars1 - c(Assists,Atbat,Errors,Hits,Homer,logSal) vars2 - c(Putouts,RBI,Runs,Walks,Years) corrgram(baseball[,vars2],lower.panel=panel.shade, upper.panel=panel.pie) I am

[R] problem with installing rms package

2012-05-25 Thread ramakanth reddy
Hi I am trying to install rms package but while installing it shows following error package 'survival' 2.36-2 is loaded, but = 2.36.3 is required by 'rms' what to do? i am using linux OS I have tried by updated r-base-core but it didnt work regards GRR [[alternative HTML version

[R] Hash Table - Select and Change Data iniside Matrix

2012-05-25 Thread Rantony
Hi, Here i have been a matrix like this, *NAMEAGE PALCETRUE/FALSE* ABC 20 INDIA XYZ 30 FRANCE PQR40 USA MNO 30KENIYA DEF25AUSTRALIA Here,* TRUE/FALSE* Column containing empty values. So my

Re: [R] plotting sorted factors

2012-05-25 Thread Rui Barradas
Hello, The problem is that the factors are not orderd by the row number. If you want to check their order, use str(sortdata) and you'll see Santa-Rosa was attributed factor level 4 (in the output, first variable, the 3rd and 4th). Try the following. sortdata - read.table(text=

Re: [R] Filling NA with cumprod?

2012-05-25 Thread Igor Reznikovsky
Hello Petr, Yes, I was hoping to avoid using loops. If nothing else works, I will take approach as the last resort. Thank you, Igor. On May 25, 2012 2:26 AM, Petr Savicky savi...@cs.cas.cz wrote: On Thu, May 24, 2012 at 08:24:38PM -0700, igorre25 wrote: Hello, I need to build certain

Re: [R] problem with installing rms package

2012-05-25 Thread Marc Schwartz
On May 25, 2012, at 8:51 AM, ramakanth reddy wrote: Hi I am trying to install rms package but while installing it shows following error package 'survival' 2.36-2 is loaded, but = 2.36.3 is required by 'rms' what to do? i am using linux OS I have tried by updated r-base-core but it

Re: [R] Collecting results of a test with array

2012-05-25 Thread Bert Gunter
?abind ## in R package abind. Very handy for this sort of thing Something like: do.call(abind, yourlist) You can also do it by hand along the lines Michael described: e.g. something like array(unlist(yourlist), dim = c(2,3, 12) ) -- Bert On Fri, May 25, 2012 at 6:16 AM, R. Michael Weylandt

Re: [R] Hash Table - Select and Change Data iniside Matrix

2012-05-25 Thread R. Michael Weylandt
There aren't empty values in R. nor is it likely you have a matrix of this form, but perhaps a data frame. Perhaps this works for you, If dat is the name of your data.frame, dat[dat$AGE == 30,TRUE/FALSE] - TRUE Next time do use dput() to give a reproducible example of your data -- if it's

Re: [R] Hash Table - Select and Change Data iniside Matrix

2012-05-25 Thread Jeff Newmiller
Read help for the ifelse function. Type ?ifelse at the command line. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

Re: [R] applying cbind (or any function) across all components in a list

2012-05-25 Thread David L Carlson
This should give you what you want and it is simpler than the earlier version: a1- array(1:6, dim=c(2,3)) a2- array(7:12, dim=c(2,3)) l1- list(a1,a2) a3- array(1:4, dim=c(2,2)) a4- array(5:8, dim=c(2,2)) l2- list(a3,a4) pattern - cbind(c(1, 2, 2, 3), c(1, 1, 2, 2)) lnew -

Re: [R] Multiple cbind according to filename

2012-05-25 Thread Ken
Matthew Ouellette mouellette89 at gmail.com writes: Hi all, I'm just a beginner with R but I have not been able to search for any relevant answer to my problem. I apologize if it has in fact been asked before. Recently I've realized that I need to combine hundreds of pairs of data

Re: [R] Filling NA with cumprod?

2012-05-25 Thread David L Carlson
This will loop only as many times as the largest number of consecutive NA's but uses vectorization within the loop. As currently defined, it will loop forever if the first value is NA. a - c(1, 2, 3, NA, NA, 6, 7, NA, NA, 10) f - c(0.9, 1.1, 0.9, 1.1, 0.9, 1.1, 0.9, 1.1, 0.9, 1.1) a1 - a alag -

Re: [R] problem with installing rms package

2012-05-25 Thread Marc Schwartz
Hi, First, please be sure to reply-all when following up so that the thread stays on the public list. The messages suggest that you might not have 'root' access when installing the packages, so the installation of the packages to the default location fails. You need to 'su' to root via the

Re: [R] Breakpoint in logistic GLM with 'segmented' package - error: replacement length zero

2012-05-25 Thread Vito Muggeo (UniPa)
dear Peter, Your code appears correct, so it is difficult to reply without the data.. If you are interested in further details, please contact me off-list vito Il 25/05/2012 15.34, Peter Hoitinga ha scritto: Hello all, I've been having trouble with assessing a breakpoint in a logistic GLM

Re: [R] R does not recognise columns and rows as they are supposed to be

2012-05-25 Thread William Dunlap
Is the file format documented? If not you can search for a possible format if you know the values at the start of the file. For one of your files, show the results of the following: file - your filename here for(what in c(double, integer)) { for(size in c(4, 8)) { for(endian in

[R] Multiple rms summary plots in a single device

2012-05-25 Thread Mike Harwood
I would like to incorporate multiple summary plots from the rms package into a single device and to control the titles, and also to open a new device when I reach a specified number of plots. Currently I am only getting a single plot(summary( graph in the upper left- hand corner of each

[R] [snowFT] Problems with passing arguments to performParallel

2012-05-25 Thread Marta Tolós
Hi all, I am trying to use performParallel from the snowFT package. But I have a really hard time to be able to pass arguments to the function that I want to run in parallel. Since I could not pass the arguments I create a XML file to read the information from there, the problem is that I can

[R] Problem sourcing file

2012-05-25 Thread Marta Tolós
Hi all, I created a file to define some functions. When I try to source this file, sometimes it works but sometimes I get the following error: Source(‘File.R’) Error in srcfilecopy(filename, lines, file.info(filename)[1, mtime]) : unused argument(s) (file.info(filename)[1, mtime])

Re: [R] Hash Table - Select and Change Data iniside Matrix

2012-05-25 Thread Rantony
Thank you Michael. You are awesome…. It works, what I mean. Thank you very much. - Antony. From: Michael Weylandt [via R] [mailto:ml-node+s789695n4631319...@n4.nabble.com] Sent: Friday, May 25, 2012 7:48 PM To: Akkara, Antony (GE Energy, Non-GE) Subject: Re: Hash Table -

Re: [R] Basic help

2012-05-25 Thread Rui Barradas
Hello, First of all, 'c' is a bad name for a variable, it's also the name of an R function. Think a, b, k, d, ... Now, try y - m %o% x + k Hope this helps, Rui Barradas Em 24-05-2012, 2:07, Abhay Joshi http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodesuser=368600

[R] qnorm to a list

2012-05-25 Thread QAMAR MUHAMMAD UZAIR
dear jim, thakyou very much for your help. i would really appreciate if you give me one more favor. i want to apply qnorm to the whole coulmn so that i would have on the x-axis the quantile of the lognormal distribution (qnorm()) with zero-mean and unit-variance, corresponding to

Re: [R] R memory allocation

2012-05-25 Thread Martin Morgan
On 05/25/2012 06:29 AM, swaraj basu wrote: Dear All, I am running R in a system with the following configuration *Processor: Intel(R) Xeon(R) CPU X5650 @ 2.67GHz OS: Ubuntu X86_64 10.10 RAM: 24 GB* The R session info is * R version 2.14.1 (2011-12-22) Platform: x86_64-pc-linux-gnu

[R] Rolling Sample VAR

2012-05-25 Thread bantex
hi guys, I am using trivariate VAR model to get 10 step ahead orthogonalized impulse response functions. I want to use rolling sample analysis on the coefficients of the irf but I have no idea how to do that. I looked through the forums but I can't seem to find any solutions. Any suggestions

[R] count number of groups

2012-05-25 Thread Charles Determan Jr
Hello, Simple question that I am stuck on and can't seem to find an answer in the help files currently. I have a list which contains repeated ID's. I would like to have R count the number of ID's. For example: ID=c(1,1,1,1,2,2,2,2,3,3,3,3) as.data.frame(ID) Clearly, there are 3 groups. How

Re: [R] Problem sourcing file

2012-05-25 Thread jim holtman
Is the file just definitions of functions, or do you have some statements that are being executed? Could the error be coming from them? Just defining functions should work just fine. On Fri, May 25, 2012 at 10:08 AM, Marta Tolós marta.to...@gtd.es wrote: Hi all, I created a file to

[R] Problem with Autocorrelation and GLS Regression

2012-05-25 Thread and_mue
Hi, I have a problem with a regression I try to run. I did an estimation of the market model with daily data. You can see to output below: / summary(regression_resn) Time series regression with ts data: Start = -150, End = -26 Call: dynlm(formula = ror_resn ~ ror_spi_resn) Residuals: Min

[R] Breaking up a vector

2012-05-25 Thread AOLeary
Hi all, My problem is as follows: I want to run a loop which calculates two values and stores them in vectors r and rv, respectively. They're calculated from some vector x with length a multiple of 7. x - c(1:2058) I need to difference the values but it would be incorrect to difference it all

Re: [R] Problem sourcing file

2012-05-25 Thread arun
Hi, Try source(File.R) A.K. - Original Message - From: Marta Tolós marta.to...@gtd.es To: r-help@r-project.org Cc: Sent: Friday, May 25, 2012 10:08 AM Subject: [R] Problem sourcing file Hi all, I created a file to define some functions. When I try to source this file, sometimes it

Re: [R] Rolling Sample VAR

2012-05-25 Thread andrija djurovic
Hi. rollapply function for zoo package could be a useful here. library(zoo) ?rollapply Andrija On Fri, May 25, 2012 at 5:22 PM, bantex bantexmutat...@hotmail.com wrote: hi guys, I am using trivariate VAR model to get 10 step ahead orthogonalized impulse response functions. I want to use

Re: [R] count number of groups

2012-05-25 Thread R. Michael Weylandt
length(unique(ID)) Michael On Fri, May 25, 2012 at 11:38 AM, Charles Determan Jr deter...@umn.edu wrote: Hello, Simple question that I am stuck on and can't seem to find an answer in the help files currently.  I have a list which contains repeated ID's.  I would like to have R count the

Re: [R] count number of groups

2012-05-25 Thread andrija djurovic
Hi. try using table function: ID=c(1,1,1,1,2,2,2,2,3,3,3,3) table(IF) ID 1 2 3 4 4 4 Also check ?tapply function Andrija On Fri, May 25, 2012 at 5:38 PM, Charles Determan Jr deter...@umn.eduwrote: Hello, Simple question that I am stuck on and can't seem to find an answer in the help

Re: [R] R does not recognise columns and rows as they are supposed to be

2012-05-25 Thread Jonsson
Yes I did so. Yes the first values are the right ones: - -. so this meant that I should consider my data as: double/4/little Is it so? file - C:\\Users\\aalyaari\\Documents\\INRA\\WFD_reprocessed\\dialyswco\\2001\\SWdown_200101_01.img for(what in c(double, integer)) { + for(size

Re: [R] Correlograms: using boxes and different variables on rows and columns

2012-05-25 Thread Kevin Wright
In general, when you have a question about a package, it is best to contact the package author directly. (In this case, me). 1. Easy. You just have to define your own panel function. I just modified panel.shade to create panel.bar panel.bar - function(x, y, corr=NULL, ...){ usr - par()$usr

Re: [R] Breaking up a vector

2012-05-25 Thread jim holtman
Learn how to put parentheses in expression when you do not know what the operator precedence is: z - lx[(1+(i-1)*7):((i)*7)] On Fri, May 25, 2012 at 11:29 AM, AOLeary aodha...@gmail.com wrote: Hi all, My problem is as follows: I want to run a loop which calculates two values and

Re: [R] Filling NA with cumprod?

2012-05-25 Thread Jeff Newmiller
This calls for a trick I have seen before on this list. Once you understand it, you will be able to apply it to many similar problems. The key is the ave function, which applies a function to various groups of values in a vector. a - c(1, 2, 3, NA, NA, 6, 7, NA, NA, 10) f - c(0.9, 1.1, 0.9,

Re: [R] Problem with Autocorrelation and GLS Regression

2012-05-25 Thread Mark Leeds
Hi: I don't have time to look at it carefully but, at a glance, you're not getting a significant ror_spi_resn coeffficent so worrying about residuals being auto-correlated is jumping the gun because you're not really filtering anything in the first place. when you say, market model, I don't know

Re: [R] R does not recognise columns and rows as they are supposed to be

2012-05-25 Thread William Dunlap
In the absence of documentation for the file format, what=double,size=4,endian=little would be a good guess. Many problems people report on this list are due to errors in reading data into R. Converting data from one format to another is always error-prone and you need to check that the

Re: [R] R does not recognise columns and rows as they are supposed to be

2012-05-25 Thread Jonsson
The trick may be behind not reading the files properly is that all my 365 files donot have the same name. for example: files from number 1 to number9 are named for the first month: SWdown_200101_01.img SWdown_200101_09.img files from number 10 to number30 are named:

Re: [R] count number of groups

2012-05-25 Thread Charles Determan Jr
Thank you Michael, However, this only provides the number of groups without a column label. Is there a way to have it give the count with the 'ID' label? Regards, Charles On Fri, May 25, 2012 at 10:52 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: length(unique(ID)) Michael On

Re: [R] Problem with Autocorrelation and GLS Regression

2012-05-25 Thread and_mue
For the analysis I follow the approach of Keown Pinkerton ( http://e-m-h.org/KePi81.pdf http://e-m-h.org/KePi81.pdf ). They do also use daily data to compute alphas and betas of the market model. These estimated coefficients are then used to estimate abnormal returns for a given period. market

Re: [R] count number of groups

2012-05-25 Thread Charles Determan Jr
That works if I want a count of each group but I needed a count of the number of groups. Michael answered that question with length(unique(ID)) However, this doesn't supply a title, it is just a number. I need it to still have the identifier 'ID'. Regards, Charles On Fri, May 25, 2012 at 11:50

Re: [R] count number of groups

2012-05-25 Thread R. Michael Weylandt
You'll have to be a little trickier if you want it to be smart and pick up the name: [or I'm missing something obvious] yourFunc - function(x){ dsx - deparse(substitute(x)) x - length(unique(x)) names(x) - dsx x } yourFunc(ID) yourFunc(ID^2) yourFunc(ID[ID==2]) etc. Hope this

Re: [R] Problem sourcing file

2012-05-25 Thread Jeff Newmiller
It does not have anything to do with the sourcing. Rather, it lies in the code that is in your File.R, which is not given here. --- Jeff NewmillerThe . . Go Live...

Re: [R] count number of groups

2012-05-25 Thread William Dunlap
You did: ID=c(1,1,1,1,2,2,2,2,3,3,3,3) as.data.frame(ID) and I infer that you want the number of groups in each column of the data.frame. First, make an example of your data.frame D - data.frame(ID, Name=rep(state.name[1:7],len=length(ID))) (note I use data.frame, not as.data.frame, so it

[R] Query about creating time sequences

2012-05-25 Thread Shivam
Hi All, I have a query about time based sequences. I know such questions have been asked a lot on forums, but I couldnt find the exact thing that I was looking for. I want to create a time-based sequence which will mimic the trading window AND would span multiple days. Something like below:

Re: [R] Problem sourcing file

2012-05-25 Thread Duncan Murdoch
On 25/05/2012 10:08 AM, Marta Tolós wrote: Hi all, I created a file to define some functions. When I try to source this file, sometimes it works but sometimes I get the following error: Source(‘File.R’) Those aren't proper quotes, and source() shouldn't be capitalized, and you didn't

Re: [R] Problem with Autocorrelation and GLS Regression

2012-05-25 Thread Mark Leeds
Hi: Thanks for the correction and reference. Eric uses monthly returns in the example in his book and I would think that using daily data would result in very unstable betas but I've been wrong before. Hopefully others can comment. Mark On Fri, May 25, 2012 at 12:44 PM, and_mue

Re: [R] count number of groups

2012-05-25 Thread Charles Determan Jr
That works perfectly, thank you very much Michael, Sincere regards, Charles On Fri, May 25, 2012 at 11:59 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: You'll have to be a little trickier if you want it to be smart and pick up the name: [or I'm missing something obvious]

Re: [R] R does not recognise columns and rows as they are supposed to be

2012-05-25 Thread Jonsson
I tried to read only one file and get some information but this is what I got: sam=file(C:\\Users\\2001\\SWdown_200101_01.img, rb) file1- readBin(sam, double(),size=4, n=360*720) file.info(file1)$size Error in file.info(file1) : invalid filename argument dim(file1) NULL -- View this message

Re: [R] Filling NA with cumprod?

2012-05-25 Thread Igor Reznikovsky
This is a nice trick, Jeff, thank you. I think this is what I was looking for. Thank you all. On May 25, 2012 12:18 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: This calls for a trick I have seen before on this list. Once you understand it, you will be able to apply it to many similar

Re: [R] Problem sourcing file

2012-05-25 Thread Jeff Newmiller
What isn't proper about single quotes? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

Re: [R] Problem sourcing file

2012-05-25 Thread Duncan Murdoch
On 25/05/2012 2:17 PM, Jeff Newmiller wrote: What isn't proper about single quotes? They look like directional quotes to me. Might just be the mailer... Duncan Murdoch --- Jeff NewmillerThe

Re: [R] Problem sourcing file

2012-05-25 Thread Uwe Ligges
On 25.05.2012 20:17, Jeff Newmiller wrote: What isn't proper about single quotes? Those were *directed* quotes. Uwe Ligges --- Jeff NewmillerThe . . Go Live...

Re: [R] Issues while using “lift.chart” and “adjProbScore” function from ”BCA” library

2012-05-25 Thread Uwe Ligges
Please talk to the maintainer of the BCA *package* in order to report bugs. Uwe Ligges On 24.05.2012 06:31, aajit75 wrote: Dear List, Couple of issues while using functions from “BCA” library: 1. I am trying to use “lift.chart” function from “BCA” library, but facing issues while using

Re: [R] Multiple cbind according to filename

2012-05-25 Thread Ken
Matthew Ouellette mouellette89 at gmail.com writes: Hi all, I'm just a beginner with R but I have not been able to search for any relevant answer to my problem. I apologize if it has in fact been asked before. Recently I've realized that I need to combine hundreds of pairs of data

Re: [R] Breaking up a vector

2012-05-25 Thread Rui Barradas
Hello, Tip: see the difference between the following two. for(i in 1:7) cat(i, :, (i-1)*7:(i)*7, \n) for(i in 1:7) cat(i, :, ((i-1)*7):(i*7), \n) (operator ':' has high precedence...) Hope this helps, Rui Barradas AOLeary wrote Hi all, My problem is as follows: I

[R] subset columns from list with variable substitution

2012-05-25 Thread jween
Hi there, I would like to use a list variable to select columns in a subset from a parent table: I have a data frame table with column headers a,b,c,d,e,x,y,z and list variables list1=c(a,b,c,d) list2=c(a,b,x,y,z) namelist=c(peter,paul,mary,jane) group1=c(peter,paul) group2=c(mary,jane) I

Re: [R] Multiple cbind according to filename

2012-05-25 Thread Rui Barradas
Hello, You can split the filenames vector according to a pattern, filenames - c(a1.csv, a2.csv, b1.csv, b2.csv, c1.csv, c2.csv) fnpattern - gsub([[:digit:]], , filenames) df.groups - split(filenames, fnpattern) and then use this list to process each of the groups of data.frames in 'alldata',

Re: [R] Problem sourcing file

2012-05-25 Thread Jeff Newmiller
Ah, my default font makes that distinction too subtle. Action item for me, then, to change fonts. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics:

Re: [R] applying cbind (or any function) across all components in a list

2012-05-25 Thread Rui Barradas
Hello, Let me give it a try. This last post made it clear, I hope. I have two interpretations of your problem. 1. 'l1' only has three columns, corresponding to clusters (genotypes) XX, XY and YY, and 'l2' has one less column, corresponding to the midpoints between their closest genotype

Re: [R] Java problem - XLConnect/xlsx package

2012-05-25 Thread Martin Studer
Hi Rainer, Looking at your sessionInfo() it looks like you are using 32-bit R on 64-bit Windows 7. My guess is that the installed JVM is 64-bit. This leads to an architecture clash between R and Java. It is important to make sure that the architectures of R and the JVM match, i.e. either both are

[R] Reading a bunch of csv files into R

2012-05-25 Thread HJ YAN
Dear R users I am struggling from a data importing issue: I have some hundreds of csv files needed to be read into R for futher analysis. All those csv files are named in one of the three formats: (1) strings: e.g. London_Oxford street (2) Integer: e.g. 1234_5678 (3) combined: e.g. London_1234

Re: [R] Breaking up a vector

2012-05-25 Thread AOLeary
Thank you very much, I will be more careful in future. -- View this message in context: http://r.789695.n4.nabble.com/Breaking-up-a-vector-tp4631329p4631369.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] How to change width of bar when there are very few bars?

2012-05-25 Thread Manish Gupta
http://r.789695.n4.nabble.com/file/n4631371/Bar_Chart.png How to control width of bar chart when there are very few bars in plot? Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-change-width-of-bar-when-there-are-very-few-bars-tp4631371.html Sent from the R

Re: [R] Reading a bunch of csv files into R

2012-05-25 Thread Kevin Wright
See ?dir Assign the value to a vector and loop over the elements of the vector. Kevin On Fri, May 25, 2012 at 12:16 PM, HJ YAN yhj...@googlemail.com wrote: Dear R users I am struggling from a data importing issue: I have some hundreds of csv files needed to be read into R for futher

Re: [R] Hash Table - Select and Change Data iniside Matrix

2012-05-25 Thread arun
Hi Antony, Try this, da-read.table(text=NAME    AGE    PLACE    ABC    20  INDIA XYZ    30  FRANCE PQR    40  USA MNO    30   KENYA DEF    25    AUSTRALIA, header=TRUE,stringsAsFactors=FALSE) da2-function(x){  if(x==30)  TRUE  else  FALSE  }

Re: [R] difference between qnorm and qqnorm

2012-05-25 Thread Duncan Murdoch
On 25/05/2012 12:41 PM, QAMAR MUHAMMAD UZAIR wrote: dear all, it will just take you a minute to tell me the difference between qnorm and qqnorm. are they same or is there any difference between them?? They are very different, qqnorm draws a plot, qnorm does a calculation of some of the values

[R] question about TryCatch and lapply

2012-05-25 Thread John Kerpel
Folks: I've replaced an outer for-loop with lapply and it works great. But, I can't seem to do the following type of exception handling: tryCatch(dlmMLE(x)$value==Inf,error = function(e) NULL) which basically says if the likelihood is Inf, throw an error. But what I want it to do is just go

Re: [R] subset columns from list with variable substitution

2012-05-25 Thread MacQueen, Don
Instead of subset(table, select=list1) try table[, list1] However, I suspect you have other problems. Particularly, i is not defined when you use i %in% namelist. You may have wanted i in namelist -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627

Re: [R] Breaking up a vector

2012-05-25 Thread Marc Schwartz
Just to throw out another approach to the underlying problem. Since the original vector length is an integer multiple of 7, taking the 'whole object' approach that is intrinsic to R, one can convert the vector to a 7 column matrix and then use apply() to run the entire process on each 7 element

Re: [R] Reading a bunch of csv files into R

2012-05-25 Thread Bryan Hanson
HJ, try something like this: files - list.files(pattern = \\.(csv|CSV)$) for (i in 1:length(files)) { temp - read.csv(files[i], header = FALSE) ... do whatever you want with the contents of temp... } Bryan *** Bryan Hanson Professor of Chemistry Biochemistry

Re: [R] Reading a bunch of csv files into R

2012-05-25 Thread Nutter, Benjamin
For example: myDir - some file path filenames - list.files(myDir) filenames - filenames[grep([.]csv, filenames)] data_names - gsub([.]csv, , filenames) for(i in 1:length(filenames)) assign(data_names[i], read.csv(file.path(myDir, filenames[i])))   Benjamin Nutter |  Biostatistician   |  

Re: [R] question about TryCatch and lapply

2012-05-25 Thread jim holtman
Please show us the 'lapply' statement you are using. Here is a simple case of catching an error in an lapply and continuing: lapply(c(1,2,-3, 4), function(x){ + a - try(stopifnot(x 0)) # force an error + if (inherits(a, 'try-error')) return(NULL) + x + }) Error : x 0 is not TRUE

[R] knitr customization

2012-05-25 Thread Giovanni Petris
I am trying to transition from Sweave to knitr, but there are a few things about customization of the appearence of R input and output that I did not get yet. Maybe somebody on the list can help me. In my Sweave presentations I used a slanted font for the R input and a normal font for the

Re: [R] Reading a bunch of csv files into R

2012-05-25 Thread Rui barradas
Hello, Or maybe put the data frames in a list df.list - lapply(seq_len(filenames), read.csv, ...) # '...other...' are options you might want to pass, (like headers=TRUE) names(df.list) - data_names Now access the data frames by number in the list or by name in data_names. Hope this helps,

Re: [R] sweave tables as images?

2012-05-25 Thread Alexander Shenkin
grid.table() works well, but using it in sweave creates graphics with very wide margins. I'm sure this has something to do with grid, and not just grid.table. Any idea how I can clip the graphic to the edges of the table graphic? I've looked into viewports, etc, but I can't seem to find

Re: [R] subset columns from list with variable substitution

2012-05-25 Thread jween
Thanks Don but table[,list1] did not work either: Error in `[.data.frame`(table, , list1) : undefined columns selected. I'm guessing my list (list1) is not structured right? Displaying it has no commas, so the whole list may be taken as a single variable rather than a sequence of variables?

  1   2   >