Displaying 20 results from an estimated 35 matches for "dataline".
2005 Oct 07
1
sscanf equivalent
I have a data file from which I need to read portions of
data but data location/quantity can change from file to file.
I wrote some code and have a working solution but it seems
wasteful to have to do it this way. Here's the contrived
incomplete code.
datalines <- readLines(datafile.pathname)
# marker will appear on line preceding and following
# actual data
offset.data <- grep("marker", datalines)
datalines <- NULL
# grab first column of each assoc dataline
data <- scan(datafile.pathname,
w...
1999 Jan 04
1
Names of data frame columns in an apply
...bles into one variable. These 5
variables are stored in a data frame. For example:
subjnr time var1 var2 var3 var4 var5 outcome
1 1 1 0 2 1 0 20
2 1 0 1 2 1 0 20
When I try to recode a data set like this, using (something like):
recode <- function(dataline) <-
type <- 0;
if (dataline$var1 == 1) {
type <- 1;
}
if (dataline$var2 == 2) {
type <- 2;
}
type
}
apply(data,1,recode)
I don't get what I want, because dataline$var1 always evaluates to NULL.
Is is at all possible to use the $xxx method of refering to column...
2009 Dec 06
3
SAS "datalines" or "cards" statement equivalent in R?
Hi R Users,
Is there a equivalent command in R where I can read in raw data? For example
I'm looking for equivalent R code for following SAS code:
DATA survey;
INPUT id sex $ age inc r1 r2 r3 ;
DATALINES;
1 F 35 17 7 2 2
17 M 50 14 5 5 3
33 F 45 6 7 2 7
49 M 24 14 7 5 7
65 F 52 9 4 7 7
81 M 44 11 7 7 7
2 F 34 17 6 5 3
18 M 40 14 7 5 2
34 F 47 6 6 5 6
50 M 35 17 5 7 5
;
Any help would be highly appreciated,
Gary
[[alternative HTML version deleted]]
2011 Dec 03
2
Downloading tab separated data from internet
...g from the opening form
stn<-"03015795"
myurl<-paste("http://ida.water.usgs.gov/ida/available_records.cfm?sn=",stn,sep="")
mypage1 = readLines(myurl)
# Getting the start and end dates
mypattern = '<td align="center">([^<]*)</td>'
datalines = grep(mypattern, mypage1[124], value=TRUE)
getexpr = function(s,g)substring(s,g,g+attr(g,'match.length')-1)
gg = gregexpr(mypattern, datalines)
matches = mapply(getexpr,datalines,gg)
result = gsub(mypattern,'\\1',matches)
names(result)=NULL
mydates<-result[1:2]
I want to know...
2004 Aug 06
0
Lost ogg sync using jspeex
...args[])
{
int bufferlength=44100;
int framelength=1280;
int frameduration=1000;
Vector recordBuffer=new Vector();
try
{
AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000, 16, 1, 2, 8000, true);
System.out.println("AudioFormat Created");
DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class,audioFormat,8000);
System.out.println("Dataline.Info Created");
//DataLine.Info outputDataLineInfo = new DataLine.Info(SourceDataLine.class,audioFormat,44100);
TargetDataLine targetDataLine = (TargetDataLine) AudioSystem....
2004 Aug 06
0
Lost ogg sync using jspeex
...args[])
{
int bufferlength=44100;
int framelength=1280;
int frameduration=1000;
Vector recordBuffer=new Vector();
try
{
AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000, 16, 1, 2, 8000, true);
System.out.println("AudioFormat Created");
DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class,audioFormat,8000);
System.out.println("Dataline.Info Created");
//DataLine.Info outputDataLineInfo = new DataLine.Info(SourceDataLine.class,audioFormat,44100);
TargetDataLine targetDataLine = (TargetDataLine) AudioSystem....
2004 Aug 06
0
Please Help, Lost ogg sync using jspeex
...t;BR> int frameduration=1000;<BR> Vector recordBuffer=new Vector();<BR> try<BR> {<BR> AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000, 16, 1, 2, 8000, true);<BR> System.out.println("AudioFormat Created");<BR> DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class,audioFormat,8000);<BR> System.out.println("Dataline.Info Created");<BR> //DataLine.Info outputDataLineInfo = new DataLine.Info(SourceDataLine.class,audioFormat,44100);<BR> TargetDataLine targetDataLine = (T...
2009 Sep 02
3
PRoblem with paste function
I am having trouble with paste function. I dont know how to proceed. I tried
many options but i failed miserably.
I am using a variable f1 to assign a string as below:
f1=dataLine[locAffyProbeID];
( the value of f1 is 244901_at )
Then I am using the paste function
paste("set @g1=", f1);
instead of getting set at g1=244901_at, I am getting set @g1=23.
I am not able to understand why it is so.
Can anyone help!!!!!!!Please..
Thanks
--
View this message in...
2010 Oct 07
1
Forecasting with R/Need Help. Steps shown below with the imaginary data
1. This is an imaginary data on monthly outcomes of 2 years and I want to forecast the outcome for next 12 months of next year.
data Data1;
input Yr Jan Feb Mar Apr May June July Aug Sept Oct Nov Dec;
datalines;
2008 12 13 12 14 13 12 11 15 10 12 12 12
2009 12 13 12 14 13 12 11 15 10 12 12 12
;
run;
I converted the above data into the below format to use it in R as it was giving error: asking to use only univariate time series.
data Data1;
input RR;
datalines;
12
14
17
15
13
15
15
14
15
14
16
15
15
18...
2009 Mar 02
2
[Fwd: RE: Mixing inputstreams.]
...lay multiple local ogg sound files, all triggered from a single 'play'
event. The event triggers an instance of the ogg.vorbis player for each
file to be played. However we are finding that these 'tracks' are not
synchronised, since the audioinputstream for each is passed to the
dataline, and so gets handled by the OS. We are now looking for a way to
combine these inputstreams, into a single input stream, (mixed), so that
the combined stream can be output to the dataline, and so guarantee,
that the combined or mixed sound is indeed synchronised. Since we have
some controls with...
2004 Aug 06
3
q about jspeex
Hi Marc,
thanks for the quick reply.
Marc Gimpel wrote:
> It would appear the the 'pcm2speex.read(frame, 0, frame.length)' is
> blocking which means that it is waiting for data from the underlying
> inputstream (i.e.AudioInputStream(t.input)). If it could read
> sufficient data it would transcode it. If it recieved an EOF, it
> should do some zero padding and then
2006 Jul 18
1
SpeexEncoder requires 320 samples to process a Frame, not 160
...rame, not 160" error.
Maybe there's something I'm missing, here's my code:
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.File;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.TargetDataLine;
import javax.sound.sampled.AudioFormat.Encoding;
import java.io.*;
import org.xiph.speex.*;
public class RecordTest
{
/**
* @param args
* @throws Exception
*/
private static int nbBytes = 0;
private static int obBytes...
2004 Aug 06
3
Mixing audio
Is There any intension to deal with mixing two or more streams encoded with "speex".
Most voice wise applications (such as conference) need this feature.
Oded Rephael
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org'
2004 Aug 06
2
q about jspeex
...// AudioInput
> ai=new AudioInput(t);
> // ai.start();
> if(t.input==null){
> AudioFormat format = new
> AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100, 16, 2, 4, 44100,
> false);
> DataLine.Info targetInfo = new
> DataLine.Info(TargetDataLine.class, format, 44100);
> t.input = (TargetDataLine)
> AudioSystem.getLine(targetInfo);
>
> t.input.open(format,44100);
>...
2009 Jul 11
3
Reading data entered within an R program
...the two approaches but
haven't found anything. Are there any particular advantages or
disadvantages to these two approaches? If you were teaching R beginners,
which would you present?
Thanks,
Bob
http://RforSASandSPSSusers.com
# R Program to Read Data Within a Program.
# Very similar to SAS datalines or cards statements,
# and SPSS BEGIN DATA / END DATA commands.
# This stores the data as one long text string.
mystring <-
"workshop,gender,q1,q2,q3,q4
01,1,f,1,1,5,1
02,2,f,2,1,4,1
03,1,f,2,2,4,3
04,2, ,3,1, ,3
05,1,m,4,5,2,4
06,2,m,5,4,5,5
07,1,m,5,3,4,4
08,2,m,4,5,5,5"
# The te...
2008 Feb 19
2
one-way anova power calculations
...of variance power calculation
groups = 4
n = 20
between.var = 10.5
within.var = 9
sig.level = 0.05
power = 1
NOTE: n is number in each group
I've already done the calculation in SAS with the following code:
data Dep;
Input cue $ mean weight;
datalines;
A 17.5 1
B 19 1
C 25 1
D 20.5 1
;
proc glmpower;
class cue;
model mean = cue;
weight weight;
power
stddev = 9
alpha = 0.05
ntotal= 80
power = .;
run;
This produces a power of 0.616 which is the answer I was supposed to get.
Any idea what I need to change?
Will
[[alter...
2004 Aug 06
0
q about jspeex
...// AudioInput ai=new AudioInput(t);
// ai.start();
if(t.input==null){
AudioFormat format = new
AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100, 16, 2, 4, 44100, false);
DataLine.Info targetInfo = new
DataLine.Info(TargetDataLine.class, format, 44100);
t.input = (TargetDataLine)
AudioSystem.getLine(targetInfo);
t.input.open(format,44100);
System.out.println(&...
2004 Aug 06
0
JSpeex help
...on jspeex or can some one suggest. I have tried on jspeex sourceforge.net page.
I am trying to use Pcm2SpeexAudioInputStream by creating it from tdl which received pcm_signed audio data as follows:
AudioFormat format = new AudioFormat (AudioFormat.Encoding.PCM_SIGNED, 8000, 16, 1, 2, 8000, true);
DataLine.Info targetInfo = new DataLine.Info (TargetDataLine.class, format, 8000);
TargetDataLine tdl = (TargetDataLine) AudioSystem.getLine (targetInfo);
AudioInputStream auin=new AudioInputStream (tdl);
PipedOutputStream pout=new PipedOutputStream();
PipedInputStream pin=new PipedInputStream(pout);
pcm2sp...
2011 Oct 27
1
Proc Mixed to R
...follows:
66 subjects (colonies) treated with a random treatment (1-8) and measured at
three time points.
The data structure looks like:
input colony tmt y1 y2 y3;
y=y1; date=*1*; output;
y=y2; date=*2*; output;
y=y3; date=*3*; output;
datalines;
1 3 6725 6750 925
2 8 6950 5800 11275
3 4 4200 6100 6475
Procedure:
*proc* *mixed* data=Nosema method=ml covtest;
class colony tmt;
model y=tmt date tmt*date / s;
repeated / type=un subj...
2010 Oct 07
1
auto.arima error
I am trying to use auto.arima to fit a univariate time series and do forecast.
This is an imaginary data on monthly outcomes of 2 years and I want to forecast the outcome for next 12 months of next year.
data Data1;
input RR;
datalines;
12
14
17
15
13
15
15
14
15
14
16
15
15
18
16
16
15
14
15
16
16
14
13
12
;
run;
I successfully took this data into R and used the auto.arima codes but am getting the following error:
fit <- auto.arima(Data1)
--------------------------------------------------------------------------------------...