similar to: Get all X iterations in optim output when controls(trace=6)

Displaying 20 results from an estimated 400 matches similar to: "Get all X iterations in optim output when controls(trace=6)"

2008 Sep 24
4
rowSums()
Say I have the following data: testDat <- data.frame(A = c(1,NA,3), B = c(NA, NA, 3)) > testDat A B 1 1 NA 2 NA NA 3 3 3 rowsums() with na.rm=TRUE generates the following, which is not desired: > rowSums(testDat[, c('A', 'B')], na.rm=T) [1] 1 0 6 rowsums() with na.rm=F generates the following, which is also not desired: > rowSums(testDat[, c('A',
2009 Dec 10
2
different randomForest performance for same data
Hello, I came across a problem when building a randomForest model. Maybe someone can help me. I have a training- and a testdataset with a discrete response and ten predictors (numeric and factor variables). The two datasets are similar in terms of number of predictor, name of variables and datatype of variables (factor, numeric) except that only one predictor has got 20 levels in the training
2012 Dec 09
1
defmacro and bwplot incompatibilities?
My macro doesn't work for bwplot. But is working elsewhere. What changes should i make to fix my macro. Thanks. The complete code sample is: library(gtools) library(lattice) pic <- defmacro(fn, plotfunc, expr={png(filename=fn); plotfunc; dev.off()}) # this one fails. pic("bw.png", {bwplot(Species ~ Sepal.Length, data=iris)}) # this one works pic("p.png",
2011 Jan 17
1
Replacing rows in a data frame
R-helpers, Below is a simple example of some output that I am getting while trying to work with a data frame in R 2.12.1 for Mac. ----- > testdat <- data.frame(matrix(ncol=10, nrow=10)) > colnames(testdat) <- c('a','b','c','d','e','f','g','h','i','j') > testdat[seq(1,10,3),] <-
2010 Sep 29
2
repeat a function
I have R randomly sampling my array made up of 2 columns of data. Here is my code randomly sampling 5 different rows from my dataset to create a new dataset of 8 rows of data: testdat<-growth[sample(5,8,replace=T),] Now I want to tell R to repeat this function 50 times and give me the output. I have been searching the internet and have been unable to figure this out. Any advice
2010 Sep 29
2
resampling issue
I am trying to get R to resample my dataset of two columns of age and length data for fish. I got it to work, but it is not resampling every replicate. Instead, it resamples my data once and then repeated it 5 times. Here is my dataset of 9 fish samples with an age and length for each one: Age Length 2 200 5 450 6 600 7 702 8 798 5 453 4 399 1 120 2 202 Here is my code which resamples my
2005 Sep 14
2
Scan and Lists
This may be a newbie question - although I did search for this error message in the archives and via google and didn't see this error: The help page for "scan" indicates that among the types of data capable of being read are: > "The supported types are 'logical', 'integer', 'numeric', 'complex', 'character', 'raw' and
2011 Oct 25
2
column subtraction by row
Dear UseRs, I have a data frame that looks like this: head(test2) attributes start end StemExplant Callus RegenPlant 1 LTR_Unknown 120 535 3.198 1.931 1.927 3 LTR_Unknown 2955 3218 0.541 0.103 0.613 6 LTR_Unknown 6210 6423 6.080 4.650 9.081 9 LTR_Unknown 9658 10124 0.238 0.117 0.347 14 LTR_Unknown 14699 14894 3.545 3.625
2011 Feb 15
3
expected behavior when parsing lines with special characters
Say I have a tab-delimited table I want to read into R. What should I expect to happen if some of the entries contain the character " ' "? I thought it would read the file fine, but that is not what happens. Instead, all the values in between two " ' "s get read into one field, and things are just seriously messed up. Is this a bug, and besides removing the offending
2017 Nov 01
3
Function to save results
Hi Eric,Thanks for the explanation. Is there a way to save the results automatically after the analysis gets over?. As I recently lost the results, because I didn't save the results. I don't want to run the sink or save command after the analysis is over rather run the command for saving the file before starting to run the analysis, so the file gets saved automatically after the script has
2017 Nov 01
0
Function to save results
Let's try a simple example. > # Create a script file of commands > # Note we must print the results of quantile explicitly > cat("x <- rnorm(50)\nprint(quantile(x))\nstem(x)\n", file="Test.R") > > # Test it by running it to the console > source("Test.R") 0% 25% 50% 75% 100% -2.4736219 -0.7915433
2011 Jul 27
2
Writing a summary file in R
Hello, I have an input file: http://r.789695.n4.nabble.com/file/n3700031/testOut.txt testOut.txt where col 1 is chromosome, column2 is start of region, column 3 is end of region, column 4 and 5 is base position, column 6 is total reads, column 7 is methylation data, and column 8 is the strand. I would like a summary output file such as:
2011 Mar 12
1
Column order in stacking/unstacking
Dear R users, I'm having some problems with the stack() and unstack() functions, and wondered if you could help. I have a large data frame (400 rows x 2000 columns), which I need to reduce to a single column of values (and therefore 800000 rows), so that I can use it in other operations (e.g., generating predictions from a GLM object). However, the problem I'm having can be reproduced
2007 Jan 16
1
RODBC: sqlQuery is successful, but a similar sqlFetch returns error
Greetings guRus -- I have successfully queried a large (24,445 rows by 281 cols.) in-house database using the following RODBC query (without the line breaks) testout <- sqlQuery(channel, "select idSchedule,EXCL_Total from dbo.vwC1198_2006_RawData_With_CMPL_EXCL") This returns a dataframe of 24445 rows and two columns (as intended), but the following command testout
2012 Jul 11
4
MODE , VARIANCE , NTH PERCENTAILE
Hi, Here i have an matrix like this, ABC PQR XYZ MNO ------ ------- ------ -------- 3 6 7 15 2 12 24 15 20 5 1 2 25 50 15 35 i need to get the "MODE" - for each column-wise "VARIANCE" - for
2010 Aug 31
1
odfWeave
Dear -r-helpers, I'm trying to get my students to use odfWeave. Windows users are having trouble. I would appreciate advice. Comment 1: Hello I have spent a while today trying to get odfWeave to be successful I installed the unzip and zip program but it has not changed the error message.I have copied the error message below but I am sure it is the one others have experienced. >
1997 Nov 12
4
R-alpha: batch
Back to my favourite R subject: batch mode. Some months ago, I pointed out how the default of saving .RData automatically in batch can often lead to completely erroneous results when using data.frames. Basically the idea of .RData is to save the environment to start where one left off. This will generally be quite different than where one started the session. The idea of a batch file is to redo a
2017 Nov 01
1
Function to save results
Hi David,Thank you for the example.When I try to use the cat function, I get an error cat(attr<-getAttractors(net, type="asynchronous"))Error in cat(attr <- getAttractors(net, type = "asynchronous")) : argument 1 (type 'pairlist') cannot be handled by 'cat' Please let me know, if I have used the function in right way?. Thank you Priya ?
2005 Apr 14
2
Display execution in a function
Dear all, Here is a simplified version of a function I made: ############ plotfunc<-function(x){ #x a vector cat("please select two points","\n") plot(x) points<-locator(2) return(points) } ############ Using R version 1.01 for mac os x (aqua GUI) I would like to know what should I do to make sure that my text line will be printed prior to the drawing of the plot.
2002 Jul 09
1
ext3 file corruption
I recently patched our 2.2.20 production kernel with the ext3 patch from kernel.org and have experienced failure on more than one account. Everything seems to run great until the power goes out and the box isn't shutdown correctly. After that files are missing and the box won't boot. All of the partitions were mounted ext3 ordered mode I think. Anyone else experience filesystem