similar to: [Fwd: formatting using the write statement]

Displaying 20 results from an estimated 300 matches similar to: "[Fwd: formatting using the write statement]"

2011 May 18
4
Loop stopping after 1 iteration
Hi all, This is a very basic question, but I just can't figure out why R is handling a loop I'm writing the way it is. Here is the script I have written: grid_2_series<-function(gage_handle,data_type,filename) series_name<-paste(gage_handle,data_type,sep="_") data_grid<-read.table(file=paste(filename,".txt",sep=""))
2011 Apr 04
1
moving mean and moving variance functions
Hello Lets say as an example I have a dataframe with the following attributes: rownum(1:405), colnum(1:287), year(2000:2009), daily(rownum x colnum x year) and foragePotential (0:1, by 0.01). The data is actually stored in a netcdf file and I'm trying to provide a conceptual version of the data. Ok. I need to calculate a moving mean and a moving variance for each cell on the following
2011 Jun 23
2
Confidence interval from resampling
Dear R gurus, I have the following code, but I still not know how to estimate and extract confidence intervals (95%CI) from resampling. Thanks! ~Adriana #data penta<-c(770,729,640,486,450,410,400,340,306,283,278,260,253,242,240,229,201,198,190,186,180,170,168,151,150,148,147,125,117,110,107,104,85,83,80,74,70,66,54,46,45,43,40,38,10) x<-log(penta+1) plot(ecdf(x),
2007 Mar 04
1
Scoping issue?
Hello, The code below is supposed to be a wrapper for matplot to do columnwise visible comparison of several matrices, but I'm doing something wrong because I can't access an argument called 'colnum'. I'd be most grateful for some insight. Thanks, John Thaden Little Rock, AR ################################ # mmatplot is a matplot wrapper to compare the same column of #
2006 Aug 08
3
Pairwise n for large correlation tables?
Hello, I'm using a very large data set (n > 100,000 for 7 columns), for which I'm pretty happy dealing with pairwise-deleted correlations to populate my correlation table. E.g., a <- cor(cbind(col1, col2, col3),use="pairwise.complete.obs") ...however, I am interested in the number of cases used to compute each cell of the correlation table. I am unable to find such a
2006 Jan 26
1
Help constructing a find_by_sql command
Hello all. I am trying to do the equivalent of: @componentlogs = Componentlog.find(:all, :conditions => [ "cl_compname like ?", @criteria ], :offset => offset, :limit => items_per_page, :order => "cl_spr DESC" ) in a find_by_sql statement. I cannot use the build in because the adaptor isn''t quite right (OCI8) When I use it I get the following error
2007 Jun 06
2
lookup in CSV recipe
I await Luke''s node settings implementation with interest. At the moment however, I have this sort of ugliness: $site = $hostname ? { fred => "opsera", barney => "bedrock", default => "unknown site", ... } So I''ve knocked up this little function to use CSV files instead. Now I can just do: $site =
2006 Jan 25
4
Cannot :order when using :offset and :limit in find
Hello all. I am using the Paginate_with_ajax code as described on the wiki but I am running into the following problem. The following code will work fine and retrieved unsorted records in a hunky dory fashion: @componentlogs = Componentlog.find(:all, :conditions => [ "cl_compname like ?", @criteria ], :offset => offset, :limit => items_per_page ) However if I try and add an
2009 Jan 22
2
"latex" in Hmisc: cell formating
Hi list, Could you explain the error I see here? Thanks! ## I'm using R 2.8.0 on WinXP, Hmisc_3.4-3 > table1 <- matrix(10, 180,7) > cell.format <- matrix("", ncol=7, nrow=180) > cell.format[c(seq(3,180,6),seq(4,180,6)),] <- "color{red}" > cell.format[c(seq(5,180,6),seq(6,180,6)),] <- "color{green}" > > latex(table1,
2007 Nov 08
6
Extract correlations from a matrix
Dear R users, suppose I have a matrix of observations for which I calculate all pair-wise correlations: m=matrix(sample(1:100,replace=T),10,10) w=cor(m,use="pairwise.complete.obs") How do I extract only those correlations that are >0.6? w[w>0.6] #obviously doesn?t work, and I can?t find a way around it. I would very much appreciate any help! Best wishes Christoph (using R
2008 Jul 29
1
correlation between matrices - both with some NAs
Hi everyone, I'm having trouble applying the Cor() function to two matrices, both of which contain NAs. I am doing the following: a<-cor(m1, m2, use="complete.obs") ... and I get the following error message: Error in cor(m1, m2, use = "complete.obs") : no complete element pairs Does anyone know how I can apply a correlation, ignoring any NAs? Thanks, rcoder --
2010 May 30
1
Count the number of consecutive 1's
Hi All, We have a raw dataset that, on the sampling time column, for example: t <- c(0,1,2,5,0,5,0,2,5) And we need to create a second column that indicates the day of the sampling, so the end result of what we want is a vector: 1,1,1,1,2,2,3,3,3 Additional information that might simplify the matter is that, for each day, the time starts with zero and ends with 5. I am a beginner with R.? So
2012 Oct 09
4
Convert COLON separated format
I have a bunch of data sets that were created for the libsvm tool. They are in "colon separated sparse format". i.e. 1 5:1 27:3 345:10 Is a row with the label of "1" and only has values in columns 5, 27, and 345. I want to read these into a data.frame in R. Is there a simple way to do this? -- Noah Silverman, M.S. UCLA Department of Statistics 8117 Math Sciences
2004 Mar 19
2
for loop or Hmisc library trap.rule function syntax error
Hello: I am new R user stumped why the R code after this paragraph generates "Error: syntax error" messages after each of the last 2 lines. I have tried searching the manuals, Hmisc documentation, contributed manuals, help archives, and Internet. I am running R 1.7.1 under Windows 2000 (I will upgrade when my imminent OS upgrade happens). My data was successfully entered and
2006 Aug 02
5
Finding the position of a variable in a data.frame
Simple problem but I don't see the answer. I'm trying to clean up some data I have 120 columns in a data.frame. I have one value in a column named "blaw" that I want to change. How do I find the coordinates. I can find the row by doing a subset on the data.frame but how do I find out here "blaw " is in columns without manually counting them or converting names(Df) to a
2006 Jan 13
19
Problems with scaffold''s parameter on Oracle
Hi I run Ruby on Rails on Oracle XE. I have a simple table: create table customer(id number primary key, name varchar2(100)); And ruby script\generate model Customer ruby script\generate controller Customer http://localhost:3000/customer/ - show a fine list, but when I click show/edit/destroy, I get an ORA-01722: OCIError: ORA-01722: invalid number: select * from (select raw_sql_.*,
2009 May 28
1
Error: argument is of length zero
Hi, I have the following: for(j in (y.raw+1):(rownum-1)){ valsum<-tstfframed[min.x,j]+tstfframed[min.x,j+1] if(valsum == 1){ cat("valsum loop") int.num<-int.num+1 } } but I get the error message: "Error in if (valsum == 1) { : argument is of length zero". I checked whether to see if all the stated variables have associated values (and are not NAs) and
2011 Dec 07
1
data frame and cumulative sum
Hello, I have a data frame that looks like this (containing interarrival times): > str(df) 'data.frame': 18233 obs. of 1 variable: $ Interarrival: int 135 806 117 4 14 1 9 104 169 0 ... > head(df) Interarrival 1 135 2 806 3 117 4 4 5 14 6 1 > This corresponds to the time differences (in ms) of a poisson arrival
2012 Feb 24
6
strange behaviour of "POSIXlt" "POSIXt" object
Hi, Does anybody know why get I this kind of strange situation: Browse[2]> hcEnd [1] "2009-03-29 06:30:00" Browse[2]> class(hcEnd) [1] "POSIXlt" "POSIXt" Browse[2]> is.na(hcEnd) [1] TRUE This issue is the source of my all issues in my program, Thanks for your help -- View this message in context:
2008 Jul 18
0
spreading the risk
This is for ACroske but I can't find his email so I'll just send it to the list. Hi ACroske: The code below takes a zeros and ones matrix and puts ones in the places you wanted. It can be made shorter ( maybe ?. i haven't thought about that ) but first let me know if that's what you wanted ? The original matrix is called binary.matrix and the final matrix is called tempbinmat.