similar to: Sample function in R

Displaying 20 results from an estimated 11000 matches similar to: "Sample function in R"

2012 May 26
3
Problem with readHTMLTable
Hello All, i was trying to simply run the readHTMLTable on the example published in the package. And on a page I was working on. So running: u = "http://en.wikipedia.org/wiki/List_of_countries_by_population" tables = readHTMLTable(u) returns the following error: Error in tb[["thead"]] : subscript out of bounds looking up this error on the web, didnt give me any hint. Is
2012 Sep 19
1
issue accessing help files
Dear R-help community, I am unable to access help files when using the typical "?function.of.interest" command. For example, if I type "?anova", Internet Explorer opens, but I am never connected to the usual page describing the nuances of the anova function. This is a new problem (just started occurring a few days ago). I am currently using R 2.14.1 on a Windows XP machine.
2011 Feb 14
1
readPNG gives warnings and doesn't execute sample code from help files
Dear all, I noticed in the latest R version (R.2.12.1) that the readPNG gives following warning when running the example code in the help file (or when using any other png for that matter) : 50: In rasterImage(img, 1.2, 1.27, 1.8, 1.73) : Per-pixel alpha not supported on this device No picture is shown, and code I used to be able to run, doesn't run any more. > sessionInfo() R version
2012 Feb 23
1
R devel [and R 2.14.1 patched]: R CMD build now sources ~/.Rprofile
I'd like to follow up on this one. It may be that I have misunderstood something, but on both R devel (2012-02-22 r58452) and R 2.14.1 patched (2012-02-18 r58394) I can't seem to avoid loading ~/.Rprofile when I run 'R CMD <cmd>', e.g. R CMD build. For me, the loading of ~/.Rprofile by 'R CMD' started a few weeks ago, and I haven't seen it before. More details
2011 Dec 29
1
Crashing R with readline()
I get the following with R v2.14.1 patched on Windows 7: % Rterm --vanilla --silent > sessionInfo() R version 2.14.1 Patched (2011-12-26 r58001) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base
2012 Jun 02
2
Double-buffering problem, this time with an example.
Most of my animations that used to work on windows() version 2.11.1 and earlier now flash as if the double buffering is turned off or buffer swapping is triggered by other events than in the past. The simplified example below using symbols should illustrate the problem in a windows environment. windows() radius <- 8 n <- 6 ang <- seq(0,2*pi,length=n+1)[-(n+1)] ca <- cos(ang) sa
2012 Jul 17
1
R CMD build/check on Windows 7
Folks: sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] datasets splines grid tcltk stats graphics grDevices [8] utils
2012 Mar 19
1
diff(time) vs. difftime?
I just encountered another RTFM problem: With diff(as.POSIXct(...), ...) I was unable to control the units of the results. Examples: > (d.d <- diff(as.POSIXct(c('2012-12-12', '2012-12-13')))) Time difference of 1 days > (d.h <- diff(as.POSIXct(c('2012-12-12 08:00', '2012-12-12 09:00')))) Time difference of 1 hours > (d.m <-
2013 Feb 18
1
compare posterior samples from R2OpenBugs and R function bugs{R2WinBUGS}
Hi all, I used both OpenBugs and R function bugs{R2WinBUGS} to run a linear mixed effects model based on the same data set and initial values. I got the same summary statistics but different posterior samples. However, if I order these two sets of samples, one is generated from OpenBugs and the other is generated from R, they turn to be the same. And the samples from R do not have any
2008 Apr 18
2
rzinb (VGAM) and dnbinom in optim
Dear R-help gurus (and T.Yee, the VGAM maintainer) - I've been banging my head against the keyboard for too long now, hopefully someone can pick up on the errors of my ways... I am trying to use optim to fit a zero-inflated negative binomial distribution. No matter what I try I can't get optim to recognize my initial parameters. I think the problem is that dnbinom allows either
2011 Feb 04
1
rbinom and probability
Hello compadRes, I'm developing a script that selects "cells" over a certain metabolic rate to kill them. A rate between 9 and 12 means that the cells are candidates for death. I'll show you what I mean: # a would be a vector of cell metabolic rates. a<-c(8, 7, 9, 6, 10, 11, 4, 5, 6) #now identify which cells will be candidates for death, namely those cells with metabolic
2018 Apr 25
3
Can't Get Lattice Histogram Minor Tick Marks to Work
I'm drawing a paneled histogram using the lattice package. I've succeeded in adding minor tick marks to the vertical axis, but I can't get the desired number of minor tick marks between the major tick marks. I've attached a self-contained program to illustrate the problem. Thanks for your help, Don Macnaughton Here's my sessionInfo: R version 3.4.3 (2017-11-30) Platform:
2010 Apr 10
1
Unable to load EBImage
Hi group, I've spent half a day trying to figure this out and searched through different forums. I've tried to load EBImage but am getting the following problem: >Error in inDL(x, as.logical(local), as.logical(now), ...) : > cannot initialize ImageMagick >Error: package/namespace load failed for 'EBImage' My path is like this: C:\\Program
2018 Apr 25
0
Can't Get Lattice Histogram Minor Tick Marks to Work
Per the Posting Guide, why didn't you post the reproducible R code example? On April 24, 2018 8:22:15 PM PDT, Donald Macnaughton <donmac at matstat.com> wrote: >I'm drawing a paneled histogram using the lattice package. I've >succeeded in >adding minor tick marks to the vertical axis, but I can't get the >desired >number of minor tick marks between the major
2013 Feb 04
4
rJava works with 32-bit but not 64
Hello: rJava works for me under 32-bit but under not 64-bit R; see below. Suggestions? Thanks, Spencer > library(rJava) Error : .onLoad failed in loadNamespace() for 'rJava', details: call: stop("No CurrentVersion entry in '", key, "'! Try re-installing Java and make sure R and Java have matching architectures.")
2010 Oct 04
1
Help with apply
Suppose I have the following data: tmp <- data.frame(var1 = sample(c(0:10), 3, replace = TRUE), var2 = sample(c(0:10), 3, replace = TRUE), var3 = sample(c(0:10), 3, replace = TRUE)) I can run the following double loop and yield what I want in the end (rr1) as: library(statmod) Q <- 2 b <- runif(3) qq <- gauss.quad.prob(Q, dist = 'normal', mu = 0, sigma=1) rr1 <- matrix(0,
2007 Jan 23
6
can't plot a line
Consider the following: plot(0, 0, xlim=c(-10, 10), ylim=c(-50, 50)) lines(c(0,0), (2*c(-pi, pi))^2) I see no line in this plot. R version 2.4.1 (2006-12-18) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1]
2010 Nov 11
3
User input after opening graphing device
If I run the following: > windows() > > bringToTop(-1) > > interactive() [1] TRUE > > run <- readline(prompt = "Continue (Yes = 1, No = 2):") Continue (Yes = 1, No = 2): > dummy <- 1 > run [1] "" it does not allow user input though the session is interactive (it jumps right over the readline command). It would be great
2011 Mar 30
2
problem with png() and large dimensions on some 32-bit Windows machines
Hello, I encountered this: > png(file=tempfile(), width=1165, height=12983) Error in png(file = tempfile(), width = 1165, height = 12983) : unable to start png() device In addition: Warning messages: 1: In png(file = tempfile(), width = 1165, height = 12983) : Unable to allocate bitmap 2: In png(file = tempfile(), width = 1165, height = 12983) : opening device failed > On the
2015 Aug 07
3
download.file() on ftp URL fails in windows with default download method
Hi, > url <- "ftp://ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/All/GCF_000001405.13.assembly.txt" > download.file(url, tempfile()) trying URL 'ftp://ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/All/GCF_000001405.13.assembly.txt' Error in download.file(url, tempfile()) : cannot open URL