Re: [R] About dpik function

2012-07-16 Thread Prof Brian Ripley
On 15/07/2012 19:57, chester123 wrote: Hi there and thanks in advance. Nowadays I am working on the plug-in bandwidth selection with R. Firstly, my So why use package KernSmooth and not the methods in R itself? 1010 data is the return rate from Yahoo Finance. Secondly, my code is following:

Re: [R] enquiry

2012-07-16 Thread Rui Barradas
Hello, Try the following. install.packages(sos) # to install the package library(sos) # to load the package nto R session finFn(xlsx)# find it Have fun. Hope this helps, Rui Barradas Em 16-07-2012 06:17, Karan Anand escreveu: hi, i am new to r ,i have a xlsx

Re: [R] Error in as.xts

2012-07-16 Thread Rui Barradas
Hello, I can see several things that are not right or may go wrong. (Without an actual dataset, this is just a series of hints.) 1. The read.csv statement. Like read.table, it creates a data.frame, which defaults to reading strings as factors, coded internally as integers. Sometimes there

Re: [R] enquiry

2012-07-16 Thread Rui Barradas
Sorry, it's findFn(xlsx) And the first three hits ARE promising (they work). I use the second, package xlsx. Package XLConnect is more flexible if you want to do things to excel spreadsheets from R. Package xlsx is simpler if you just want to read them and then use R. Rui Barradas Em

[R] Read text into a nested list

2012-07-16 Thread Remko Duursma
Dear R-list, I am looking for a way to efficiently read a text file (see example below) into a nested list. I can probably find an ugly way to do this, but I would appreciate if anyone has (ideas for) efficient solutions. It seems to me this is a bit similar to parsing XML, could tools from the

Re: [R] ROC curves with ROCR

2012-07-16 Thread Jessica Streicher
Wild guess : You need to have some kind of score for ROC to work (so you can work with a threshold), so a predict() that only returns classlabels probably won't work. On 13.07.2012, at 15:25, blerta wrote: Hi, I don't really understand how ROCR works. Here's another example with a

[R] histogram of time-stamp data

2012-07-16 Thread e-letter
Readers, A data set consists of time-stamp values: 00:00:00 23:11:00 06:22:00 The data set was imported: timestamps-read.table(path/to/timestampsvalues) hist(timestamps) ...error... x must be numeric Then tried: plot(timestamps). How to adjust the graph to create a histogram where the

Re: [R] histogram of time-stamp data

2012-07-16 Thread Jessica Streicher
pDates-as.POSIXct(times,format=%H:%M:%S) hist(pDates,hours) On 16.07.2012, at 10:47, e-letter wrote: Readers, A data set consists of time-stamp values: 00:00:00 23:11:00 06:22:00 The data set was imported: timestamps-read.table(path/to/timestampsvalues) hist(timestamps)

Re: [R] histogram of time-stamp data

2012-07-16 Thread Rui Barradas
Hello, Try the following. timestamps - as.POSIXct(Sys.Date()) + sample(24*60*60, 1e3, TRUE) h1 - cut(timestamps, breaks=hour) h2 - cut(timestamps, breaks=15 mins) op - par(mfrow=c(1, 2)) hist(as.integer(h1)) hist(as.integer(h2)) par(op) Hope this helps, Rui Barradas Em 16-07-2012 09:47,

Re: [R] GAM Chi-Square Difference Test

2012-07-16 Thread Simon Wood
Hi Will, Your edf interpretation is not quite right. The smooths are subject to a centring constraint for identifiability reasons, and this removes a degree of freedom, so EDF=1 corresponds to a straight line fit. On your second point and third points. anova(gamb1.1,gamb1.2, test=Chisq)

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread A J
Thank you very much to everybody for your fast respones. All your solutions are working well, but I keep with the same problem. When I use whatever of your proposals with a small set of colums (and/or rows), this work, but when I use the whole set of columns (and/or rows) comprising around

Re: [R] Is it possible to start R-GUI in a windowed state under Windows OS

2012-07-16 Thread Duncan Murdoch
On 12-07-15 6:15 PM, Wei Wu wrote: Is it possible to start R-Gui in a windowed state under windows? (I am running Windows 7 and Vista) I have the set the property for R icon to normal window option, but that has no effect. It always starts in what I would call a windowed state. What do you

Re: [R] Quantile Regression - Testing for Non-causalities in quantiles

2012-07-16 Thread Roger Koenker
Take a look at demo(Mel) in the quantreg package. Roger Koenker rkoen...@illinois.edu On Jul 14, 2012, at 6:55 AM, stefan23 wrote: Dear all, I am searching for a way to compute a test comparable to Chuang et al. (Causality in Quantiles and Dynamic Stock Return-Volume Relations). The aim

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread jim holtman
It sounds like you have a problem with your syntax: you are missing a quote or a parentheses. Now is the time to learn debugging 101; start by partitioning the problem. First put the column names in an object, and then split it in half and see if it works. See which half has the problem. The

[R] Confidence Intervals for IRF with Monte Carlo procedure

2012-07-16 Thread vero_acurio
Dear all, I would like to know if it is possible in R to calculate the confidence intervals when calculating the IRF of a VAR but using Monte Carlo procedures. Thanks for your help. Best, Veronica ACURIO -- View this message in context:

[R] R help

2012-07-16 Thread Sébastien Morant
hi would you please remove my email from the mailing list. thanks in advance Sebastien [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] About dpik function

2012-07-16 Thread chester123
The following is the related code and the metadata.I have tried my best to modify and test but the error always happened.I really don't know what it means. Please check it form me. Thanks in advance. Regards Date: Sun, 15 Jul 2012 23:26:57 -0700 From: ml-node+s789695n4636611...@n4.nabble.com

Re: [R] Help for Fisher's exact test

2012-07-16 Thread Guanfeng Wang
Hi, A.K., Thank you very much for your help. For the RNA-seq data, the values in columns WT and mt are raw read data. I do not have biological replicate, so it is not suitable for using edgeR for the analysis. Some papers used Fisher's exact test in R package. I do not know whether the p-value

Re: [R] how to extract p-value in GenMatch function

2012-07-16 Thread shyam basnet
Dear Peter, Thanks for your kind help. I got the solution now. Best Regards, Shyam From: Peter Ehlers ehl...@ucalgary.ca To: shyam basnet shyamabc2...@yahoo.com Cc: r-help@R-project.org r-help@r-project.org Sent: Monday, July 16, 2012 1:16 AM Subject: Re:

Re: [R] Is it possible to start R-GUI in a windowed state under Windows OS

2012-07-16 Thread Michael Sumner
Is it that R is running in SDI mode? Change and save to MDI in GUI Preferences, then restart R. Just a guess. On Monday, July 16, 2012, Wei Wu wrote: Is it possible to start R-Gui in a windowed state under windows? (I am running Windows 7 and Vista) I have the set the property for R icon to

Re: [R] Grabbing Indexes of a certain standard deviation

2012-07-16 Thread gcm
Jean, how would you modify your function to grab all the selected and not just the first? Thank you so much! From: Jean V Adams [via R] [mailto:ml-node+s789695n4636370...@n4.nabble.com] Sent: Thursday, July 12, 2012 4:59 PM To: Lauren Vogric Subject: Re: Grabbing Indexes of a certain standard

Re: [R] Grabbing Indexes of a certain standard deviation

2012-07-16 Thread Jean V Adams
residuals[abs(residuals) (2*sd)] gcm lvog...@grahamcapital.com wrote on 07/16/2012 07:07:31 AM: Jean, how would you modify your function to grab all the selected and not just the first? Thank you so much! From: Jean V Adams [via R] [ mailto:ml-node+s789695n4636370...@n4.nabble.com]

Re: [R] Grabbing Indexes of a certain standard deviation

2012-07-16 Thread gcm
But I'll need the indexes and that gives me the values. I need to then be able to make the indexes into a list of numbers. From: Jean V Adams [via R] [mailto:ml-node+s789695n4636641...@n4.nabble.com] Sent: Monday, July 16, 2012 8:38 AM To: Lauren Vogric Subject: Re: Grabbing Indexes of a certain

Re: [R] R help

2012-07-16 Thread Jessica Streicher
https://stat.ethz.ch/mailman/listinfo/r-help at the bottom… On 16.07.2012, at 10:52, Sébastien Morant wrote: hi would you please remove my email from the mailing list. thanks in advance Sebastien [[alternative HTML version deleted]] __

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread A J
Yes, I have tried it and this works. Indeed, if I use a small number of colums, all the methods proposed here are working. Following the previous mail I have splited the number of colums in 4 parts of 447 colums each one. The first and the second ones work weel, but this doesn't occur with

[R] Format Date with Time

2012-07-16 Thread Lauren Vogric
How do I format 5/1/2012 8:00:00 PM into a date? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Format Date with Time

2012-07-16 Thread Jessica Streicher
?Date ?POSIXct and here you can find the formatting symbols: http://stat.ethz.ch/R-manual/R-patched/library/base/html/strptime.html On 16.07.2012, at 15:26, Lauren Vogric wrote: How do I format 5/1/2012 8:00:00 PM into a date? [[alternative HTML version deleted]]

Re: [R] Grabbing Indexes of a certain standard deviation

2012-07-16 Thread Jean V Adams
seq(residuals)[abs(residuals) (2*sd)] gcm lvog...@grahamcapital.com wrote on 07/16/2012 07:39:20 AM: But I'll need the indexes and that gives me the values. I need to then be able to make the indexes into a list of numbers. From: Jean V Adams [via R] [

Re: [R] permutation test on paired samples

2012-07-16 Thread Holger Taschenberger
Henric, thanks a lot for the clarification. I guess your response also implies that there is no 'simple' equivalent or replacement for the (exactRankTests) function perm.test(y,x,paired = TRUE,...) in the package coin. Perhaps it will be added in the future. Meanwhile I can use your

[R] Tk grid problem

2012-07-16 Thread vincent guyader
Hi everybody, I have a problem with the grid function in tk. I juste try to put 4 buttons like this: --- ||| || C| | A|| ||| -- D| ||| | B|| --- A is 2x2 C is

Re: [R] Tk grid problem

2012-07-16 Thread peter dalgaard
On Jul 16, 2012, at 16:13 , vincent guyader wrote: Hi everybody, I have a problem with the grid function in tk. I juste try to put 4 buttons like this: --- ||| || C| | A|| ||| -- D| |

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread Petr Savicky
On Mon, Jul 16, 2012 at 03:10:22PM +0200, A J wrote: Yes, I have tried it and this works. Indeed, if I use a small number of colums, all the methods proposed here are working. Following the previous mail I have splited the number of colums in 4 parts of 447 colums each one. The first and

[R] Data from Stock and Watson or DAgostino papers?

2012-07-16 Thread Matt Considine
Hello, I am interested in looking at the dataset used by Stock and Watson in their Macroeconomic Forecasting Using Diffusion Indexes (J. of Business and Econ. Statistics, April 2002, pp158-161) or the set used by D'Agostino and Giannone Comparing Alternative Predictors [...](October 2006) in

Re: [R] Data from Stock and Watson or DAgostino papers?

2012-07-16 Thread Michael Weylandt
Not a direct answer, but CRAN package quantmod can get FRED data for you, which may be of help. Michael On Jul 16, 2012, at 10:15 AM, Matt Considine m...@considine.net wrote: Hello, I am interested in looking at the dataset used by Stock and Watson in their Macroeconomic Forecasting Using

Re: [R] Tk grid problem

2012-07-16 Thread j verzani
vincent guyader vincent.guyader at gmail.com writes: Hi everybody, I have a problem with the grid function in tk. I juste try to put 4 buttons like this: --- ||| || C| | A|| ||| -- D| |

Re: [R] HLOOKUP in R

2012-07-16 Thread John Kane
My understanding of HVLOOKUP, based on a through 30 second reading of some on-line documenation is that tht it sets up a grid table?) of values and if one feeds it the value in the first horizontal vector and a row number it returns the value in that row. so if df1[,10] == 15 and you want

Re: [R] HLOOKUP in R

2012-07-16 Thread jim holtman
There is a range_lookup parameter which specifies if you want an exact match (which is what the solution below assumes), or if you want the next largest value less than the search value returned; in this case you would want to use 'findInterval'. On Mon, Jul 16, 2012 at 12:04 PM, John Kane

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread A J
I guess R is enough poweful to subset greater than 300x300. But if it is a problem regarding dataset I am wondering why codes are working splitting the 1788 journal label set into 6 groups of around 300 labels... Summarizing: if you put the whole set it doesn't work. If you divide into groups

[R] Combining Data Frames

2012-07-16 Thread Lauren Vogric
I have 2 data tables. Each hold information categorized into Date and Price. What I need to do is combine the two to get 2 columns of Date and Price, by continuing the table downwards with the new rows supplied from the second table. So, for example I have 5/1/12 2 5/2/12 5 As data table 1

Re: [R] Format Date with Time

2012-07-16 Thread Hasan Diwan
Ms Vogric, as.POSIXct should be able to help there... On 16 July 2012 06:40, Jessica Streicher j.streic...@micromata.de wrote: ?Date ?POSIXct and here you can find the formatting symbols: http://stat.ethz.ch/R-manual/R-patched/library/base/html/strptime.html On 16.07.2012, at 15:26,

Re: [R] Format Date with Time

2012-07-16 Thread jim holtman
as.POSIXct(5/1/2012 8:00:00 PM, format = %m/%d/%Y %I:%M:%S %p) [1] 2012-05-01 20:00:00 EDT On Mon, Jul 16, 2012 at 9:26 AM, Lauren Vogric lvog...@grahamcapital.com wrote: How do I format 5/1/2012 8:00:00 PM into a date? [[alternative HTML version deleted]]

Re: [R] Combining Data Frames

2012-07-16 Thread jim holtman
?rbind On Mon, Jul 16, 2012 at 1:17 PM, Lauren Vogric lvog...@grahamcapital.com wrote: I have 2 data tables. Each hold information categorized into Date and Price. What I need to do is combine the two to get 2 columns of Date and Price, by continuing the table downwards with the new rows

Re: [R] Combining Data Frames

2012-07-16 Thread Jorge I Velez
?rbind HTH, Jorge.- On Mon, Jul 16, 2012 at 1:17 PM, Lauren Vogric wrote: I have 2 data tables. Each hold information categorized into Date and Price. What I need to do is combine the two to get 2 columns of Date and Price, by continuing the table downwards with the new rows supplied from

Re: [R] Error in as.xts

2012-07-16 Thread Rui Barradas
Hello, I'm glad it helped. Your attachment came in corrupted. It's better to save the file as csv or tab or space separated values text file. Use write.table or write.csv to save the data. Even if there's a transmission problem, most of it will be intact, just delete a row or so. Rui

Re: [R] identifying local maxima

2012-07-16 Thread Gary Dong
Thanks, Hans. Much appreciated! I'm also wondering, if a population center (local maxima) is defined as a contiguous cluster of neighborhoods with population density that is significantly higher than the neighborhoods surrounding it, will things become easier? I mean, the identification of local

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread William Dunlap
Did you ever show the code that caused the problem? In particular, was it one very long line of code? It is possible that copying and pasting a long line into R might cause problems, but the details would depend on which OS you are using and which user interface you are using. The + prompt means

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread Nordlund, Dan (DSHS/RDA)
And we have one more demonstration of why the posting guide calls for a reproducible example. Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204 -Original

[R] RODBC connection to locked Excel2010 files

2012-07-16 Thread JW EL
Hi, I am trying to connect to an Excel2010 file while another user is entering data. (Obviously it would be better to set up a SQL database, but this is not an option at this point.). Typically we are not working on the same sheets. However, if possible I like to read the most current excel file

Re: [R] Error in as.xts

2012-07-16 Thread Rui Barradas
Hello, I couldn't reproduce your error, with the csv file, your code run at the first try. Here is exactly what I've done dat - read.csv(diveData_2008.csv, header=TRUE, stringsAsFactors=FALSE) # This 'DateTime' will be used again later. DateTime - with(dat, paste(date, time)) DateTime -

Re: [R] computing a subset using a loop

2012-07-16 Thread burton030
Hi, thanks I think now I understand how it works... I m using now this code for the first specie in all my transect IDs. df.s - split(Baumdaten, list(Baumdaten$transectID, Baumdaten$Baumart), drop = TRUE) head(names(df.s), 10) A_SEF_Abies alba A_LEF_Abies alba B_SEF_Abies alba B_LEF_Abies alba

[R] problem with installing R pacakges

2012-07-16 Thread Kishor Tappita
Dear R- Users, I am unable to install R packages over the internet. Below is my session information. My guess is that this may be a proxy issue. I have set the http_proxy_user : my user id(network id) : password (machine password) . The error I get is as below install.packages(MASS) Warning:

[R] as.xts

2012-07-16 Thread Yolande Tra
Hello, Attached is the file created from as.xts. After submitting the following code, I got an error. Please help. Thanks. diveCond - data.frame(matrix(0, nrow=61, ncol=17)) names(diveCond) - c(dive_id, timestamp, visability, r_wvht, r_dpd, r_apt, r_mwd, r_wtmp, l_salinity, l_o2, l_hs, l_tp,

Re: [R] Column create and Update using function

2012-07-16 Thread Rantony
Hi Arun, I will explain more clearly what I need. Here I have an array MinMax with 2 column Max and Min MinMax – it is like Min Max -- 36 1 5 And I have an matrix with same dimension [same dimension is must] MyMatrix – ABCXYZ

Re: [R] variable (column) in a data frame

2012-07-16 Thread Frans Marcelissen
Hoi Pauli, There is a difference between two ways of accessing columns in a matrex: df$aaa NULL df[AAA] Error in `[.data.frame`(df, AAA) : undefined columns selected So df[AAA] or df[,AAA] gives the error message you expect. --- Frans -Oorspronkelijk bericht- Van:

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread arun
Hello, Have you tried subsetting smaller number of columns (say 5 or 6) from the 2000 column dataset?  If it is not working, then there might be problems in reading the dataset. A.K. From: A J anxu...@hotmail.com To: smartpink...@yahoo.com Cc:

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread arun
Hi, If you think that R may not be able to subset greater than 300X300, Try this: m-matrix(numeric(350*2000),ncol=2000)   colnames(m)-paste(X,1:2000,sep=)  rownames(m)-paste(X,1:350,sep=)   m[c(X6,X20,X151,X180),c(X25,X150,X1500,X1750)] X25 X150 X1500 X1750 X6 0    0 0 0 X20   

Re: [R] remove loop which compares row i to row i-1

2012-07-16 Thread jcrosbie
Thank you, That was very helpful. I do have another problem along the same lines. But I can not think of a way to do this with a function like ddply or aggregate. Example: x = sample(0:1,42,TRUE) [1] 1 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 0 0 0 0 I want to

[R] Network help

2012-07-16 Thread Lorcan Treanor
Dear Sir/ Madam, I was wondering if someone could help me. I am trying to calculate closeness centrality in R with a toy example: ida,idb 1,2 1,5 2,4 3,2 6,1 2,6 7,2 d- read.table(D:/data test/snatest.txt, header=F, sep=,) attach(d) d e-network(d,directed=F,bipartite=7) plot(e)

Re: [R] read mignight as 24:00 and not as 0:00

2012-07-16 Thread Sandy Adriaenssens
Hi Dan, Thank you for your answer. I 'll try to provide some more information: I have only hourly data that go from 1:00:00 to 24:00:00, no minutes or seconds. These data represent the average of measured valuesof the previous hour (so 1:00:00 is the average of 0:00:00 to 1:00:00 data). I can

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread Sarah Goslee
Hi, Did you follow up on Bill's suggestion? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of William Dunlap Sent: Monday, July 16, 2012 10:39 AM To: A J; smartpink...@yahoo.com Cc: r-help@r-project.org Subject: Re: [R]

Re: [R] Maximum number of patterns and speed in grep

2012-07-16 Thread mdvaan
Thanks! That worked like a charm. Math Gabor Grothendieck wrote On Fri, Jul 13, 2012 at 1:41 PM, mdvaan lt;mathijsdevaan@gt; wrote: Here's some data (which should give you the error messages): # read in data data - read.csv(https://dl.dropbox.com/u/13631687/data.csv;, header =

[R] extract number from a mixture of character and number

2012-07-16 Thread york8866
Hi, all, I have a column like the following: ID TIME sub_001 0 sub_001 24 sub_002 0 sub_00224 sub_003 0 sub_00324

[R] Finding and manipulation clusters of numbers in a sequence of numbers

2012-07-16 Thread mdvaan
Hi, I have the following sequence: in - c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 0, 0, 2) From this sequence I would like to get to the following sequence: out - c(0, 0, 0, 3, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,

[R] RODBC connection to locked Excel2010 files

2012-07-16 Thread JW EL
Hi, I am trying to connect to an Excel2010 file while another user is entering data. (Obviously it would be better to set up a SQL database, but this is not an option at this point.). Typically we are not working on the same sheets. However, if possible I like to read the most current excel file

Re: [R] HLOOKUP in R

2012-07-16 Thread John Kane
My quick read of the HVLOOLUP text suggests that an exact match is what is done in Excel or other spreadsheets. But then, I've never used it. I get the impression is often used for things like price lookups. John Kane Kingston ON Canada -Original Message- From: jholt...@gmail.com

Re: [R] as.xts

2012-07-16 Thread John Kane
Yolande, Attached files are usually deleted from the r-help list and I see no sign of your file. You can use the function dput() to output the your file in a format that you can paste into your email and which other readers can paste into R and use. See ?dput for more information. John Kane

Re: [R] remove loop which compares row i to row i-1

2012-07-16 Thread Jorge I Velez
Hi, Here is one way using rle(): x = sample(0:1,42,TRUE) rle(x) Run Length Encoding lengths: int [1:16] 2 2 2 3 1 1 2 1 3 3 ... values : int [1:16] 1 0 1 0 1 0 1 0 1 0 ... x [1] 1 1 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 1 0 r - rle(x) rle(x) Run

Re: [R] extract number from a mixture of character and number

2012-07-16 Thread Jorge I Velez
Hi, Check ?gsub and the examples there. Here is a piece of code to get you started: s - sub_001 gsub(sub_, , s) [1] 001 HTH, Jorge.- On Mon, Jul 16, 2012 at 12:04 PM, york8866 wrote: Hi, all, I have a column like the following: ID TIME sub_001

Re: [R] extract number from a mixture of character and number

2012-07-16 Thread Sarah Goslee
Hi, There are lots; the best choice depends on whether your ID values always start with sub_ or not, and you aren't clear. Here's a general case: testdata - c(sub_001, sub_002, sub_003) gsub([^0-9], , testdata) You can use as.numeric() to convert them if desired. If you use dput() to provide

Re: [R] Finding and manipulation clusters of numbers in a sequence of numbers

2012-07-16 Thread Gabor Grothendieck
On Mon, Jul 16, 2012 at 12:17 PM, mdvaan mathijsdev...@gmail.com wrote: Hi, I have the following sequence: in - c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 0, 0, 2) From this sequence I would like to get to the

Re: [R] Finding and manipulation clusters of numbers in a sequence of numbers

2012-07-16 Thread William Dunlap
Is f() what you want? It wastes some time doing things that don't have to be done but is pretty easy to understand. input - c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 0, 0, 2) out - c(0, 0, 0, 3, 3, 0, 0, 0, 1, 0,

Re: [R] rgamma function

2012-07-16 Thread Chandler Zuo
Sorry that I posted the wrong syntax. My initial program is very long and I tried to post the section where I have been narrowed to locate the problem. In this sample I am simulating a Gamma with size parameter 5000 and scale parameter 1. I plugged in many breaks in my initial program and

Re: [R] Error in as.xts

2012-07-16 Thread Rui Barradas
Hello, You'll never get a df with 97 rows with that dataset. Just look. (The last dive_id is 97 but it starts at 62, not at 1.) dat - read.csv(diveData_2009.csv, header=TRUE, stringsAsFactors=FALSE) # DateTime - with(dat, paste(date, time)) DateTime - as.POSIXct(DateTime, format=%m/%d/%Y %H:%M)

Re: [R] computing a subset using a loop

2012-07-16 Thread jim holtman
If you just wanted to do a boxplot of one of the subset, you would do something like: boxplot(df.s[[A_SEF_Abies alba]]$age) If you wanted to do it for all the subset, then something like: lapply(df.s, function(.sub) boxplot(.sub$age)) On Mon, Jul 16, 2012 at 11:14 AM, burton030

Re: [R] Tk grid problem

2012-07-16 Thread vincent guyader
thanks for your answer, i will try this. Regards 2012/7/16 j verzani jverz...@gmail.com vincent guyader vincent.guyader at gmail.com writes: Hi everybody, I have a problem with the grid function in tk. I juste try to put 4 buttons like this: --- ||

Re: [R] Tk grid problem

2012-07-16 Thread vincent guyader
it's work: require(tcltk) tt - tktoplevel(borderwidth=10) A.but - tkbutton(tt,text=A,command=function()ls()) B.but - tkbutton(tt,text=B,command=function()ls()) C.but - tkbutton(tt,text=C,command=function()ls()) D.but - tkbutton(tt,text=D,command=function()ls())

Re: [R] read mignight as 24:00 and not as 0:00

2012-07-16 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Sandy Adriaenssens Sent: Monday, July 16, 2012 8:10 AM To: r-help@r-project.org Subject: Re: [R] read mignight as 24:00 and not as 0:00 Hi Dan, Thank you for your answer. I

Re: [R] rgamma function

2012-07-16 Thread Thomas Lumley
On Mon, Jul 16, 2012 at 12:49 PM, Chandler Zuo z...@stat.wisc.edu wrote: Sorry that I posted the wrong syntax. My initial program is very long and I tried to post the section where I have been narrowed to locate the problem. In this sample I am simulating a Gamma with size parameter 5000 and

Re: [R] histogram of time-stamp data

2012-07-16 Thread e-letter
On 16/07/2012, r-help-requ...@r-project.org r-help-requ...@r-project.org wrote: -- Message: 77 Date: Mon, 16 Jul 2012 10:48:39 +0100 From: Rui Barradas ruipbarra...@sapo.pt To: e-letter inp...@gmail.com Cc: r-help@r-project.org Subject: Re: [R]

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread Sarah Goslee
Put the code in a text file in your working directory. Within R, source(mycode.txt) or whatever you called it. If someone suggests a command you don't know, reading the help, eg ?source is always a good idea. If you are copying and pasting very long commands, you may overflow the clipboard

Re: [R] histogram of time-stamp data

2012-07-16 Thread Rui Barradas
Hello, Em 16-07-2012 22:45, e-letter escreveu: On 16/07/2012, r-help-requ...@r-project.org r-help-requ...@r-project.org wrote: -- Message: 77 Date: Mon, 16 Jul 2012 10:48:39 +0100 From: Rui Barradas ruipbarra...@sapo.pt To: e-letter

Re: [R] extracting rows and columns from a big matrix

2012-07-16 Thread A J
OK Sarah: Thanks a million to everybody. I will follow all your advices. Really I don't want to disturb more with this topic. So at this point, I have all information I need and we can consider this is it. Best, AJ Date: Mon, 16 Jul 2012 18:27:40 -0400 Subject: Re: [R] extracting rows and

[R] Cost Effectiveness Example

2012-07-16 Thread Noah Silverman
Hello, I'm tasked with putting together a cost effectiveness analysis on a proposed medical treatment. The standard suggested by someone is an expensive commercial package names TreeAge Pro which looks like its just a fancy GUI on top of a decision tree. However, we don't have it and it is

[R] Trapping option settings

2012-07-16 Thread David A Vavra
Something has been changing the setting the width option to 1 and not resetting it. It does this intermittently. What I would like to do is trap changing the setting so I can determine where the change is occurring and hopefully fix it. Is there any easy way to do this?

Re: [R] Trapping option settings

2012-07-16 Thread jim holtman
Here is one way by redefining 'options' so you can check for 'width' and then call the 'options' in 'base': options - # define 'options' in Global + function(...) + { + args - list(...) # get arguments + if ('width' %in% names(args)){ # see if 'width' is in them + .caller -

Re: [R] Mann-Whitney by group

2012-07-16 Thread Oxenstierna
lapply(thing, function(x) x[['p.value']]) --works very well, thank you. Not to be a chore, but I'm interested in comparing the results of wilcox.test--and the methodology we've employed so far--with the results and methodology of wilcox_test (library(coin)). So, I'd like to compare groups 5 and

Re: [R] R-help Digest, Vol 113, Issue 19

2012-07-16 Thread e-letter
On 16/07/2012, r-help-requ...@r-project.org r-help-requ...@r-project.org wrote: -- Message: 77 Date: Mon, 16 Jul 2012 10:48:39 +0100 From: Rui Barradas ruipbarra...@sapo.pt To: e-letter inp...@gmail.com Cc: r-help@r-project.org Subject: Re: [R] histogram of

[R] about dpik

2012-07-16 Thread chester123
Thank you for your reply. I know the x in dpik() means the vector. But I don't know how to import into c() with a huge metadata (1000). Following is my some try, and the h is: [1] 0.001180569, which seems to be feasible.

[R] Help with correlation matrices, thresholding

2012-07-16 Thread Drinniol
Hello, I am new to R and have a problem I have had some trouble with. Basically I have a list of some 8 genes or so with data points for expression levels at various time points/conditions. I also have subsets of these, usually only a few hundred genes in size, known to be associated with

Re: [R] enquiry

2012-07-16 Thread Erdal Karaca
Just tried XLConnect which seems to work without any problems... When defining this: wb - loadWorkbook(c:\\path-to-xls-file) readCell - function(sheet, row, col) { readWorksheet(wb, sheet, startRow=row, endRow=row, startCol=col, endCol=col, header=FALSE)[[1]] } then, calling the function like

Re: [R] Help with correlation matrices, thresholding

2012-07-16 Thread chuck.01
Try this as a starting point; dat is your whole data set, and r = correlation coefficient threshold: spec.cor - function (dat, r, ...) { x - cor(dat, ...) x[upper.tri(x, TRUE)] - NA i - which(abs(x) = r, arr.ind = TRUE) data.frame(matrix(colnames(x)[as.vector(i)], ncol = 2),

Re: [R] Help for Fisher's exact test

2012-07-16 Thread Guanfeng Wang
Hi, A.K, Thank you so much for your help. I did use DEGseq for analyzing the RNA-seq data, but I am not confidence about it, because most papers using it have biological replicates, I did not. And it is a good idea to ask the author who has used Fisher exact test for publication. Thanks

Re: [R] Column create and Update using function

2012-07-16 Thread arun
Hi Antony, It's the same code, but made a little modification.  I think still you can use my previous code as a more generic one as it will calculate the 'min' and 'max' for each columns if that is that case. #Anyway, try this: ##

Re: [R] Help for Fisher's exact test

2012-07-16 Thread Steve Lianoglou
Hi, You can see how to perform a Fisher's exact test by looking at its documentation: R ?fisher.test Note that section 2.7 of the edgeRUsersGuide is entitled What to do if you have no replicates, which you might want to read through:

Re: [R] Mann-Whitney by group

2012-07-16 Thread R. Michael Weylandt
On Mon, Jul 16, 2012 at 3:39 PM, Oxenstierna david.chert...@gmail.com wrote: lapply(thing, function(x) x[['p.value']]) --works very well, thank you. Not to be a chore, but I'm interested in comparing the results of wilcox.test--and the methodology we've employed so far--with the results and

Re: [R] Help with correlation matrices, thresholding

2012-07-16 Thread Bert Gunter
I suggest you post this on the Bioconductor list instead, as it would seem much more relevant to your concerns. -- Bert On Mon, Jul 16, 2012 at 1:55 PM, Drinniol drinn...@gmail.com wrote: Hello, I am new to R and have a problem I have had some trouble with. Basically I have a list of some

Re: [R] as.xts

2012-07-16 Thread David Winsemius
On Jul 16, 2012, at 1:26 PM, John Kane wrote: Yolande, Attached files are usually deleted from the r-help list and I see no sign of your file. If you said that most attached files are scrubbed because posters did not read the Posting guide to determine which file types were acceptable,

Re: [R] remove loop which compares row i to row i-1

2012-07-16 Thread David Winsemius
On Jul 16, 2012, at 10:27 AM, jcrosbie wrote: Thank you, That was very helpful. I do have another problem along the same lines. But I can not think of a way to do this with a function like ddply or aggregate. Example: x = sample(0:1,42,TRUE) [1] 1 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1

[R] Arcgis in R

2012-07-16 Thread Pedro09
Hi all, I am very knew to this R and Arcgis combination. I have already spent days attempting to find my answer but have failed, therefore could you please if possible explain any answers in simple form. I am trying to access Arcgis through R, following a few steps: 1) Set up working directory

Re: [R] Column create and Update using function

2012-07-16 Thread Rantony
Hi Arun. Thank a lot. This code working fine ! – Thanks a lot. From: arun kirshna [via R] [mailto:ml-node+s789695n4636716...@n4.nabble.com] Sent: Tuesday, July 17, 2012 8:05 AM To: Akkara, Antony (GE Energy, Non-GE) Subject: Re: Column create and Update using function Hi Antony,

  1   2   >