similar to: data frame row manipulation

Displaying 20 results from an estimated 100 matches similar to: "data frame row manipulation"

2004 Jan 09
3
ipred and lda
Dear all, can anybody help me with the program below? The function predict.lda seems to be defined but cannot be used by errortest. The R version is 1.7.1 Thanks in advance, Stefan ---------------- library("MASS"); library("ipred"); data(iris3); tr <- sample(1:50, 25); train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3]); test <- rbind(iris3[-tr,,1],
2012 Jan 10
1
error in Recursive
Hi I need help in the recursive problem. this is my code #Generate two random Numbers minval=20 maxval=100 cutoffValue=50 optVal<- function(cutoffValue,minval,maxval) { x=runif(2) x=x*cutoffValue for( i in 1:2) { if(x[i] < 30 || x[i] >60) # checking it falls between the range { optVal(cutoffValue,minval,maxval) } } return(x) }
2010 Mar 06
2
memory error in for loop
hi, I have been attempting to run this script and am getting some strange results. The script connects to a database and retrieves a series of tables, using sequential sql statements. I have tested all of the sql statements in the PostGreSQL terminal and they all return the desired results. I place each table into a list and run a FOR loop for 'i' in the list. The script generates
2007 Sep 04
4
Q: selecting a name when it is known as a string
I am 100% certain that there is an easy way to do this, but after experimenting off and on for a couple of days, and searching everywhere I could think of, I haven't been able to find the trick. I have this piece of code: ... attach(d) if (ORDINATE == 'ds') { lo <- loess(percent ~ ncms * ds, d, control=loess.control(trace.hat = 'approximate')) grid <-
2008 Oct 06
3
horizontal boxplot + xlim
Hi there, I get a strange behaviour of a boxplot with the following code. There seems to be a problem with the xlim-parameter. Did I do anything wrong? What else can I do to force the boxplot to have a defined x-range? x <- rnorm(100) boxplot(x, notch=TRUE, xlab=parameter, xlim <- c(-4,4), horizontal = TRUE) Antje
2009 Sep 03
2
[LLVMdev] 2.6 pre-release1 ready for testing
Hi Tanya, I have tried the 2.6 pre-release on the following host : Windows XP pro SP2 with mingw/msys : uname -a MINGW32_NT-5.1 OLIVE 1.0.10(0.46/3/2) 2004-03-15 07:17 i686 unknown gcc -v Reading specs from d:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads
2001 Jun 23
3
gcc 2.95.2/irix/Laguerre_With_Deflation/inifinte loop
I built ogg vorbis from the rc1 cvs source on Irix 6.5.12 with gcc 2.95.2. Using oggenc I encoded about 8,000 aiff files but found about a dozen where oggenc would go into an infinite loop. I tracked the problem with Laguerre_With_Deflation() as far back as logmask being Inf in floor0_forward. I'm now building gcc 3.0 with the expectation this is a compiler issue. If not, I'll back
2011 Nov 23
2
How to increase precision to handle very low P-values
Hello, Rlisters I have to compute p-values that are on the tail of the distribution, P-values < 10^-20. However, my current implementations enable one to estimate P-values up to 10^-12, or so. A typical example is found below, where t is my critical value. ########### example - code adapted from Rassoc ####################### rho01 = 0.5 rho105 = 0.5 rho005 = 0.5 t = 8 z = 2
2009 Sep 03
0
[LLVMdev] 2.6 pre-release1 ready for testing
On Thu, Sep 3, 2009 at 6:24 AM, Olivier Meurant<meurant.olivier at gmail.com> wrote: > Hi Tanya, > > I have tried the 2.6 pre-release on the following host : > > Windows XP pro SP2 with mingw/msys : > > uname -a > MINGW32_NT-5.1 OLIVE 1.0.10(0.46/3/2) 2004-03-15 07:17 i686 unknown > > gcc -v > Reading specs from d:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
2004 Aug 06
3
net/sock.c question
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi I have started to add bandwidth <limit> option to icecast. My ideea is to compute the current bandwidth by estimation on each sock_write*() call. Something like this: 1. initially we set kbps = 0, kbps_time = now and kbps_bytes = 0 2. after some time, a sock_write*() function is called which in turn calls sock_kbps_update(nobytes);
2012 Oct 02
2
problem about R
How to run pie chart for each categorical variable in a dataset?
2005 Sep 21
2
Help on optim
Dear R-help, I am new to optim function and need some help with optimization. Problem description: I am trying to optimize a weights vector such that it produce maximum value for a function maxVal. The optimization is subjected to constraint. The constraints are a) Min weight should be greater than or equal to Zero. b) Max weight should be less than or equal to 1 c) Sum of the
2009 May 07
2
for loop vectorization
Hi, I am still not familiar with vectorization. Could you help with making this for loop more efficient? The code is trying to make a Q matrix for a multidimensional state space with specific conditions. thanks Mira tmp = 0:(maxvals[1]) for(i in 2:nchars) { tmp <- outer(tmp, 0:(maxvals[i]), FUN="paste", sep=".") } states = tmp stateidx = array(1:length(states),
2016 Apr 22
2
Finding Highest value in groups
Hi I have two columns in data frame. First column is based on "ID" assigned to each group of my data (similar ID depicts one group). From second column, I want to identify highest value among each group and want to assign the same ID to that highest value. Right now the data looks like: ID Value 1 0.69 1 0.31 2 0.01 2 0.99 3 1.00 4 NA 4
2009 Sep 02
0
[LLVMdev] 2.6 pre-release1 ready for testing
Hi Tanya, The sources weren't updated for this pre-release testing. So I had the same problems on PPC. -bw On Sun, Aug 30, 2009 at 10:50 PM, Tanya Lattner<lattner at apple.com> wrote: > LLVMers, > 2.6 pre-release1 is ready to be tested by the community. > http://llvm.org/prereleases/2.6/ > You will notice that we have quite a few pre-compiled binaries (of both > clang
2016 Apr 22
0
Finding Highest value in groups
Assuming your dataframe is in a variable x: > require(dplyr) > x %>% group_by(ID) %>% summarise(maxVal = max(Value,na.rm=TRUE)) On Fri, 2016-04-22 at 13:51 +0000, Saba Sehrish via R-help wrote: > Hi > > > I have two columns in data frame. First column is based on "ID" assigned to each group of my data (similar ID depicts one group). From second column, I
2007 Mar 23
1
objects of class "matrix" and mode "list"?
Hello everyone, I cannot seem to find information about objects of class "matrix" and mode "list", and how to handle them (apart from flattening the list). I get this type of object from using sapply(). Sorry for the long example, but the code below illustrates how I get this type of object. Is anyone aware of documentation regarding this object? Thanks very much, Stephen
2002 Jan 16
2
Subsetting data frames without a loop
I KNOW this should be easy, but I'm stuck. My data frame consists of multiple observations from each of a number of stations, and what I would like to do is create another data frame that contains all the variables of the first, but only rows where a certain variable is at its maximum for the station. So, for example: > my.df stn obs v 1 1 1 0.26400396 2 2 1
2005 Jul 05
0
lowess output looks wrong (PR#7891)
Just noticed nobody has commented on this, so I took a look, and I can't see the problem (2.1.0 looks the same as 2.1.1 to me). What is supposed to be wrong? Duncan Murdoch On 5/23/2005 2:35 PM, pelzc at ohsu.edu wrote: > Full_Name: Carl Pelz > Version: 2.1.0 & 2.0.1 > OS: Windows 2000 > Submission from: (NULL) (137.53.64.158) > > > # Paste this all into an R
2009 Aug 31
10
[LLVMdev] 2.6 pre-release1 ready for testing
LLVMers, 2.6 pre-release1 is ready to be tested by the community. http://llvm.org/prereleases/2.6/ You will notice that we have quite a few pre-compiled binaries (of both clang and llvm-gcc). We have identified several bugs that will be fixed in pre-release2, so please search the bug database before filing a new bug. If you have time, I'd appreciate anyone who can help test the