similar to: Problem with numeric variable

Displaying 20 results from an estimated 6000 matches similar to: "Problem with numeric variable"

2005 Aug 10
1
Problems with numeric variable containing ? values
Hello, I have a problem with the values for one column in a table. The variable represented in this column is numeric (I get TRUE when I ask is.numeric(x)). However, the values are listed ordinally and with row numbers as values, not with the ones that appear in the table. Some rows have an undefined value for this column, which appears as ? in the table (this is not an error). I wonder whether
2005 Jul 15
2
pdf() black&white; panel titles in lattice
Hello, I have two questions: 1. How can I get black and white graphics using the pdf() device? I have tried pdf(Name.pdf, bg="white", fg"black"), but I still get full-color graphics. 2. When using lattice, how do I change the title for each panel? By default it uses the categories of the grouping factor. I would like to modify the labels in the graphic without changing
2013 Apr 16
4
Singular design matrix in rq
Quantreggers: I'm trying to run rq() on a dataset I posted at: https://docs.google.com/file/d/0B8Kij67bij_ASUpfcmJ4LTFEUUk/edit?usp=sharing (it's a 1500kb csv file named "singular.csv") and am getting the following error: mydata <- read.csv("singular.csv") fit_spl <- rq(raw_data[,1] ~ bs(raw_data[,i],df=15),tau=1) > Error in rq.fit.br(x, y, tau = tau, ...) :
2013 Jul 12
2
"Proper" way to use a "hidden" function in an R-package?
R-developers: I'm working on updating my R package "spatial.tools", and one thing I was wondering was the proper way to have hidden functions -- should I simply not export them to the namespace and use the ::: operator to call them (which is what I currently do)? --j -- Jonathan A. Greenberg, PhD Assistant Professor Global Environmental Analysis and Remote Sensing (GEARS)
2012 May 02
6
Quickest way to make a large "empty" file on disk?
R-helpers: What would be the absolute fastest way to make a large "empty" file (e.g. filled with all zeroes) on disk, given a byte size and a given number number of empty values. I know I can use writeBin, but the "object" in this case may be far too large to store in main memory. I'm asking because I'm going to use this file in conjunction with mmap to do parallel
2007 Mar 12
4
R for copying and pasting selected image files?
Hello, I would like to use R to process a list of text strings. The text strings are filenames, encoding experimental settings. Based on the information in there I'd like to select certain files and copy only the selected files to another directory. The files are images and there is no need, actually no desire, to open them. Is there a way to use R for copying and pasting files with any
2006 Oct 23
6
nested if/else very slow, more efficient ways?
Hello, in the data.frame "resultsfuzzy" I would like to replace the characters in the second column ("5a", "5b", ... "5e") with numbers from 1 to 5. The data.frame has 39150 entries. I seems to work on samples that are << nrow(resultsfuzzy) but it takes suspicously long. Do you have any suggestions how to make the character replacing more
2007 Sep 17
2
removing a specific number of digist from a character string
Hello, I would like to remove the last 8 digists of character strings in a vector. Below I added a couple of elements from that vector. I have a problem defining a pattern to replace the digits using for example "sub". Removing the ".tif" part works fine using sub('.tif',"",x), but how do I get rid of the four preceding digits? Thanks for your help, Kim
2013 Jan 22
2
Adding a line to barchart
R-helpers: I need a quick help with the following graph (I'm a lattice newbie): require("lattice") npp=1:5 names(npp)=c("A","B","C","D","E") barchart(npp,origin=0,box.width=1) # What I want to do, is add a single vertical line positioned at x = 2 that lays over the bars (say, using a dotted line). How do I go about doing this?
2011 Nov 21
3
How do I query "..." in a function call?
This is probably a very noobish question, but if I want to create a function that allows an undetermined number of, say, numeric vectors to be fed to it, I would use: myfunction = function(...) { # Do something } Right? If so, how do I a) count the number of vectors "fed" to the function, and b) how do I treat those vectors as variables, e.g. for the call:
2012 Apr 05
4
Best way to search r- functions and mailing list?
R-helpers: It looks like http://finzi.psych.upenn.edu/search.html has stopped spidering the mailing lists -- this used to be my go-to site for searching for R solutions. Are there any good replacements for this? I want to be able to search both functions and mailing lists at the same time. Cheers! --j -- Jonathan A. Greenberg, PhD Assistant Professor Department of Geography University of
2012 Apr 09
1
Listing the contents of an FTP directory via R?
R-helpers: I'd like to be able to store all the file information from an ftp site (e.g. file and foldernames) through an R command. Any ideas how to do this? Here's an example site to use: ftp://e4ftl01.cr.usgs.gov/MOTA/MCD15A3.005 --j -- Jonathan A. Greenberg, PhD Assistant Professor Department of Geography and Geographic Information Science University of Illinois at
2013 Jun 10
1
Policy/best practices on renaming functions in packages
R-developers: I'm beginning to work on a manuscript for a set of functions I developed for a package I have on CRAN (spatial.tools), and I'd like to rename a function in my package to give a better idea of what it does prior to manuscript submission -- is there a "safe" way to do a backwards-compatible rename of a function within a CRAN package (so functions that rely on the
2013 Feb 01
3
Loading a list into the environment
R-helpers: Say I have a list: myvariables <- list(a=1:10,b=20) Is there a way to load the list components into the environment as variables based on the component names? i.e. by applying this theoretical function to myvariables I would have the variables a and b loaded into the environment without having to explicitly define them. --j -- Jonathan A. Greenberg, PhD Assistant Professor
2012 Dec 06
2
Best way to coerce numerical data to a predetermined histogram bin?
Folks: Say I have a set of histogram breaks: breaks=c(1:10,15) # With bin ids: bin_ids=1:(length(breaks)-1) # and some data (note that some of it falls outside the breaks: data=runif(min=1,max=20,n=100) *** What is the MOST EFFICIENT way to "classify" data into the histogram bins (return the bin_ids) and, say, return NA if the value falls outside of the bins. By classify, I mean
2007 Mar 02
1
barplot with different color combination for each bar
Hi, I'd like to construct a somewhat unusual barplot. In "barplot" I use beside=F as I'd like to have stacked bars. The height of each bar is always the same. Information in my plot is coded in the color of the bar. I therefore need to be able so assign a different combination (or order) of colors to each individual stacked bar. In the example below, the combination of
2011 Dec 12
1
Detecting typo in function argument
With some chagrin after spending a couple of hours trying to debug a script, I realized I had typed in something like ans<-optimx(start, myfn, mygr, lower<-lo, upper=up) that is, the "<-" rather than "=". The outcome on my machine was a non-obvious error several layers deep in the call stack. For info, optim() seems to stop much more quickly. The error is
2012 Oct 17
2
Completely ignoring an error in a function...
The code base is a bit too complicated to paste in here, but the gist of my question is this: given I have a function myfunction <- function(x) { # Do something A # Do something B # Do something C } Say "#Do something B" returns this error: Error in cat(list(...), file, sep, fill, labels, append) : argument 2 (type 'list') cannot be handled by 'cat' A standard
2006 Oct 25
2
update index in "for" statement during calculation
Hello, I have a time series of data as a data.frame. Occasionally there is one or more days missing (e.g. data available for days 2, 3, 4, 8, 9, 10 --> missing days between 4 and 8). The experimental time information can be found in the 2nd column of "data". I would like to have a continuous time line with one time point per day. Therefore I try to insert lines for the missing
2010 Mar 10
4
[LLVMdev] glod plugin use
Hi, I was trying to use gold plugin to compile and run some of my passes on some large softwares like mysql, apache etc. When I compile using llvm-gcc, everything works fine. But, when I followed the instructions on http://llvm.org/docs/GoldPlugin.html#build to use gold plugin, I got errors like: /home/vadve/ssahoo2/local/bin/ld: error: modules/standard/libstandard.a: no archive symbol table