r function unzip error 1 in extracting from zip file

Environment: Windows 7 OS RStudio Version 0.99.491 I have been programming in R for about 4 months via the Coursera Data Science curriculum, but I have NEVER been successful in using the unzip function. I’ve looked at the forums for hours for potential solutions, syntax problems, undefined arguments, etc., but to no avail. I eventually … Read more

What does is.na() applied to non-(list or vector) of type ‘NULL’ mean?

The problem in this specific case The right hand side of your formula is 1, which makes it a null model. coxph calls coxph.fit, which (perhaps lazily) doesn’t bother to return coefficients for null models. Later coxph calls extractAIC, which erroneously assumes that the model object contains an element named coefficients. The general case is.na … Read more

How to counter the ‘non-numeric matrix extent’ error in R?

As Roland pointed out, one problem is, that col doesn’t seem to be numeric. Please check if means is a dataframe or matrix, e.g. str(means). If it is, your code should not result in the error: ‘non-numeric matrix extent’. You also have some other issues in your code. I created a simplified example and pointed … Read more

Error: isTRUE(gpclibPermitStatus()) is not TRUE

You can look at Hadley’s master file for ggplot2/R/fortify-spatial.r. Based on this outside link, my understanding is that lines 31–34 (in it’s current form) used to read something like So back then one way to attack the problem was to turn on the license As @rcs, @Edzer Pebesma, and this answer mention, rgeos should resolve the issue for more recent installations.

Get dplyr count of distinct in a readable way

How about this option: Use filter to filter out any rows where aa has NAs, then group the data by column bb and then summarise by counting the number of unique elements of column aa by group of bb. As you can see I’m making use of the pipe operator %>% which you can use to “pipe” or “chain” commands together when using dplyr. This helps … Read more

Suppress output of a function

It isn’t clear why you want to do this without sink, but you can wrap any commands in the invisible() function and it will suppress the output. For instance: Otherwise, you can always combine things into one line with a semicolon and parentheses: