similar to: how can I delete those columes with the same element in every row?

Displaying 20 results from an estimated 400 matches similar to: "how can I delete those columes with the same element in every row?"

2009 Nov 06
2
another question: how to delete one of columes in two ones with high correlation(0.95)
my programe is below: a=c(1,2,1,1,1); b=c(1,2,3,4,1); c=c(3,4,3,3,3); d=c(1,2,3,5,1); e=c(1,5,3,5,1) data.f=data.frame(a,b,c,d,e) origin.data<-data.f cor.matrix<-cor(origin.data) origin.cor<-cor.matrix m<-0 for(i in 1:(cor.matrix[1]-1)) { for(j in (i+1):(cor.matrix[2])) { if (cor.matrix[i,j]>=0.95) { data.f<-data.f[,-i]; i<-i+1 }
2009 Mar 11
2
How to monthly,daily,yearly average
Sorry, this is my first time to post. I have a big data set: first colume is date (ex: 2008-2-150, the second is time (10:30:00), and the following columes are variaty measurement data. Every 30 min, I have one data. I want to find an effecient way to calculate the hourly, daily, monthly and yearly average, and plot them, and eventually use these average data to do further analysis. Thanks!
2009 May 01
5
PyGrub + ZFS: getbootstring. How it works?
I have NexentaCP2 (Opensolaris b104+). Parameters for the kernel: ''zfs-bootfs=syspool/rootfs-nmu-000,bootpath=/xpvd/xdf@0:a'' Pygrub returns: ''zfs-bootfs=syspool/30,bootpath=/xpvd/xdf@0:a'' Result: Boot with pygrub don''t work. What is "30" in syspool/30 ? _______________________________________________ Xen-users mailing list
2012 Jun 02
1
mtext bug
Sir, I have hit a the limits of my understanding of text / par / opar etc... I have a few related xts data frames which have multiple columns, and have written a for-loop to make a set of charts - however i do not get any margin text when i run the loop. when i test the code outside of the loop the margin text appears - however when i run the loop the margin text does not appear ... what gives?
2010 Jun 01
2
storing output data from a loop that has varying row numbers
Hi All, I am trying to run a loop that will have varying numbers of rows with each output. Previously I have had the same number of rows so I would use (and I appreciate that this will no doubt achieve some gasps as being thoroughly inefficient!): xdfrow<-(0) xdfrow1<-(1:32) xdfrow2<-(33:64) xdfrow3<-(65:96) xdfrow4<-(97:128) xdfrow5<-(129:160) xdfrow6<-(161:192)
2011 Jun 14
1
Obtaining OLAP cubes using R
Hello All, I have a dataset and I wish to obtain all possible data cuboids from it using R . For eg if my data frame is : A B C 1 1 1 1 2 1 2 2 1 The output intended is : A=1 A=2 B=1 B=2 C=1 A=1,B=1 A=1,B=2 A=2,B=2 A=1,C=1 A=2,C=1 B=1,C=1 B=2,C=1 A=1,B=1,C=1 A=1,B=2,C=1 A=2,B=2,C=1 Are there any function(s) to do this in R ? I tried a combination of expand.grid and
2011 Jun 14
1
Expand DF with all levels of a variable
Dear list, I would like to expand a DF with all the missing levels of a variable. a <- c(2,2,3,4,5,6,7,8,9) a.cut <- cut(a, breaks=c(0,2,6,9,12), right=FALSE ) (x <- data.frame(a, a.cut)) # In 'x' the level "[0,2)" is "missing". AddMissingLevel <- function(xdf) { xfac <- factor( c("[0,2)", "[2,6)", "[6,9)",
2009 Nov 02
3
how can I convert .csv format to matrix???
In my disk C:/ have a a.csv file, I want to read it to R, importantly, when I use x=read.csv("C:/a.csv") ,the x format is data.frame, I want to it to become matrix format, how can I do it ? thank you! -- View this message in context: http://old.nabble.com/how-can-I-convert-.csv-format-to-matrix----tp26156643p26156643.html Sent from the R help mailing list archive at Nabble.com.
2015 Jan 22
3
need help with renaming a variable
Hello. I am new to R, so my question/problem might be very basic, but I cannot figure out how to solve it. So, I would really appreciate your help. I would like to rename a variable in a very large file (181GB) called "2013.xdf" that is saved on my external hard drive. I tried running the following code to rename variable # 2 in the file and save this change, which produced some
2009 Dec 20
2
how to create three new variables? Thanks a lot!
Dear R experts: I have following data structure: student id, exam time and score. I want to create three new columes: 1 st before, 2nd before and 3rd before. For example, for student 1's 4th exam score is assumed to be influenced by his previous three cloest scores, which are 6, 9, and 10 in that order. For student 2's 5th exam score is assumed to be inflenced by her previous cloest
2010 Apr 14
8
how can I plot the histogram like this using R?
I want to get the plot like this, http://n4.nabble.com/file/n1839303/%25E9%25A2%2591%25E7%258E%2587%25E5%2588%2586%25E5%25B8%2583%25E5%259B%25BE%25E6%25A0%2587%25E5%2587%2586.jpg %E9%A2%91%E7%8E%87%E5%88%86%E5%B8%83%E5%9B%BE%E6%A0%87%E5%87%86.jpg not this, http://n4.nabble.com/file/n1839303/R.jpg R.jpg and the data here, thank you! http://n4.nabble.com/file/n1839303/y1.txt y1.txt can R
2011 Apr 30
1
More flexible aggregate / eval
Dear list, I would like to do some calculation using different grouping variables. My 'df' looks like this: # Some data set.seed(345) id <- seq(200,400, by=10) ids <- sample(substr(id,1,1)) group1 <- rep(1:3, each=7) group2 <- rep(1:2, c(10,11)) group3 <- rep(1:4, c(5,5,5,6)) df <- data.frame(id, ids, group1, group2, group3) df <- rbind(df, df, df) df$time <-
2009 Mar 25
2
need help with ordering of plots
I want to do a series of contour plots, 4 in all. The data is coming from a data frame named "nd.frame", which has elements "xdf", "ydf", "zdf", and "pndt". I am treating "pndt" as a factor, and it has four levels. I make a call to the lattice graphics routine "contourplot" like so:
2009 Jul 04
3
OpenSolaris 2009.06 in stub (hvm) domain at Xen 3.4.1 Dom0 with 2.6.30 vs 2.6.29.4 xenified kernel
Andy, OSOL 2009.06 been installed in stub domain (hvm domain) at mentioned Dom0 with 2.6.30 xenified kernel via xen-patches-2.6.30-2.tar.bz2 refuse to activate PV drivers. When same Dom0 starts with 2.6.29.4 xenified kernel (xen-patches-2.6.29-6.tar.bz2) kernel OSOL 2009.06 in stub (hvm) domain does activate PV drivers for xdf, xnf . Boris
2012 Mar 09
4
For loop and using its index
Dear All, I have a data set with variables x1, x2, x3, ..., x20 and I want to create z1, z2, z3, ..., z20 with the following formula: z1 = 200 - x1 z2 = 200 - x2 z3 = 200 - x3 . . . z20 = 200 - x20. I tried using a for loop and its index as: for (i in 1:20) { z(i) = 200 - x(i) } But R gives the following error message: "Error: could not find function "x"". Is there any
2011 Apr 23
2
replace certain elements in data frame
Hello, I have a data frame with 2 columns: year and code. In code column, I want to replace elements that are not "8210", "8310", or "9190" with "others". -- Sincerely, Yosub Jung. [[alternative HTML version deleted]]
2010 Dec 26
4
how to replace my double for loop which is little efficient!
Dear all, My double for loop as follows, but it is little efficient, I hope all friends can give me a "vectorized" program to replace my code. thanks x: is a matrix 202*263, that is 202 samples, and 263 independent variables num.compd<-nrow(x); # number of compounds diss.all<-0 for( i in 1:num.compd) for (j in 1:num.compd) if (i!=j) { S1<-sum(x[i,]*x[j,])
2009 Dec 21
5
Help,Suggest me some methods to identify training set and test set!!!
I want to split my whole dateset to training set and test set, building model in training set, and validate model using test set. Now, How can I split my dataset to them reasonally. Please give me a hand, It is better to give me some R code. and I see some ways like using SOM to project whole independents to 2-dimensions and find some to be training set and others are test set. like below. I
2016 Feb 28
2
Re: [PATCH] added ntfscat_i api
> Anyway, I'll fire up a Debian box in my cloud and see if I can > reproduce this also. I was able to install stretch, starting from jessie [from `virt-builder debian-8'], changing s/jessie/stretch/ in sources.list, and upgrading in the usual way. To install gfs2-utils I had to add jessie as another apt source [see my final sources.list attached]. That package is not in stretch, I
2009 Jul 01
14
can''t boot 2009.06 domU on Xen 3.4.1 / CentOS 5.3 dom0
I''ve got a CentOS 5.3 dom0 with Xen 3.4.1-rc5 (or so). I''ve tried the same stuff below with 3.4.0, no difference. I''m trying to install 2009.06 PV domU based on instructions from [1] and [2]. I can run the install fine, I can also get the kernel and boot archive (from [2]) after the install. But for the life of me I can''t get the installed domU to boot. If I