search for: exampledata

Displaying 20 results from an estimated 24 matches for "exampledata".

2011 Aug 03
4
slow computation of functions over large datasets
...rame (close to 1m lines). The computation of this function is painfully slow: in 1min only about 90 rows are calculated. The computation time taken for a given number of rows increases with the size of the dataset, see the example with my function below: # small dataset: function performs well exampledata<-data.frame(orderID=c(1,1,1,2,2,3,3,3,4),itemPrice=c(10,17,9,12,25,10,1,9,7)) exampledata[1,"orderAmount"]<-exampledata[1,"itemPrice"] system.time(for (i in 2:length(exampledata[,1])) {exampledata[i,"orderAmount"]<-ifelse(exampledata[i,"orderID"]==...
2009 Jan 14
2
runs.test in by() statement
...work with runs.test() as the function. Here is what I have: Consider a data frame with two variables and 40 observations. Column 1 is the name of the interviewer and 2 is a variable that could be either 0 or 1. ] Thus "interviewer" and "var". This generates such a data frame exampledata<-data.frame(interviewer=rep(letters[1:2], 1), var=round(var=runif(40))) I do the runs test on "var" and it works runs.test(as.factor(exampledata$var)) Runs Test data: as.factor(exampledata$var) Standard Normal = -1.626, p-value = 0.1039 alternative hypothesis: two.sided I can cat...
2008 Mar 04
2
summarizing replicates with multiple treatments
...erent treatment variables, and would like to calculate the mean and standard deviation of the replicates for each day and treatment variable. It seems like it should be easy, but I've only managed to do it for one treatment at a time using subset and tapply. Here is an example dataset: > `exampledata` <- structure(list(day = c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L), treat = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L ), .Label = c("a", "b"), class = "factor"), replicate = c(1L, 2L, 3L, 1L, 2...
2012 Oct 05
1
avoid <<- in specific case
...nment with values calculated inside the main function. barplot(a$counts, space=0, horiz=T, ylim=hpos(ylim), col=col, border=border,...) axis(2, at=hpos(labelat), labels=labels, las=las, ...) print("use hpos() to address y-coordinates") } # Data and basic concept set.seed(8); ExampleData <- rnorm(50,8,5)+5 hist(ExampleData) horiz.hist(ExampleData, xlab="absolute frequency") # Caution: the labels at the y-axis are not the real coordinates! # abline(h=2) will draw above the second bar, not at the label value 2. Use hpos: abline(h=hpos(11), col=2) # Further arguments ho...
2004 Jul 22
3
Replace only Capital Letters
Dear All, I have these data: exampledata <- c("This is one item", "This is Another One", "And so is This") I would like to find each occurence of a blank space followed by a Capital Letter and replace it by a blank space, a left curly brace, the respective Capital Letter, and then a right curly brace. I...
2009 Nov 21
1
what do i do to fix missing packages...see error
> exampledata <- rnorm(10000) > summary(exampledata) Min. 1st Qu. Median Mean 3rd Qu. Max. -4.030000 -0.666200 -0.023390 -0.009384 0.664700 4.092000 > desc <- function(mydata) { + require(e1071) + quantls <- quantile(x=mydata, probs=seq(from=0, to=1, by=0.25)) +...
2011 Jan 20
2
adding text to y-axis per row of panels (lattice)
...as a base graphic plot, I'd use mtext, but I'm not sure how to get to the same results when using lattice. Here is some example data: library(lattice) varx <- c(1:4,1:4,1:4,1:4) vary <- c(2,2,1.5,0.3,1,2,3,4,-1,-0.5,3,-1,-1,-0.5,1,-3) condvar <- c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) exampledata <-data.frame(cbind(varx,vary,condvar)) exampledata xyplot(vary~varx|condvar, type="o",data=exampledata, ? ? ? scales=list(alternating=F,x=list(at=c(1,2,3,4)), y=list(at=c(-3,-1,0,1,3))), panel=function(x,y,...){ ?panel.abline(h=-1) ? ? ? ? ? ? ? ? ? ? ? ? ? panel.abline(h=1) ? ? ? ? ?...
2017 Nov 29
3
Removing a data subset
Say I have a dataset that looks like Location Year GW_Elv MW01 1999 546.63 MW02 1999 474.21 MW03 1999 471.94 MW04 1999 466.80 MW01 2000 545.90 MW02 2000 546.10 The whole dataset is at http://doylesdartden.com/ExampleData.csv and I use the code below to do the graph but I want to do it without MW01. How can I remove MW01?? I'm sure I can do it by SubSeting but I can not figure out how to do it. Thank you David -------------------------------------------------------------- library(ggplot2) MyData <- read....
2011 Jun 07
1
XML segfault on some architectures
...the parseKGML2Graph function in the Bioconductor KEGGgraph package, but as far as I can tell the underlying issue seems to be with the xmlTreeParse which is called by parseKGML2Graph. I'm trying this piece of code, from the xmlTreeParse help page: library(XML) fileName <- system.file("exampleData", "test.xml", package="XML") x <- xmlTreeParse(fileName) On my Mac and on nodes of one of the linux clusters I have access to, this works fine. But on another of the linux clusters I use, I get a segfault every time, on both 32-bit and 64-bit nodes of the cluster. The...
2012 Jan 22
1
hook for configuring checking of \example{} sections of the documentation during R CMD check
Dear all, In a new package, I try to check the examples given in the \example section of the Rd files. However, the examples cannot be run if the package is not instructed, during startup time, in the place where some data are to be found ( with system.file("exampleData", "xyz", package="rcqp"). Is there any hook available, or a place where some code might be added, so that it is executed before all the examples collected in Rd files are executed? Best regards, Sylvain Loiseau ----- Sylvain Loiseau sylvain.loiseau at univ-paris13.fr Un...
2017 Nov 29
0
Removing a data subset
Reading in the data from the file x <- read.csv( "ExampleData.csv", header = TRUE, stringsAsFactors = FALSE ) Subsetting as you want x <- x[ x$Location != "MW01", ] This selects all rows where the value in column 'Location' is not equal to "MW01". The comma after that ensures that all columns are copied into the ame...
2010 Jul 06
1
Error in affypdnn package
...;Biobase")' and for packages 'citation(pkgname)'. registering new summary method 'pdnn'. registering new pmcorrect method 'pdnn' and 'pdnnpredict'. > library(hgu133atagprobe) Loading required package: AnnotationDbi > energy.file <- system.file("exampleData", "pdnn-energy-parameter_hg-u133a.txt", package = "affypdnn") > params.chiptype <- pdnn.params.chiptype(energy.file, probes.pack = "hgu133aprobe") Calculating chip type specific parameters, (may take some time)... | | |Error in object$call...
2007 May 08
1
Looking for a comprehensive descriptive statistics package
Hi all, I'm looking for a package that will give me comprehensive set of descriptive statistics, including skew and kurtosis. Also, is there a similar package that will provide multivariate descriptive statistics as well? Thanks in advance, David -- =========================================================================== David Kaplan, Ph.D. Professor Department of Educational
2015 Oct 31
1
Example input data with example output using relative pathway in vignette of R package?
.../r-pkgs.had.co.nz/data.html), and believe I should keep my example data as raw data, as it must be parsed to generate the output. So, I created a directory in my package structure /Users/userName/myPackage/inst/extdata/ with subdirectories InputFiles and OutputFiles. And I put the example file (exampleData.csv) inside of the InputFiles subdirectory (/Users/userName/myPackage/inst/extdata/InputFiles). My vignette is located in: /Users/userName/myPackage/vignettes/myPackage.Rnw It contains the following syntax: <<eval=FALSE>>= fileString = "/Users/userName/myPackage/inst/extdata/In...
2010 Aug 09
2
Results with name of dataset
I generate and save a dataset For example exampledata<-runif(10) library("R.utils"); saveObject(exampledata, file="exampledata_9810.RData"); exampledata_9810<- loadObject("exampledata_9810.RData"); I use ex function to make alot of calculations using sink to export results (in this simply example only summary of d...
2013 Mar 05
0
Meaning of error message when exporting to MS Excel
...column ?BMI? is encountered. Having searched for similar error message I have been unable to deduce the meaning of the error, particularly the ?apply(r.obj[, iter], 1, paste, collapse = "\t")? part. Can anyone explain what the error message means and how to resolve it? Many thanks, Dove ExampleData.csv <http://r.789695.n4.nabble.com/file/n4660378/ExampleData.csv> -- View this message in context: http://r.789695.n4.nabble.com/Meaning-of-error-message-when-exporting-to-MS-Excel-tp4660378.html Sent from the R help mailing list archive at Nabble.com.
2014 Dec 15
3
Significant memory leak when using XML on Windows
...ssible for people to see what's actually going on so they wouldn't have to program their own stuff for things like reading the actual memory consumed by the Rterm process etc.. If you prefer plain vanilla, though, I guess this would be it: memoryLeak <- function( x = system.file("exampleData", "mtcars.xml", package="XML"), n = 5000, free_doc = FALSE, rm_doc = FALSE, use_gc = FALSE ) { lapply(1:n, function(ii) { doc <- xmlParse(x) if (free_doc) free(doc) if (rm_doc) rm(doc) if (use_gc) gc() NULL }) } 2) If I knew my way around...
2010 Aug 27
1
Grouping sets of data, performing function and re-assigning values
Hi there, I hope you have time to read this question and offer a suggestion or two. My basic question is this: I have data in sets of three. I would like to combine the data from each set, perform a function (probably just taking the median and MAD), then re-assign these values to each of the original sets of data. As a bit of background, I have performed a microscopy screen and analyzed
2011 Aug 26
0
How to use xmlFlatListTree?
...t currently implemented? Am I missing something about environment specific functions here? 2. From following the examples, I still don't understand what xmlHashTree does, or how to make the results fit into a data.frame. Here's what I'm trying to do, using "book.xml" from the exampleData folder in the package: chapter title section title 1 XML 1 The elements of an XML document 1 XML 2 Parsing XML 1 XML 3 SAX 2 XSL 1 templates 2 XSL 2 XPath expressions 2 XSL 3 named templates Can anyone please guide me how xmlHashTree is used...
2009 Dec 13
0
need a solution to an R-problem: consultant available?
...sted my current Rscript below, with the location of the error noted, in addition, below the Rscript, is some example data. Let me know what you think. Cheers, Andre ###RSCIPT STARTS require(graphics) rm(list=ls()) # clears everything in working directory data = read.delim("F:/R_code/exampledata.txt") #head(data) # shows header attach(data) #attaches data to current run datasort=data[order(Stage), ] #sorts data so predicted values follow in systematic order #datasort # shows sorted data starts = list(const =0.00001, alpha = 20) fm <- nls(Discharge ~ const*Stage...