Displaying 20 results from an estimated 8000 matches similar to: "Help"
2009 Jul 14
2
hi friends, is there any wait function in R
hi,
is there any wait function in R. I am running one R script to plot
many graphs it is in the for loop. its showing no error but its not
plotting well I think i can solve this problem with a wait function.
Please help me in this regards. If u need any clarification about
programme. u can find the script below.
best regards,
Deepak.M.R
Biocomputing Group
University of Bologana.
#!/usr/bin/R
2009 Jul 13
3
read.delim skips first column (why?)
Hi people,
I have a text file like this one posted:
snp_id gene chromosome distance_from_gene_center
position pop1 pop2 pop3 pop4 pop5 pop6 pop7
rs2129081 RAPT2 3 -129993 "upstream" 0.439009
1.169210 NA 0.233020 0.093042 NA
-0.902596
rs1202698 RAPT2 3 -128695 "upstream" NA
2002 Dec 18
6
Can I build an array of regrssion model?
Hi,
I am trying to use piecewise linear regression to approximate a
nonlinear function. Actually, I don't know how many linear functions I
need, therefore, I want build an array of regression models to automate
the approximation job. Could you please give me any clue?
Attached is ongoing code:
rawData = scan("c:/zyang/mass/data/A01/1.PRN",
what=list(numeric(),numeric()));
len =
2010 Jan 26
1
newton method for single nonlinear equation
Hi r-users,
I would like to solve for z values using newton iteration method. I 'm not sure which part of the code is wrong since I'm not very good at programming but would like to learn. There seem to be some output but what I expected is a vector of z values. Thank you so much for any help given.
newton.inputsingle <- function(pars,n)
{ runi <- runif(974, min=0, max=1)
2011 May 17
1
simprof test using jaccard distance
Dear All,
I would like to use the simprof function (clustsig package) but the available distances do not include Jaccard distance, which is the most appropriate for pres/abs community data. Here is the core of the function:
> simprof
function (data, num.expected = 1000, num.simulated = 999, method.cluster = "average",
method.distance = "euclidean", method.transform =
2012 Dec 10
1
Can somebody suggest how to achieve following data manipulation?
Dear all,
Let say I have following data:
RawData <- matrix(1:101, nr = 1); colnames(RawData) <- c("ASD",
as.character(as.yearmon(seq(as.Date("2012-03-01"), length.out = 100, by
= "1 month")))); rownames(RawData) <- "XYZ"
CutOffDate <- as.Date("2012-09-01")
NewDateSeries <- as.character(as.yearmon(seq(CutOffDate, to =
2009 Jul 14
5
Nested for loops
Hi,
I have spent some time locating a quite subtle (at least in my
opinion) bug in my code. I want two nested for loops traversing the
above-diagonal part of a square matrix. In pseudo code it would
something like
for i = 1 to 10
{
for j = i+1 to 10
{
// do something
}
}
However, trying to do the same in R, my first try was
for (i in 1:10)
{
for (j in (i+1):10)
{
//
2011 Sep 08
2
pie chart
Hi All,
I have txt file like :
$ cat data.txt
US 10
UK 12
Ind 4
Germany 14
France 8
> rawdata <- read.table(file='data.txt',sep='\t' , header=FALSE)
> rawdata
V1 V2
1 US 10
2 UK 12
3 Ind 4
4 Germany 14
5 France 8
I want to draw pie chart for the above data.
How to split rawdata into :
con <-
2005 Aug 04
2
Avoiding for loop
I understand that in R, for loops are not used as often as other
languages, and am trying to learn how to avoid them. I am wondering
if there is a more efficient way to write a certain piece of code,
which right now I can only envision as a for loop. I have a data file
that basically looks like:
1,55
1,23
2,12
...
that defines a matrix. Each row of the data file corresponds to a row
of the
2009 Jul 14
2
How to provide list as an argument for the data.frame()
Hi R -users,
i've a table as describe below. I'm reading the numeric value presented in this table to populate a list.
#table
#============
#X A B C
#x1 2 3 4
#x2 5 7 10
#x4 2 3 5
#============
rawData <- read.table("raw_data.txt",header=T, sep="\t")
myList=list()
counter=0
for (i in c(1:length(rawData$X)))
{
print (i)
2008 Mar 23
1
mapply
In an earlier post, a person wanted to divide each of the rows of
rawdata by the row vector sens so he did below but didn't like it and
asked if there was a better solution.
rawdata <- data.frame(rbind(c(1,2,2), c(4,5,6))) sens <- c(2,4,6)
temp <- t(rawdata)/sens
temp <- t(temp)
print(temp)
Gabor sent three other solutions and I understood 2 of them but not the
2009 Jul 22
5
Find multiple elements in a vector
Hi,
Given a vector, say
x=sample(0:9,10)
x
[1] 0 6 3 5 1 9 7 4 8 2
I can find the location of an element by
which(x==2)
[1] 10
but what if I want to find the location of more than one number? I could do
c(which(x==2),which(x==3))
but isn't there something more streamlined? My first guess was
y=c(2,3)
which(x==y)
integer(0)
which doesn't work. I haven't found any clue in the R
2006 Jul 12
4
Keep value lables with data frame manipulation
Dear R,
I import data from spss into a R data.frame. On this rawdata I do some
data processing (selection of observations, normalization, recoding of
variables etc..). The result is stored in a new data.frame, however, in
this new data.frame the value labels are lost.
Example of what I do in code:
# read raw data from spss
rawdata <- read.spss("./data/T50937.SAV",
2012 Jan 20
2
rbind()
Hello there,
Much thanks in advance for any help. I have a few questions:
1) Why do I keep getting the following error:
File1 <- read.csv("../RawData/File1.csv",as.is=TRUE,row.names=1)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file '../RawData/File1.csv': No such file or
2008 Mar 22
2
More elegant multiplication or division of a data frame with a vector
Hello,
I am importing some raw voltage multichannel measurements into an R
data frame. I need to scale each column with the respective
sensitivity for that channel. I figured how to do it, but I am curious
if there isn't a more elegant way.
Now I start with something like this:
rawdata <- data.frame(rbind(c(1,2,3), c(4,5,6)))
sens <- c(2,4,6)
and I do this:
data <-
2013 Feb 01
11
Change the location of puppet.conf
Hey guys,
Does anyone know how to change the location of puppet.conf? In my
situation, I don''t want to store it under /etc/puppet/puppet.conf or
~/.puppet/puppet.conf -- I''d like to store it under /opt/puppet/puppet.conf
in this example. Is there a method without having to symlink, perhaps with
an environment variable like PUPPET_CONF=.... ?
Thanks for your time,
Jason
--
2009 Sep 30
5
Rounding error in seq(...)
Hi,
Today I was flabbergasted to see something that looks like a rounding
error in the very basic seq function in R.
> a = seq(0.1,0.9,by=0.1)
> a
[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
> a[1] == 0.1
[1] TRUE
> a[2] == 0.2
[1] TRUE
> a[3] == 0.3
[1] FALSE
It turns out that the alternative
> a = (1:9)/10
works just fine. Are there any good guides out there on how to deal
2012 Mar 20
3
Wrong output due to what I think might be a data type issue (zoo read in problem)
Here's the small scale version of the R script:
http://pastebin.com/sEYKv2Vv
Here's the file that I'm reading in:
http://r.789695.n4.nabble.com/file/n4487682/weatherData.txt weatherData.txt
I apologize for the length of the data. I tried to cut it down to 12 lines,
however, it wasn't reproducing the bad output that I wanted to show.
The problem is that my whole data set
2009 Aug 03
2
Scale set of 0 values returns NAN??
Hi,
More questions in my ongoing quest to convert from RapidMiner to R.
One thing has become VERY CLEAR: None of the issues I'm asking about
here are addressed in RapidMiner. How it handles misisng values,
scaling, etc. is hidden within the "black box". Using R is forcing me
to take a much deeper look at my data and how my experiments are
constructed. (That's a very
2001 Jan 11
4
read data into R with some constraints
Hi,
I have a big data file (over 30,000 records) looks
like this:
100, 20, 46, 70
103, 0, 22, 45
117, -1, 34, 65
120, 15, 0, 25
113, 0, -1, 32
142, -1, -1, 55
.....
I want to read only those records having positive
values in all of the four
columns. That is, I don't want to read record # 3, 5,
and 6 into R. However,
when I type:
read.csv("data.csv", sep=",")