similar to: Change negative values in column

Displaying 20 results from an estimated 1300 matches similar to: "Change negative values in column"

2009 Nov 24
6
From R to LaTeX to pdf?
Hi all, Anyone experienced in the LaTeX format? I'm trying to use the xtable package to create nice anova tables, but how do I do to produce a pdf from the resulting LaTeX table? I've tried WinShell and MiKTeX, but I couldn't get any of them working... Here's an example of the output in R: % latex table generated in R 2.9.2 by xtable 1.5-6 package % Tue Nov 24
2010 Jan 15
1
How to calculate the row wise means for grouped columns in matrix?
Hi all, I want to calculate the row wise mean of groups of columns in a matrix M. All columns belonging to the same group have the same column name. My idea is to create a new vector V containing these column names, but after first removing the duplicates. Then I would calculate the means using for instance rowMean() and by comparing the column names of M with the vector V, getting the indices
2009 Nov 24
1
Decision trees with factors and numericals
Hi all, Does any of you know how to make a decision tree when the data set contains factors and numericals? I've got a data frame with 3 columns, where y and x1 are numerical and x2 contains factors. Is it possible to use the rpart package, and in that case how? Otherwise, is there another alternative? This is what I've tried so far > rpart(LT50_NA ~ Raf + Antho,
2009 Oct 23
5
Change positions of columns in data frame
Hi all, Probably a simple question, but I just can't find a simple answear in the older threads or anywhere else. I've added some new vectors as columns in a data frame using cbind(). As they're all put as the last columns inte the data frame, I would like to move them to specific positions. How do you do to change the position of a column in a data frame? I know I can use
2009 Oct 27
2
Print several xyplots to the same page in a pdf file
Hello everybody, I'm using the lattice package and the xyplot to make several graphs like below. However, I can just print the three grouped plots onto one page as I'm putting them into a pdf-file, which gives me a huge amount of pages... Is it possible to put them all, or at least more than one on the same page, for instance put three groups beside each other like columns? ...
2009 Nov 05
1
Set colors in a PCA plot based on a gradient vector
Hi all, I'm making a PCA plot with eight variables (columns taken from a larger data frame "fieldTrial0809[idx,c(39:46)]"). I then want the symbols in the plot to be colored as a gradient from red to blue, depending on the value of another column in "fieldTrial0809[idx, c(48)]" containg temperatures from -12.1 to -5.4. I don't want to use the heat.colors(n)
2009 Oct 27
1
Exclude rows in xyplot
Hi all, I'm searching for a way to exclude outliers from my dataset while making xyplots. While plotting using pairs(), I exclude specific row in my data frame and save the settings as a variable which I later include as an argument: # Discard outliers and save settings as idx idx=with(fieldTrial0809, which(Pro>0 & Pro<0.95 & Fum>0 & Fum<0.4 & Mal>0.1 &
2010 Jan 28
2
NA Replacement by lowest value?
Hi all, I need to replace missing values in a matrix by 10 % of the lowest available value in the matrix. I've got a function I've used earlier to replace negative values by the lowest value, in a data frame, but I'm not sure how to modify it... nonNeg = as.data.frame(apply(orig.df, 2, function(col) # Change negative values to a small value, close to zero { min.val =
2009 Nov 11
1
fisher.test negative value error
Hi all, I am new to python, R and rpy2. I having few errors when I am using 'fisher.test' function where I am struck now. Please help to fix these bugs. My code for fisher.test goes this way *from rpy2 import * import rpy2.robjects as robjects def fisherExact(a,b,c,d): v = [a,b,c,d] m = robjects.r['matrix'](v,2,2) s = robjects.r['fisher.test'](m) return s *
2007 Jun 06
3
Using odesolve to produce non-negative solutions
Hello, I am using odesolve to simulate a group of people moving through time and transmitting infections to one another. In Matlab, there is a NonNegative option which tells the Matlab solver to keep the vector elements of the ODE solution non-negative at all times. What is the right way to do this in R? Thanks, Jeremy P.S., Below is a simplified version of the code I use to try to do this,
2001 Nov 20
0
Summary: non-negative least squares
Thank you Brian Ripley, Gardar Johannesson, and Marcel Wolbers for your prompt and friendly help! I will share any further learnings as I move through these suggestions. -Bob Abugov Brian Ripley wrote: I just use optim() on the sum of squares with non-negativity constraints. That did not exist in 1999. Gardar Johannesson wrote: You can always just use the quadratic programing library in R
2009 Oct 16
2
Division of data frame and deletion of values from column
Hi all, I guess this might be an easy question, but I've searched multiple help pages without finding any answear... so now I put my trust in you! I have a data frame (36 variables and 556 observations). One column contains three factors, and I would like to divide the data frame into three new ones, based on the value of the factors, thereby having only one value for all elements of the
2008 May 15
2
Unable to join Samba
hope I'm in the right place, I trying to join a samba server to Active Directory. Samba server FreeBSD 6.2 the Active Directory machine is running Windows 2008 Server When I execute "net ads join -U Administrator" I get the following error /libexec/ld-elf.so.1: /usr/lib/libkrb5.so.8: Undefined symbol "init_error_table" does any body know how to fix this error? If I
2002 Jan 15
1
another starcraft
Hello everyone! I downloaded CodeWeavers wine the other week and had it up and running in the instant of a sec. So, I mounted my Cd and installed StarCraft with no problems (except all this jibbrisch about missing fonts). Happy as a newborn daddy I started it up, and noticed that since I couldn't fill in a userid for playing, I couldn't play. it turned out that all my keyboard pressing
2000 Nov 26
1
Problem with NAs using chisq.test() (PR#748)
Full_Name: Kjetil Kjernsmo Version: 1.1.1.1 (patched the rpois :-)) OS: osf4.0e Submission from: (NULL) (129.240.28.227) Dear all, I have just gotten through a debugging session of my code, being confused for a few days. I sent what I thought was a straightforward matrix to chisq.test() and once in a while got the error message: > chisq.test(t2) Error in chisq.test(t2) : missing value where
2008 Apr 25
2
force glm estimates to be nonnegative
Is there a way to force certain formula parameters to be nonnegative? What I want to do is to estimate student capacity over time, namely by > capacity ~ Student + Student:Day I add this formula to a glm call and obtain negative learning slope estimates (Student:Day) in some cases. However, I don't want to allow for that. In such a case, glm should solve > capacity ~ Student and
2008 Nov 19
1
about Speex's PLC
Thanks for the reply. I think I'm beginning to understand but can you clarify a bit more. 1) I am confused on "trade error-free quality" part. Basically the encoder is doing something to the encoded data by looking at the SPEEX_SET_PLC_TUNING parameter? 2) How does the receiver side determine whether the packet loss occured or not? It seems only way is assigning
2009 Mar 20
1
Music on Hold doesn't play back for external callers
Hey all; I am experiencing an issue with music on Hold. I am running asterisk version 1.4.22, and have a default script set up in two places for MoH playback. For internal devices to my network that are SIP peering with asterisk, they simply dial 123 and hear the MoH music immediately. I'm using the default setup, where it just plays the wave files in the /var/lib/asterisk/moh directory. I
2009 Nov 19
2
3D plot, rotatable and with adjustable symbols
Hi all, I've tried to make a 3D plot, but have run into some problems. I'd like to have a plot that I can rotate interactively using the mouse, which is possible using the plots3d {R.basic}. However, I would like to change the symbols used as the points, but there's no pch in plot3d(). If I use the Scatterplot3d package, I'm able to change this, but not able to rotate
2010 Jan 15
2
How to delete matrix rows based on NA frequency?
Hi all, I would like to remove rows from a matrix, based on the frequency of missing values. If there are more than 10 % missing values, the row should be deleted. I use the following to calculate the frequencies, thereby getting a new matrix with the frequencies: freqNA=rowMeans(is.na(exprdata)) But is there a shorter way to remove the rows based on "(1-freqNA)>0.1"