Questions tagged as 'r'

1
answer

Probability calculation in R [closed]

I'm doing a job in R and they ask me the following ... On a craps table at a casino, a pair of dice that are not played are played 180 times per hour. In 24 hours the dice are thrown 4320. The parameters of the distribution they give me...
asked by 19.11.2016 / 22:40
1
answer

Count letters in a string in R with while ()

good afternoon. I'm trying to do a while loop, for a letter count. The objective is to obtain the count of the first 20 letters of a DNA sequence. The Script that I have is: sec <- "ACGTGCATGACGTAGCTATGCAGTCATACACGTGCATGACGTAGCTATGCAG...
asked by 14.11.2016 / 19:12
1
answer

Chartr () removes documents within the corpus - R

I'm using R 3.3.1 in Windows 10 . I have a set of 3099 txt files that I am using for text mining with the tm() package. The code was working perfectly, but suddenly it started to fail ... After trying to remove the accents fr...
asked by 13.11.2016 / 02:03
1
answer

Problems coding a variable in R

I want to code a variable in 4 categories. I know that I should use the function cut , but for many examples that I see I do not understand it. The variable should encode it into 4 categories: The first category would be between its...
asked by 15.10.2016 / 11:21
1
answer

Problems with variable type vector - USING R

I have the following problem and that is this sentence summary(mydata3$AugmentFact) I can not make it work because the object mydata3 does not exist, ok, I create the object mydata3 but apparently it is of type vector, well I...
asked by 16.10.2016 / 21:49
2
answers

Add the NA per group in r (without the apply, lapply, etc functions)

I try to add the NA per group and create a data.frame of the group and the number of NAs. Example: from the following set: Group Value A 4 A 4 B NA B 4 I need to get: Group #NA A 0 B 1   ...
asked by 30.09.2016 / 22:04
0
answers

Use of merge and _join in R

I'm trying to make a type searchV in R between two data frames, This DF Comprador is the one that will take the reference (138 ROWS) (Buyer is what I need) This DF li is the one I want to complete (520 ROWS) with...
asked by 05.01.2019 / 00:45
0
answers

NA lines when importing CSV and applying an as.tbl

How I have been importing files in xlsx ( read_excel ) and I have run my Rscript well but when importing the same file in csv, I get the first row with NAs This is a data.frame after a as.tbl with xlsx str(t) and this...
asked by 27.12.2018 / 17:27
1
answer

Why do I have the error "unexpected symbol" in the cast function?

I have a database in which I use reshape package. The variables are Date, Company Name, Price. I made it data.frame and call it Price.Per.Share My programming was as follows: md<-melt(Price.Per.Share,id=c("Company Name","Date")) a...
asked by 30.11.2018 / 19:28
0
answers

Why does the cast on r function return 1 and 0 instead of the corresponding values?

I have a database in which I use reshape package. The variables are Date , Company.Name , Price I did data.frame and call Price.Per.Share . My programming was the following: md<-melt(Price.Per.Share,id=c("...
asked by 30.11.2018 / 21:06