similar to: Running code sequentially from separate scripts (but not functions)

Displaying 20 results from an estimated 7000 matches similar to: "Running code sequentially from separate scripts (but not functions)"

2009 Mar 09
1
Data Restructuring Question
I think I am overlooking a call or concept in R to help me easily and quickly restructure my data.frame:   Sometimes the data I receive looks like: VariableName, Run1, Run2, Run3, Location temp,               15.0,  16.0,  17.0, There   And other times it looks like: VariableName, Run, Location temp,               17.0, There   I would like to use the header information in order to be able to
2017 Oct 21
2
Help_urgent_how to calculate mean and sd in biomod 2
Hello I am new in R. I am trying to implement Biomod 2 package. However, I have a doubt. I want to calculate the mean and sd of "Testing.data" (ROC and TSS) > # let's print the ROC scores of all selected models > myBiomodModelEval_55["ROC","Testing.data",,,] RUN1 RUN2 RUN3 RUN4 RUN5 RUN6 RUN7 RUN8 RUN9 RUN10 0.938 0.938 0.926 0.931 0.939
2007 Feb 22
2
[LLVMdev] opt -verify
I am writing an interprocedural compiler pass. Because the passneeds information from a FunctionPass, e.g., the post-dominance frontier (PDF), and because a ModulePass is not permitted to require a FunctionPass, I am forced to make my pass a FunctionPass and do majority of its work in the doFinalization() method. When I run "opt -mypass -verify -o code2.bc code1.bc" I get no
2007 Feb 22
3
[LLVMdev] opt -verify
I followed what you said and called verifyModule() with the AbortProcessAction option. verifyModule() returns false, but does not abort and does not print out any information about what caused the verification to fail. Chris Lattner wrote: > On Wed, 21 Feb 2007, Ryan M. Lefever wrote: >> I am writing an interprocedural compiler pass. Because the passneeds >> information from a
2010 Jul 02
2
merging plot labels in a lattice plot
Hi, I have a lattice lot conditioned on two variables. Example code is: library(lattice) x <- data.frame(d=runif(100), f1=sample(c('yes', 'no'),100,replace=TRUE), f2=c(rep('Run1',30),rep('Run2',30),rep('Run3',40))) histogram(~d | f1 + f2, x) In the plot, for a given value of f2, there are two panels, one for 'n'
2007 Feb 22
0
[LLVMdev] opt -verify
I also tried iterating through the functions of the module and calling verifyFunction(), which also returns false, but does not cause an abort or report anything to stderr about what caused the verification to fail. From the doxygen for verifyFunction() and verifyModule(), it seems like they both should print information to stderr if the verification fails and should abort opt if
2010 Oct 01
3
Suppressing printing in the function
Hello! I wrote a function that returns a data frame. Nowhere in the function do I say print(my.data.frame), but when I run the function - the data frame is printed on the console. Is there any way to suppress it? Thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2011 Feb 25
6
preventing repeat in "paste"
Hello! s<-"start"; e<-"end" middle<-as.character(c(1,2,3)) I would like to get the following result: "start 123 end" or "start 1 2 3 end" or "start 1,2,3 end" How can I avoide this (undesired) result: paste(s,middle,e,sep=" ") Thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2009 May 20
1
Plot data from table with column and row names
Dear All Sorry for what appears a trivial matter - I'm new to R and am stumbling ahead. I have a table of numerical data (36 rows by 12 columns) such as below: GM1 GM2 GM3 GM4 GM5 ...etc GM12 Run1 1 2 1 2 3 ... Run2 2 1 3 2 1 ... ... Run36 2 1 1 1 1 I would like to plot simple line graphs of some of the runs or
2009 Oct 13
4
replacing period with a space
Dear R-ers! I have x as a variable in a data frame x. x<-data.frame(x=c("aa.bb","cc.dd.ee")) x$x<-as.character(x$x) x I am sorry for such a simple question - but how can I replace all periods in x$x with spaces? sub('.', ' ', x$x) - removes all letters to the left of each period... Thanks a lot for your advice! -- Dimitri Liakhovitski Ninah.com
2010 Mar 04
4
Analogue to SPSS regression commands ENTER and REMOVE in R?
I am not sure if this question has been asked before - but is there a procedure in R (in lm or glm?) that is equivalent to ENTER and REMOVE regression commands in SPSS? Thanks a lot! -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com
2010 Oct 25
3
finding the year of a date
I know that I can use as.yearmon in the package "zoo" to find the year and the month of a date. I can use as. yearqtr to find the year and the quarter. But how can one find just the year of a date? Thanks a lot! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2010 Mar 30
4
Code is too slow: mean-centering variables in a data frame by subgroup
Dear R-ers, I have a large data frame (several thousands of rows and about 2.5 thousand columns). One variable ("group") is a grouping variable with over 30 levels. And I have a lot of NAs. For each variable, I need to divide each value by variable mean - by subgroup. I have the code but it's way too slow - takes me about 1.5 hours. Below is a data example and my code that is too
2010 Aug 04
6
applying strsplit to a whole column
I am sorry, I'd like to split my column ("names") such that all the beginning of a string ("X..") is gone and only the rest of the text is left. x<-data.frame(names=c("X..aba","X..abb","X..abc","X..abd")) x$names<-as.character(x$names) (x) str(x) Can't figure out how to apply strsplit in this situation - without using a
2009 Sep 23
2
Function to check if a vector contains a given value?
Dear R'rs, is there a function that checks if a given vector contains a certain value. E.g., x<-c(1,2,3,4). How can I get a TRUE or FALSE for whether x contains a 2? -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com
2010 Aug 13
3
transforming dates into years
Hello! If I have in my data frame MyFrame a variable saved as a Date and want to translate it into years, I currently do it like this using "zoo": library(zoo) as.year <- function(x) as.numeric(floor(as.yearmon(x))) myFrame$year<-as.year(myFrame$date) Is there a function that would do it directly - like "as.yearmon" - but for years? Thank you! -- Dimitri
2010 Mar 18
1
R takes long time to open
Hello. Until today I've been using R2.9 and since today R2.10 (on a PC). In both of them it takes about 20 sec for the prompt to appear IN R console after I start R. And every time it says: "Previous saved work space restored" - even if I have not saved any workspace or, in case of R2.10 - even though I have not used it once. In the older versions - R would start within 2-3 sec. Is
2010 Mar 09
2
looping through predictors
Dear R-ers, I have a data frame data with predictors x1 through x5 and the response variable y. I am running a simple regression: reg<-lm(y~x1, data=data) I would like to loop through all predictors. Something like: predictors<-c("x1","x2",... "x10) for(i in predictors){ reg<-lm(y~i) etc. } But it's not working. I am getting an error: Error in
2007 Feb 22
0
[LLVMdev] opt -verify
On Wed, 21 Feb 2007, Ryan M. Lefever wrote: > I am writing an interprocedural compiler pass. Because the passneeds > information from a FunctionPass, e.g., the post-dominance frontier > (PDF), and because a ModulePass is not permitted to require a > FunctionPass, I am forced to make my pass a FunctionPass and do majority > of its work in the doFinalization() method. ok > When
2009 Sep 17
2
referring to a row number and to a row condition, and to columns simultaneously
Hello, dear R-ers! I have a data frame: x<-data.frame(a=c(4,2,4,1,3,4),b=c(1,3,4,1,5,0),c=c(NA,2,5,3,4,NA),d=rep(NA,6),e=rep(NA,6)) x When x$a==1, I would like to replace NAs in columns d and e with 8 and 9, respectively When x$a != 1, I would like to replace NAs in columns d and e 101 and 1022, respectively. However, I only want to do it for rows 2:5 - while ignoring what's happening in