Displaying 20 results from an estimated 1200 matches similar to: "Subsetting a data frame by dropping correlated variables"
2011 Apr 15
2
Function for deleting variables with >=50% missing obs from a data frame
Hello R users!
I have several data frames where some of the variables have many missing observations. For example, Q1 in one of my data frames has over 66% of its observations missing. I have tried imputation with mice but it does not work for all the data frames and I get the following message or a similar message to this:
iter imp variable
1 1 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11
2011 Jun 24
4
What does class "call" mean? How do I make class "formula" into a "call"?
I have a list called "tabs" that I would like to have the same structure as my list "eqSystem." The two look like they have the same format but they are different because when I look at their attributes, class(eqSystem[[1]]) is "call" but class(tabs[[1]]) is "formula". I want to have class(tabs[[1]]) as a call too. So what does "call" mean? And how
2011 Mar 18
2
How do I delete multiple blank variables from a data frame?
Dear List Members,I have 55 data frames, each of which with 272 variables and 267 observations. Some of these variables are blanks but the blanks are not the same for every data frame. I would like to write a procedure in which I import a data frame, see which variables are blank, and delete those variables. My data frames have variables named P1 to P136 and Q1 to Q136.
I have a couple of
2011 Feb 09
3
Loop in variable names
Hello!
I would like to do some tables for several variables and I would like to write a loop that does the table for each variable. I should also point out that my data set has several missing observations and sometimes the observations that are missing are not the same for all my variables.
What I would like to do:
table(StoreData$CompanyID,
!is.na(StoreData$P2))
2011 Apr 07
1
df with max function applied to 6 lags of a variable?!?
Hello everyone!
I have a data frame of 136 variables with 270 observations. I would like to create a new data frame such that each element of that data frame contains the maximum value of the 6 prior lags of the initial data frame. So for example, if my original data frame, A, were
A1=c(7.72, 7.94, 7.56, 7.54, 0.93, 0.59, 7.21, 8.00, 7.19, 7.57)A2=c(4.27, 3.70, 3.80, 3.67, 3.83, 3.95, 4.02, 2.06,
2011 Apr 08
1
Package mice: Error in if (meth[j] != "") { : argument is of length zero
Dear R users,
I am using package mice and I am getting the error "
Error in if (meth[j] != "") { : argument is of length zero." I have tried using several different versions of R (even the one that will be coming out this month) to no avail. I am using RStudio as my interface with R. Also note that I had run this a couple of days ago and it was working fine; I can't,
2011 Apr 13
1
Overcoming warning in package zoo
Dear R users,I have a long program that I am trying to run--I am using RStudio as my interface with R. The pieces of the program run well individually but when I try to run everything in sequence it bogs down because of a warning after using rollmax from package zoo. Here is the warning:
"In rollmax.zoo(zoo(Pmat), 7, na.pad = FALSE, align = "right") : na.pad is deprecated. Use
2011 Jun 21
1
Setting up list of many equations for systemfit
Dear List Members,I am trying to set up a large system of equations and I am trying to find a simple way to set up the list command under the package system fit. Here is the example from system fit and what I am trying to do:
EQ1 <- Y1 ~ X1 + X2 + X4EQ2 <- Y2 ~ X2 + X3EQ3 <- Y3 ~ X2 + X3 + X4EQ4 <- Y4 ~ X1 + X3 + X4eqSystem <-list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)
2011 Apr 01
0
package MICE, squeeze function, calling several variables at once
Hello everyone!I have a data set with missing observations that I am trying to impute. I am using MICE and I would like the imputed values to all be positive. I have two types of variables: prices (P1 to P136) and quantities (Q1 to Q136) and I also want the range of these two types to be different. Besides these variables. I am using the squeeze function but I am unable to set it such that I
2011 Feb 14
1
R not working after loading lattice
Hello!
Happy Valentine's Day...
After I loaded the package lattice in R, it did not work. Then when I closed R and restarted it, R started with an error message and here is the feedback that I got from the R Console:
Loading required package: Hmisc
Loading required package: survival
Loading required package: stats
Loading required package: graphics
Loading required package: splines
Error in
2011 Aug 23
2
Replacing NAs in one variable with values of another variable
Hello everyone,
I am trying to figure out a way of replacing missing observations in one of
the variables of a data frame by values of another variable. For example,
assume my data is X
X <-as.data.frame(matrix(c(9, 6, 1, 3, 9, "NA", "NA","NA","NA","NA",
6, 4, 3,"NA", "NA", "NA", 5, 4, 1, 3),
2006 Jun 01
4
FW: How to create a new package?
Hi,
I'm a group of functions and I would like to create a package for load in R.
I have created a directory named INE and a directory below that named R, for
the files of R functions. A have created the files DESCRIPTION and INDEX in
the INE directory. The installation from local zip files, in the R 2.3.0,
results but to load the package I get an error like:
'INE' is not a
2011 Jun 22
3
Help Needed on Merging Columns by Summation
Dear Sirs/Madam,
I am a beginner to R, and I am currently working on a data matrix which looks like this:
> head(oligo)
ko:K00001 ko:K00003 ko:K00005 ko:K00008 ko:K00009 ko:K00010 ko:K00012
AAA 370 631 365 67 164 455 491
KAA 603 1208 170 157 68
2007 Feb 21
2
file path
Hello,
It is possible to return the path of the current working R-file (in
execution)?
Thanks,
Rita Sousa.
[[alternative HTML version deleted]]
2006 Dec 12
2
tklistbox...
Hi everyone,
I have different listboxes in the same toplevel window.
The problem is, if I select (by left clicking) one of those listbox
elements, the current selection in the other listboxes is cleared!
Anybody knows how I can prevent this?
Thanks,
---------------------------------------------------
Rita Sousa
DME - ME: Departamento de Metodologia Estatística - Métodos Estatísticos
INE -
2011 Aug 22
3
Ignoring loadNamespace errors when loading a file
On a Unix machine I ran caret::rfe using the multicore package, and I
saved the resulting object using save(lm2, file = "lm2.RData").
[Reproducible example below.]
When I try to load("lm2.RData") on my Windows laptop, I get
Error in loadNamespace(name) : there is no package called 'multicore'
I completely understand the error and I would like to ignore it and
2001 Oct 16
4
Assignment of structures on a given environment
Hi,
In order to avoid deep copies by passing large arguments to functions or
returning values, I'm trying to do the assignment of variables in a
given environment. The problem is when I try to assign a structure: a
list for example.
If I have:
ind <- c("a","b")
my idea is doing something like
l <- alist()
l[ind] <- as.list(c(20,40))
in a given
2007 Sep 20
2
Package Survey
Hello,
How I use the function as.svrepdesign without memory.size problems?
desenho_npc_JK <- as.svrepdesign(desenho_npc,type="JKn")
Error: cannot allocate vector of size 161.3 Mb
In addition: Warning messages:
1: Reached total allocation of 1022Mb: see help(memory.size)
2: Reached total allocation of 1022Mb: see help(memory.size)
3: Reached total allocation of 1022Mb:
2012 Aug 26
3
yum relocatable RPMs
Hello,
I dont have root access but I would like to install several packages (gtk)
in my home directory. Is it possible to install it via yum ?
--
--- Get your facts first, then you can distort them as you please.--
2013 Apr 07
2
nfs timeout
hi,
I use automounter to mount to many hosts
/net/<hostname>/dir
When the hostname is unavaliable it seems NFS gets stuck. I would like to
set a NFS timeout (say 60 secs). If not available then error. I need to use
hardmount but is there such a thing as NFS client timeout?
--
--- Get your facts first, then you can distort them as you please.--