forked from cJarvers/Stokelitude-R-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
183 lines (183 loc) · 8.86 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
install.packages("XML")
flyData <- xmlToDataFrame(file.choose())
library("XML").
library("methods")
library("XML")
library("methods")
flyData <- xmlToDataFrame(file.choose())
flyData <- xmlToDataFrame(file.choose())
flyData <- xmlToDataFrame(file.choose())
flyData <- xmlToDataFrame(file.choose())
flyData <- xmlToDataFrame(file.choose())
flyData <- xmlToDataFrame(file.choose())
flyData <- xmlToDataFrame(file.choose())
flyData <- xmlToDataFrame(file.choose())
flyData <- xmlParse(file.choose())
print(flydata)
print(flyData)
xmltop = xmlRoot(flyData)
class(xmltop)
xmlName(xmltop
)
xmlSize(xmltop)
xmlName(xmltop[[1]])
xmlName(xmltop[[2]])
xmlName(xmltop[[3]])
xmlName(xmltop[[3.1]])
xmlName(xmltop[[4]])
xmlName(xmltop[[3][1]])
xmlName(xmltop[[3]][[1]])
flytest=ldply(xmlToList(file.choose()), data.frame)
require("plyr")
flytest=ldply(xmlToList(file.choose()), data.frame)
flytest=ldply(xmlToList(file.choose()), data.frame)
metadata <- xmlToDataFrame(nodes=getNodeSet(flyData1,"//metadata"))[c("licanse","URIs","experimenter","experiment")
]G
metadata <- xmlToDataFrame(nodes=getNodeSet(flyData1,"//metadata"))[c("licanse","URIs","experimenter","experiment")]
metadata <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata"))[c("licanse","URIs","experimenter","experiment")]
metadata <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata"))[c("license","URIs","experimenter","experiment")]
metadata <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
View(metadata)
metadata <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata"))[c("license","URIs","experimenter","experiment")]
metadata.experimenter <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
View(metadata.experimenter)
metadata[experimenter] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
metadata['experimenter'] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
metadata["experimenter"] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
metadata <- list()
metadata["experimenter"] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
metadata[experimenter] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
metadata[1] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
URIs <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/URIs"))[c("recording","analysis","datamodel")]
experimenter <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))[c("firstname","lastname","orcid")]
View(URIs)
View(experimenter)
metadata<-list(URIs,experimenter)
xmlGetAttr(flyData, "fly")
xmlGetAttr(xmltop, "fly")
xmlGetAttr(xmltop[[1]], "fly")
xmlGetAttr(xmltop[[1]][[4]], "fly")
xmlGetAttr(xmlRoot(xmltop), "fly")
xmlName(xmltop[[1]][[4]])
xmlGetAttr(xmltop[[1]][[4]])
xmlAttrs(xmltop[[1]][[4]])
xmlAttrs(xmltop[[1]][[4]], "type")
xmlAttrs(xmltop[[1]][[4]], [["type"]])
xmlAttrs(xmltop[[1]][[4]], type)
xmlAttrs(xmltop[[1]][[4]], 'type)
""
''
)
;
xmlAttrs(xmltop[[1]][[4]], 'type')
xmlGetAttr(xmltop[[1]][[4]], "type")
xmlGetAttr(xmltop[[metadata']][['fly']], "type")
xmlGetAttr(xmltop[['metadata']][['fly']], "type")
flyDataXMLtop = xmlRoot(flyData)
experiment <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experiment"))[c("description","dateTime", "duration", "sample_rate", "arena_type, "meter_type")]
experiment <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experiment"))[c("description","dateTime", "duration", "sample_rate", "arena_type", "meter_type")]
View(experiment)
print("experiment type not recognized")
print(experiment type not recognized)
NofPeriods=xmlGetAttr(flyDataXMLtop[['sequence']][['experiment']], "periods")
xmlGetAttr(flyDataXMLtop[['sequence']], "periods")
NofPeriods=xmlGetAttr(flyDataXMLtop[['sequence']], "periods")
NofPeriods=as.integer(xmlGetAttr(flyDataXMLtop[['sequence']], "periods"))
is.integer(xmlGetAttr(flyDataXMLtop[['sequence']], "periods"))
is.integer(noquote(xmlGetAttr(flyDataXMLtop[['sequence']], "periods")))
NofPeriods=as.integer(noquote(xmlGetAttr(flyDataXMLtop[['sequence']], "periods")))
is.integer(xmlGetAttr(flyDataXMLtop[['sequence']], "periods"))
is.integer(NofPeriods)
NofPeriods=as.integer(xmlGetAttr(flyDataXMLtop[['sequence']], "periods"))
is.integer(NofPeriods)
xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence"))[c("duration","coup_coeff")]
sequence<-xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence"))[c("duration","coup_coeff")]
sequence<-xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence"))[c("period")]
View(sequence)
sequence<-xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence"))
View(sequence)
print(sequence)
require("methods")
sequence<-xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence"))
print(sequence)
period[3] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//period[@type='3']"))
period[3] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence/period[@type='3']"))
period[3] <- xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence/period[@number='3']"))
View(sequence)
sequence<-xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence/period"))
View(sequence)
experiment <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experiment"))
View(experiment)
View(experiment)
fly <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/fly"))
View(fly)
CSV_descriptor <- xmlToDataFrame(nodes=getNodeSet(flyData,"//timeseries/CSV_descriptor"))
View(CSV_descriptor)
variables <- xmlToDataFrame(nodes=getNodeSet(flyData,"//timeseries/variables"))
View(variables)
variables <- xmlToDataFrame(nodes=getNodeSet(flyData,"//timeseries/variables/variable"))
View(variables)
flyData <- xmlParse(file.choose())
flyData <- xmlParse(file.choose())
flyData <- xmlParse(file.choose())
flyDataXMLtop = xmlRoot(flyData)
##parse the metadata
URIs <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/URIs"))
experimenter <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experimenter"))
fly <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/fly"))
experiment <- xmlToDataFrame(nodes=getNodeSet(flyData,"//metadata/experiment"))
##parse sequence data
NofPeriods = as.integer(xmlGetAttr(flyDataXMLtop[['sequence']], "periods"))
sequence <- xmlToDataFrame(nodes=getNodeSet(flyData,"//sequence/period"))
##parse time series data
CSV_descriptor <- xmlToDataFrame(nodes=getNodeSet(flyData,"//timeseries/CSV_descriptor"))
variables <- xmlToDataFrame(nodes=getNodeSet(flyData,"//timeseries/variables/variable"))
View(CSV_descriptor)
View(experiment)
View(experimenter)
View(fly)
View(sequence)
View(URIs)
View(variables)
rawdata <- xmlToDataFrame(nodes=getNodeSet(flyData,"//csv_data"))
View(rawdata)
rawdata <- xmlToList(nodes=getNodeSet(flyData,"//csv_data"))
View(rawdata)
rawdata <- xmlToList(flyData,"//csv_data")
test <- xmlToList(nodes=getNodeSet(flyData,"//timeseries/variables/variable"))
test <- xmlToList(flyDataXMLtop[['csv_data']]))
test <- xmlToList(flyDataXMLtop[['csv_data']])
test <- xpathSApply(flyData, "//timeseries/csv_data")
xpathSApply(flyData, "//timeseries/csv_data", xmlValue)
test = data.frame(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
View(test)
View(test)
test = as-list(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
test = as.list(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
data.table
require(data.table)
install(data.table)
install.packages("data.table")
library(data.table)
test = data.table(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
View(test)
test = as.data.table(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
View(sequence)
View(test)
test = as.numeric(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
test <- as.numeric(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
test <- as.data.frame(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
View(test)
test <- as.data.frame.character(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
View(test)
test <- as.data.frame.character(xpathSApply(flyData, "//timeseries/csv_data", xmlValue),col.names(a_pos,torque))
test <- as.data.frame.character(xpathSApply(flyData, "//timeseries/csv_data", xmlValue),col.names=(a_pos,torque))
test <- as.data.frame.character(xpathSApply(flyData, "//timeseries/csv_data", xmlValue),col.names=[[a_pos]][[torque]]))
test <- as.data.frame.character(xpathSApply(flyData, "//timeseries/csv_data", xmlValue),col.names=[a_pos;torque]))
test <- as.data.frame.character(xpathSApply(flyData, "//timeseries/csv_data", xmlValue),col.names=(a_pos;torque))
test <- as.data.table.character(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
View(rawdata)
View(test)
test <- as.data.frame.character(xpathSApply(flyData, "//timeseries/csv_data", xmlValue))
setwd("B:/GitHub/Strokelitude-R-Scripts")
source('B:/GitHub/Strokelitude-R-Scripts/FlyDataPlotting.R', echo=TRUE)