1. D

    R shiny: Storing reactive data as a dataframe with factor values for predictive model

    i made a random forest predictive model and want my users to input the independent variables and predict the dependent variable. i'm using shiny to implement this. i am getting the following error as the reactive values are stored as character inputs where as my predictive model is built with...
  2. L

    Data frame of results

    Hi all Suppose I have 10 different models as such: fit1.glm <- glm(admit ~ gre , data = dat, family = "binomial") fit2.glm <- glm(admit ~ gpa, data = dat, family = "binomial") fit3.glm <- glm(admit ~ rank, data = dat, family = "binomial") ... Suppose then, I want to form a data frame...
  3. L

    Details on missing data in R

    Hello all, Say I have data as shown below. I want to generate a report in R like this: Missing 0 tests: 1 Missing 1 test: 2 Missing 2 tests: 2 Missing 3 tests: 1 I then want to generate a report that says the combination of missing values. For example, 1/3 of respondents who were...
  4. H

    Correlation matrix with significance

    Does anyone have a ready-made function or know a way to produce a correlation matrix with asterisks marking significance levels in R?
  5. A

    how to manipulate (best package) NoSQL data format in R

    Hi, I'm trying to manage data in a NoSQL format. Example: ID Date Rule 1 2016-02-03 A:20;B:30 2 2016-02-01 A:20 3 2016-01-01 B:50;C:10 I would like to be able to go through my data like Dataset[1["Rule]] and also to create the frequency distribution...
  6. P

    Create new variable in R dataframe by counting values equal to or greater than 1

    Hi, I have a dataframe in which I need to create a new column by counting all values equal to or greater than 1 occurring row-wise. I tried to use the following command: length(which(birds[2, 3:29] > 0)) This command only returns a value for ONE row (in this case, the 2nd row)...
  7. N

    how to split and cut (big data)

    Hello, I have table: 3 cols and over 300k rows. Col1 - ID (numeric id, ex: 123456) Col2 - Numb (numeric from 1 to 25, ex: 1) Col3 - Yes/no (0 or 1) I have 443 unique IDs. Each ID has more than 400 rows, almost of all have different numbers of rows. How to split initial table to table in this...
  8. G

    how to creat a data.frame with Duplicate column names

    I want to creat a data frame with the Duplicate column names, and it also contain rownams which are not Duplicate. The following is my code. X <- data.frame(bad=1:3, worse=rnorm(3)) colnames(X) <- c("good", "good") row.names(X)<-c("a","b","c") who can help me? Thank you very much.
  9. T

    How to define a field inside a dataframe based on the columnname and the rowname ?

    I have a dataframe called HMDAYTIME with the columnname "A" and the rownames "2" and "3", and based on a raw data csv called "DATA". My question is (i didn´t found anything about that on the internet), if i want to do a for loop to change each value of the "A" column, how can I make the...
  10. A

    R dataframe help

    Hello everyone, I'm trying to extract certain sets of data from a dataframe on some fishing data (imaginatively named "fish"). Here's how the dataframe is set up: haul fish site weight 1 1 flatfish codend 265.00 2 2 flatfish codend 265.00 3 3 flatfish codend...
  11. P

    Unlist command drops all my column names in the first row and adopts NAs

    Hi Everyone, I am having trouble turning my data.frame into a matrix format. Because I wanted to change my data.frame with mostly factor variables into a numeric matrix, I used the following code --> UN2010frame<-data.matrix(lapply(UN2010,as.numeric)) However when i checked the mode of...