search for: myresult

Displaying 20 results from an estimated 38 matches for "myresult".

Did you mean: myresults
2009 Jul 07
4
Test for X=1 fails, test for >0 works, data in text file is 1
Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which is it? Thanks in advance. I've read a data file, reshaped it and then created MyResults by keeping only lines where the value column is greater than 0. So far so good. The data in MyResults looks good to me by eye. The problem comes in when I try to further subset MyResults into two files, one with PosType=1 and the other with PosType=-1. Looking at the dimension of the results t...
2009 Jul 21
4
list of lm() results
How can I get the results of lm() into a list so I can loop through the results? e.g. myResults[1] <- lm(...) myResults[2] <- lm(...) myResults[3] <- lm(...) ... myResults[15] <- lm(...) myResults[16] <- lm(...) so far every attempt I've tried doesn't work throwing a "number of items to replace is not a multiple of replacement length" error or simply not wor...
2003 Apr 28
4
how to present a table in powerpoint?
Hi, I have a nicely printed table of results generated by R's > print(myresult) where myresult is a "data frame". I am trying to put this table into a powerpoint slide for presentation without re-typing and re-formating, i.e., present it as it is in the R window. This saves time when there are a lot of tables to be presented. I tried > sink("myresult.txt...
2005 Dec 07
1
Dots argument in apply method
...uot; %in% variableNames)) stop(paste("The slot Data of", deparse(substitute(obj)), "does not contain an observation variable as it should." ) ) if (margin == 1) { ## in that case we don't care of the group myResult <- apply(observation, 1, fun, ...) return(myResult) } else if (margin == 2) { if (is.null(groups)) { ## no groups defined myResult <- apply(observation, 2, fun, ...) return(myResult) } else { ## groups defined groups <- eval(groups) X <-...
2012 Jul 13
1
functions of vectors : loop or vectorization
...r function of several variables that I want to optimize over one letting the other describe a family of curves. In short, I wan't to optimize f(x,a,b) for several values of a and b. It is easily done with a loop. Here's an example : a = 1:5; b = 1:5; myfunction = function(x){y*x-(x+z)^2}; myresults = array(dim=c(length(a),length(b))); for(y in a){ for(z in b) { myresults[y,z] = optimize(myfunction,c(-10,10),maximum=TRUE)$maximum }}; myresults; [,1] [,2] [,3] [,4] [,5] [1,] -0.5 -1.5 -2.5 -3.5 -4.5 [2,] 0.0 -1.0 -2.0 -3.0 -4.0 [3,] 0.5 -0.5 -1.5 -2.5 -3.5 [4,] 1.0 0.0 -1.0 -2.0 -3.0 [5,]...
2009 Jul 08
1
What is cast telling me?
...ing some sort of sum then I'd like to learn how to replace the value in the table with something meaningful to me. On thing would the the ExNum value from the first occurrence at that crosspoint, or the PL_Pos value, etc. How might I write a fun.aggregate to to that? Thanks, Mark > dim(MyResults) [1] 1105 12 > head(MyResults, n=15) ExNum PosType EnDate EnTime ExDate ExTime PL_Pos Costs Save2 time value id 1.1 1 -1 1080103 800 1080103 1310 520 26 0 1 746.2 1 2.1 2 -1 1080104 755 1080104 1310 530 26 0 1 721.9 2 3.1 3...
2006 Jul 19
1
A couple of problems
...to wrap up and pass back some data to my controller. It seems that if I create the class either inside or outside of my worker class (in the same file) it gets wrapper by a DRb::DRbUknown object and therefore cannot be accessed from my controller. class MyWorker < BackgrounDRb::Rails class MyResult attr_reader :result def initialize(result) @result = result end end def do_work() end def results MyResult.new(100) end end -- my_controller.rb -- def results results = MiddleMan.get_worker(session[:job_key]).results p results.result #=> undefined method...
2010 Dec 03
2
How to get 'R' to talk BACK to other languages / scripts??
...m a bash script: #!/bin/bash myTest=echo /usr/local/bin/R --no-restore --no-save -f testing.R.r echo "myTest contains" echo $myTest And ideally this should write out the results of the "testing.R.rscript". So that if the testing. R.r script said something simple like: myResult <- paste("Hello World") Then in the output of the bash script, it should say "myTest contains\nHello World" or something quite similar. But instead it says myTest contains R version 2.11.1 (2010-05-31) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3...
2009 Mar 22
2
Following progress in a lapply() function
...instance, I have a list of 50,000 slots: aList <- replicate(50000,list(rnorm(50))) That need to be process through the following custom function: myFnc <- function(x){ tTest <- t.test(x) return(list(p.value=tTest$p.value,t.stat=tTest$stat)) } Using an lapply statement, as in: myResults <- lapply(aList, myFnc) The goal would be to report on the progress of the lapply() function during processing. Any suggestion would be greatly appreciated. Thanks Marco -- Marco Blanchette, Ph.D. Assistant Investigator Stowers Institute for Medical Research 1000 East 50th St. Kansas Cit...
2006 Aug 09
3
objects and environments
Dear list, I have two functions created in the same environment, fun1 and fun2. fun2 is called by fun1, but fun2 should use an object which is created in fun1 fun1 <- function(x) { ifelse(somecondition, bb <- "o", bb <- "*") ## mymatrix is created, then myresult <- apply(mymatrix, 1, fun2) } fun2 <- function(idx) { if (bb == "o) { # do something with idx } else { # do something else with idx } } What should I do to have "bb" available in fun2? I tried everything I could with sys.parent(), sys.frame(), parent.env(...
2012 Feb 13
2
Puzzling... puzzling... puzzling...
...ry area... This is very dangerous because I have used naming conventions such as: MyLongVariableNameForA MyLongVariableNameForB MyLongVariableNameForC ... ... Then if internally they are actually the same thing then all my programs messed up... Any thoughts? >env=new.env() >load("MyResults.rData", env) >identical(env$sRes1$nPositionsOptimized, env$sRes1$nPositionsOptimizedM) [1] TRUE [[alternative HTML version deleted]]
2006 Mar 11
6
is there a formatted output in R?
something like "sprintf" in C? so I can do: print(sprintf("the correct result is %3.4f\n", myresult)); ------- Also, I am desperately looking for a "clear console screen" function in R... thanks a lot! [[alternative HTML version deleted]]
2006 Jul 24
1
XMLRPC WebService and Structs
...</value> </param> </params> </methodResponse> Now, by the looks of things I need to do something like. class IsCorrectApi < ActionWebService::API::Base api_method :isValid, :expects =>[MyCall,{:code=>:string}], :returns =>[Success,MyResult] end class MyCall < ActionWebService::Struct member :username,:string member :password,:string member :remoteip,:string end class MyResult < ActionWebService::Struct member :responseData,:string end But you can see from the returning XML above, that There is a respon...
2017 Nov 24
2
Multiple sets of proportion tests
...variable I variable II Variable III ......... 200 Freq.of cases (gp I) 6493 9375 5524 Freq. of cases (gpII) 509 462 54 The result I need for the first column can be given using this code : MyResultsI <- prop.test(Mydata$variable I ,c(200,100)) for the second column :- MyResultsII <- prop.test(Mydata$variable II ,c(200,100)) and so on .. I need to do the analysis for all columns and have only the columns with significant p-value results to be written in the the third row under each c...
2017 Nov 24
1
Multiple sets of proportion tests
Thank you for clarifying this point but my main question was about how to modify my code to do the analysis correctly. The code I mentioned :- MyResults <- apply(Mydata, 2, function(x)prop.test(Mydata,c(200,100)) Results in this error : 'x' and 'n' must have the same length in the prop.test(x,n). How can I modify "x' or "n" arguments so the analysis gives me the desired output shown in my previous post ?...
2007 Mar 07
1
Fwd: Package-RODBC-MSACCESS
I have used RODBC to get the database i can view the tables in RGUI-2.4.1 how can i query the records in R> i tried with sqlQuery need some help JJ -- Lecturer J. Joshua Thomas KDU College Penang Campus Research Student, University Sains Malaysia -- Lecturer J. Joshua Thomas KDU College Penang Campus Research Student, University Sains Malaysia [[alternative HTML version deleted]]
2007 Aug 24
2
Saving results from Linux command line
Hi All, I'm used to running R on Windows & learning Linux. I know ESS is the way to go in the long run, but I'm trying now to just understand the command line. I can interactively enter commands, see the results on the screen and save input & output to myresults.txt with this approach: $script myresults.txt $R > ...r commands... >q() $exit I can also use the Linux tee command to do essentially the same thing. Both of those approaches do what I want, but I assume there is a way to do it within R. I've been through AITR Appendix B and the FAQ l...
2010 Aug 11
1
sem & psych
...MR) iterM2 <- as.numeric(myModlChiM2$iterations) resultsM2 <- as.numeric(c(convergenceM2, chiM2, dfM2, chiM0, dfM0, GFIM2, AGFIM2, RMSEAM2, CFIM2, BICM2, SRMRM2, iterM2)) } designparameters <- c(traitLoad, traitCorr, methodLoad, methdCorr) myResults <- c(designparameters, SampleSize, resultsM1, resultsM2) #, convergenceM3, resultsM3) # return(myResults) } # End of function sizeControlGroup ############ Loop for replications ########################################################## totalRepeats = 100 for(myRepeats in 1:total...
2008 Feb 15
12
Transfer Crosstable to Word-Document
# Dear list, # I am an R-beginner and # spent the last days looking for a method to insert tables produced # with R into a word document. I thought about SPPS: copy a table from # an SPO-file and paste it into a word document # (if needed do some formatting with that table). # Annother idea was, to produce a TEX-file, # insert it and make it a word-table. # I found the following libraries, which
2010 Dec 18
0
R-sig-DB Digest, Vol 74, Issue 2
..." all > them > into one data frame. > Also I need to translate each object to UTF-8. Of course many of address > maybe be empty, so, my loop can't stops because this. > > I never type a loop before, so, in my first shot I get an error. Can > somebody help me? > > myresult <- NULL > n <-length(mysites) > for (i in 1:n) { > bases <- read.table(n) > bases[i]<-read.table(mysites[[i]], sep=";", header=TRUE, > fileEncoding="windows-1252") > tudo <- rbind(myresult, bases) > } > > Error in read.table(n) : '...