Yahoo Search Búsqueda en la Web

Resultado de búsqueda

  1. There is an issue with this syntax because if we extract only one column R, returns a vector instead of a dataframe and this could be unwanted: > df[,c("A")][1] 1. Using subsetdoesn't have this disadvantage. – David Dorchies. CommentedJul 27, 2016 at 13:49.

  2. 9 de abr. de 2013 · I want to extract the first (or last) n characters of a string. This would be the equivalent to Excel's LEFT() and RIGHT().

  3. 19 de ago. de 2012 · 3 Yep, its called recycling in R-speak; the shorter object is recycled an number of times to match the length of the longer. If the number of times is non-integer, a warning about incompatible lengths is issued, but the recycled object is still used.

  4. 2 de feb. de 2015 · A simple base R solution using the substring() function (who knew this function even existed?): RIGHT = function(x,n){ substring(x,nchar(x)-n+1) } This takes advantage of basically being substr() underneath but has a default end value of 1,000,000.

  5. 5 de mar. de 2015 · dplyr >= 1.0.0. In newer versions of dplyr you can use rowwise() along with c_across to perform row-wise aggregation for functions that do not have specific row-wise variants, but if the row-wise variant exists it should be faster than using rowwise (eg rowSums, rowMeans).

  6. I presume this is a design feature in R whereby good scientific practice involves showing a certain number of digits based on principles of "significant figures". However, in many domains (e.g., APA style, business reports) formatting requirements dictate that a certain number of decimal places are displayed.

  7. 17 de sept. de 2008 · Do note that if you want the last few elements of a vector rather than just the last element, there's no need to do anything complex when adapting this solution. R's vectorization allows you to do neet things like get the last four elements of x by doing x[length(x)-0:3]. –

  8. 4 de dic. de 2010 · Since R version 3.4.0 you can use strcapture() from the utils package ...

  9. Description: Multiplies two matrices, if they are conformable. If one argument is a vector, it will be promoted to either a row or column matrix to make the two arguments conformable. If both are vectors of the same length, it will return the inner product (as a matrix). Usage: x %*% y.

  10. Like most other R functions, missing values are "infectious": whenever a missing value is combined with another string the result will always be missing. Use str_replace_na() to convert NA to "NA" Share

  1. Otras búsquedas realizadas