similar to: Nested for loop

Displaying 20 results from an estimated 10000 matches similar to: "Nested for loop"

2017 Aug 06
1
Nested for loop
Hi Ben, That's exactly right! Except for each set it's the sample population that is 400, 800 or 300. I want to take 3 samples, each of 100, where only the population differs. I can do this separately, but I'm having trouble putting them all on the same graph. I'd like to have sample on the x axis (1-300) and estimate on the y axis. I want to show how population affects the
2017 Aug 06
0
Nested for loop
Hi Kirsten, I can run your example code but I can't quite follow your division of sampling. Can you restate the the task? Below is what I think you are asking for, but I have the feeling I may be off the mark. Set A: 400 samples, draw 100 in range of 5 to 15 Set B: 800 samples, draw 100 in range of 5 to 15 Set C: 300 samples, draw 100 in range of 5 to 15 Ben > On Aug 5, 2017, at
2017 Aug 08
1
Nested for loop
Hi Caitlin and Ben, Thanks for your responses! My issue is that I'd like to create one continuous line, rather than 3 lines overlayed. The code I've attached works for a population of 400 and samples 100 times. I'd like to extend this to 300 samples and 3 populations. So, the x-axis would range from 0-300 samples. What I'm having trouble with is finding a way to change the
2018 Jan 02
1
httr::content without message
Thanks to all that replied. I had just looked through the httr code and sure enough for a .csv mime time it calls readr::read_csv(). The httr::content docs suggest not using automatic parsing in a package, rather to determine mime type and parse yourself and Ben's suggestion also works if I do: junk <- readr::read_csv(r1$content, col_types = cols()) Perfect. Using httr rather than
2017 Sep 06
1
rgdal error when trying to import raster
Indeed, Ben, but the question was something more like it is not a Dependency, just Suggested, so why the error... John: If you read the Introduction to the 'raster' package vignette, it indicates that some input formats are supported within the raster package and some rely on other packages. Clearly the attempt to read a TIFF was an example of the latter. Had you used a different input
2017 Dec 16
5
Generating help files for a function
Hello everyone! I'm in the process of writing a package, and I'm using the lovely "R Package" book as a guideline. However, in the midst of my work, I discovered that I had omitted a function and am now putting in it the package. Not a problem. But the problem is the help file. What is the best way to generate a help file "after the fact" like that, please? Thank
2017 Dec 16
0
Generating help files for a function
Hi, If you are using roxygen-style function documentation then why not use devtools::document()? Ben > On Dec 16, 2017, at 9:00 AM, Erin Hodgess <erinm.hodgess at gmail.com> wrote: > > Hello everyone! > > I'm in the process of writing a package, and I'm using the lovely "R > Package" book as a guideline. > > However, in the midst of my
2017 Sep 06
2
rgdal error when trying to import raster
Dear useRs, I am trying to import a raster with the line: nlcd <- raster("/home/jpolo/NRI/nlcd_nri5000.tif") And I keep getting an error like this: "Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,? : ? there is no package called 'rgdal' Error in .rasterObjectFromFile(x, band = band, objecttype =
2018 Jan 02
4
httr::content without message
Hi All: I am using httr to download files form a service, in this case a .csv file. When I use httr::content on the result, I get a message. Since this will be in a package. I want to suppress the message, but haven't figured out how to do so. The following should reproduce the result: myURL <-
2018 Jan 02
0
httr::content without message
Ahoy! That's a message generated by the readr::read_table() function (or it's friends). You can suppress it a number of ways, but this should work as httr::content() will pass through arguments, like col_types = cols(), to the file reader. junk <- httr::content(r1, col_types = cols()) See more here... https://blog.rstudio.com/2016/08/05/readr-1-0-0/
2017 Sep 06
0
rgdal error when trying to import raster
Hi, The message "there is no package called 'rgdal'" means that you don't have rgdal installed. https://cran.r-project.org/web/packages/rgdal/index.html Also, you will get very good patial-centric help if you subscribed to r-sig-geo here https://stat.ethz.ch/mailman/listinfo/r-sig-geo Cheers, Ben > On Sep 6, 2017, at 2:52 PM, john polo <jpolo at mail.usf.edu>
2018 Jan 17
3
roxygen2 error - x$tag operator is invalid for atomic vectors
Hi, I am trying to create my first R package. I will later today put the files on Github. However I gets this error and I can't find any reason for it: R> roxygen2::roxygenise() First time using roxygen2. Upgrading automatically... Error in x$tag : $ operator is invalid for atomic vectors R> Any ideas? Regards Martin M. S. Pedersen [[alternative HTML version deleted]]
2017 Aug 17
3
really dumb question with building/creating a new package.
Hello. I am creating a new RcmdrPlugin package. However, I am getting some very odd messages. R CMD build RcmdrPlugin.gstats_1.0.0 ERROR cannot change to directory ?RcmdrPlugin.gstats_1.0.0? es-macbook-air:~ emhodgess$ R CMD check RcmdrPlugin.gstats_1.0.0 Warning: ?RcmdrPlugin.gstats_1.0.0? is neither a file nor directory, skipping es-macbook-air:~ emhodgess$ cd RcmdrPlugin.gstats/
2017 Oct 24
5
Problem Subsetting Rows that Have NA's
This has every appearance of being a bug. If it is not a bug, can someone tell me what I am asking for when I ask for "x[x[,2]==0,]". Thanks. > #here is the toy dataset > x <- rbind(c(1,1),c(2,2),c(3,3),c(4,0),c(5,0),c(6,NA), + c(7,NA),c(8,NA),c(9,NA),c(10,NA) + ) > x [,1] [,2] [1,] 1 1 [2,] 2 2 [3,] 3 3 [4,] 4 0 [5,] 5 0
2013 Mar 23
1
Getting a vector result from a computed index
Greetings, I confess to being new to R, which I am exploring for some simulation modeling purposes. I am a long time programmer in PHP. I am having some trouble getting over the "steep learning curve" with some very basic things which are probably just little "a-ha" things in R. I have hunted and hunted through the manual and cannot figure this one out, so I am appealing for
2007 Jun 28
2
sampling question
I am interested in locating a script to implement a sampling scheme that would basically make it more likely that a particular observation is chosen based on a weight associated with the observation. I am trying to select a sample of ~30 census blocks from each ZIP code area based on the proportion of women in a ZCTA living in a particular block. I want to make it more likely that a block will
2011 Sep 22
1
nlm's Hessian update method
Hi R-help! I'm trying to understand how R's nlm function updates its estimate of the Hessian matrix. The Dennis/Schnabel book cited in the references presents a number of different ways to do this, and seems to conclude that the positive-definite secant method (BFGS) works best in practice (p201). However, when I run my code through the optim function with the method as "BFGS",
2009 Jan 14
3
multiple secondary axes
Dear R experts, I want to plot a line chart with another secondary axis placed right to the standard secondary axis which one can access with the axis command, so that the data lines are seen in the same plot. Is there any way to do this in R? Many thanks, Kirsten.
1997 Nov 21
2
R-alpha: nlm and gradients
At present the documentation for nlm refers the reader to Dennis and Schnabel for details on the algorithms. It also states that the function is liable to change. Can anyone tell me if the current version of nlm uses only function values or if it can use gradients and Hessians when they are available? I would like to get an idea of how difficult it would be to port the development versions of
2009 Jul 30
2
weight median by count for multiple records
Hello everyone, I have a .csv file with the following format: uniqueID SubjectID Distance_miles Tag 1 1001 5.5 3 2 1001 7 1 3 1001 6.5 1 4 1001 5 1 5 1002