R Language Learning Note 1

Source: Internet
Author: User

1. Chinese text mining software package: TMCN

2, used to eliminate the two vectors, lists, data frame, etc. in the same row or column function: Setdiff ()

3, create an empty array, used to load uncertain length data by: a <-numeric ()

4, convert the string format date to the date format with a function: As.date (), stored as a numeric value, for the standard format specified in R: year-month-day or year/month/day, you can do not need to specify the format of formats, if the input format is irregular, You need to read in the format specified by format.

To extract the numeric numbers 3 and 4 in the form {3,4}, the available methods are:

5. Appearance: Error in if (A & B): argument is of length zero error, its error is because one or more of the values in a or B are 0 or null, at which point the alternative method removes null or 0 values. If you are using which to determine if an element is contained in a vector, the error will appear in the following way:

if (which (Related==users.all[i]) ==as.integer (0)) {}
Error in if (which (related = = Users.all[i]) = = As.integer (0)) {: argument is of length zero

If the which determines that the vector does not contain the element, it indicates that the resulting vector length is 0, at which point the method can be used:

if (length (which (related==related)) ==0) {}

To solve the problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.